LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 12:50 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,129

Rep: Reputation: 30
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, 01:29 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

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, 01:38 PM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,129

Original Poster
Rep: Reputation: 30
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, 02:12 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
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, 07:36 PM   #5
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,129

Original Poster
Rep: Reputation: 30
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, 07:51 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
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 09:50 AM
Remote Secure Copy kalyanofb Programming 2 04-20-2007 08:32 AM
Putty : Remote copy HaPagan Linux - Software 3 01-03-2006 11:33 AM
remote copy help me. suguname Mandriva 6 01-27-2005 04:33 AM
copy linux installation from old disk to new disk rmanocha Linux - Software 4 07-20-2004 07:21 AM


All times are GMT -5. The time now is 05:28 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration