LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-26-2008, 11:50 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
remote copy disk


I have a server that have many partition like /var , /usr .... , now I would like to make a copy of this disk ( like diskcopy a: a: in windows ) , including anything in this server ( data & partition etc ) , except plug a harddisk into the server then run diskcopy , can I do it via the network copy ? thx
 
Old 08-26-2008, 12:29 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
scp can copy recursively. But making a image-copy onto a remote location will require suitable permissions in ssh ...that is all. You can make a image, send it and write it too. A script should do
 
Old 08-26-2008, 12:38 PM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by amani View Post
scp can copy recursively. But making a image-copy onto a remote location will require suitable permissions in ssh ...that is all. You can make a image, send it and write it too. A script should do
thx reply ,

scp could copy the files but seems can not copy operating system / partition , if I want the destination server is completely the same as the original server , can advise what can i do ? thx
 
Old 08-26-2008, 01:12 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
You should be able to create an image of a device from a remote machine, provided you have root access to that machine. You would need to un-mount the device, and then scp it's device node to the local machine, like this (example disk is /dev/sdb, which is my USB pendrive):
Code:
localhost% ssh root@remotehost
remotehost# umount /dev/sdb
remotehost# exit
localhost% scp root@remotehost:/dev/sdb remotehost_sdb.img
Presumably, you could then use dd to raw-write that image to a local device of the same size/type.

Playing with images like this is fiddly though. IMO, a better way is just to use a mirroring tool to copy files from the remove device to some local directory. rsync is a tool designed to mirror large number of files between two machines. It is especially good when it comes to updating a previously-made copy, as it will intelligently choose which files to copy, and with large files will only copy parts of files which have been modified.
 
Old 08-26-2008, 06:36 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by matthewg42 View Post
You should be able to create an image of a device from a remote machine, provided you have root access to that machine. You would need to un-mount the device, and then scp it's device node to the local machine, like this (example disk is /dev/sdb, which is my USB pendrive):
Code:
localhost% ssh root@remotehost
remotehost# umount /dev/sdb
remotehost# exit
localhost% scp root@remotehost:/dev/sdb remotehost_sdb.img
Presumably, you could then use dd to raw-write that image to a local device of the same size/type.

Playing with images like this is fiddly though. IMO, a better way is just to use a mirroring tool to copy files from the remove device to some local directory. rsync is a tool designed to mirror large number of files between two machines. It is especially good when it comes to updating a previously-made copy, as it will intelligently choose which files to copy, and with large files will only copy parts of files which have been modified.

thx reply ,

for your umount method , I must do it at same size harddisk / partitiion ? if yes , how can I do it when the size is different ? why need umount , I can't copy it when it is mount ?
 
Old 08-26-2008, 06:51 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Quote:
Originally Posted by ust View Post
thx reply ,

for your umount method , I must do it at same size harddisk / partitiion ? if yes , how can I do it when the size is different ? why need umount , I can't copy it when it is mount ?
Yes, I think you do need a device of similar size. I think you can use a larger device as the destination if you like, but some of the space will be wasted.

I imagine it is necessary to un-mount a device before imaging it because a mounted drive which is simply powered off without un-mounting has to go through some sort of recovery process, and I guess the same thing would happen with an image if you did not un-mount the device first, with some risk of data loss.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
remote copy nirmit Linux - Server 9 05-14-2008 08:50 AM
Remote Secure Copy kalyanofb Programming 2 04-20-2007 07:32 AM
Putty : Remote copy HaPagan Linux - Software 3 01-03-2006 10:33 AM
remote copy help me. suguname Mandriva 6 01-27-2005 03:33 AM
copy linux installation from old disk to new disk rmanocha Linux - Software 4 07-20-2004 06:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration