[Leaplist] DD data from one drive to an other

John Simpson jms1 at jms1.net
Sun Dec 31 08:38:53 EST 2006


On 2006-12-30, at 1601, Dan Cherry wrote:
>
> Patrick gave you some good ways to connect the hardware.  If you  
> don't think the system will live long enough to copy the full drive  
> at once, and if you want to keep permissions and hidden files (such  
> as with home dirs or /etc, and so on), then tar might be your  
> friend.  The pipe can point to a drive on another system using nfs  
> or even ssh.

exactly. if you can read the data using a live cd and the machine has  
a working network connection, you can do something like this to save  
an entire directory tree. if some data on the disk is more important  
than others, you may want to pick and choose which directories you do  
this with, and do this for each one in the order of how important it  
is that you save the data.

for example, if there is a "/home" on the filesystem which absolutely  
must be saved at all costs, then do this first:

# cd /mnt/blah/home
# tar cf - . | ssh ray at 192.168.x.x 'cat > saved-home.tar'

then save the rest of it, excluding the bits you've already saved:

# cd /mnt/blah
# tar cf - --exclude ./home . | ssh ray at 192.168.x.x 'cat > saved- 
other.tar'

then, once you have the new drive ready, you can do something like  
this to "put the data back" on the new drive...

# cd /mnt/blah   (the root of the new drive)
# tar xvpf .../saved-other.tar
# mkdir -pm 755 home
# cd home
# tar xvpf .../saved-home.tar

in this situation (dying drive which will only last a certain length  
of time), dd is NOT a good idea- at least not in terms of "dd the  
entire filesystem from one partition to another", which is what it  
sounded like you're thinking of doing. dd will copy the entire  
filesystem, INCLUDING THE EMPTY AREAS. if it's an 80GB filesystem  
with 45GB of data, "tar" will read (and send across the wire) no more  
than 45GB of data, organized as files... while "dd" will read (and  
send) exactly 80GB of data, as one large binary blob. do you really  
need to copy the un-used blocks?

also, i've done some crazy things to keep a dying drive alive long  
enough to rescue data... including in one instance, putting the drive  
in an external SCSI enclosure, leaving the enclosure cover off, and  
putting the enclosure in a freezer with the SCSI and power cables  
trailing out, to keep an overheating drive alive long enough to  
rescue all 9GB of data from it. (if you have to do this, don't close  
the freezer all the way, and keep some paper towels around to wipe  
off any condensation which may form on the outside of the drive-  
especially near the connectors.)

----------------------------------------------------------------
| John M. Simpson    ---   KG4ZOW   ---    Programmer At Large |
| http://www.jms1.net/                         <jms1 at jms1.net> |
----------------------------------------------------------------
| http://video.google.com/videoplay?docid=-4312730277175242198 |
----------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.leap-cf.org/pipermail/leaplist/attachments/20061231/f35b2cc2/PGP.bin


More information about the Leaplist mailing list