[Cialug] Moving Linux from one disk to another

Zachary Kotlarek zach at kotlarek.com
Fri Sep 5 11:38:58 CDT 2008


On Sep 5, 2008, at 9:19 AM, Paul Gray wrote:

>> Zachary Kotlarek <zach at kotlarek.com> 09/04/08 4:41 PM >>>
>>
>>
>> In any case, if you're going to copy files (with tar, cp, rsync,  
>> etc.)
>> as opposed to blocked (with dd) and are booted off another disk be
>> sure to use numeric UID/GIDs or you're likely to end up with bad
>> ownership.
>
> Bad ownership?
>
> I must call "B.S." on this  -- 'rsync -plarv' (which is what I
> suggested) preserves all ownership and permission IDs, and doesn't  
> give
> a hoot about entries in the target's /etc/{passwd,shadow}.   
> Certainly a
> very naive use of the tar command would produce the permissions fiasco
> that you describe.  I assert that if you're going to be naive about
> using a tool, the naive use of dd would have even worse consequences.


I wasn't my intent to disagree with your choice or particular usage of  
rsync, other than to say the dd works too, and may in some cases be  
superior. My statement about bad ownership wasn't directed at your  
particular example with rsync; there were previous examples in this  
thread that did not specify numeric UIDs/GIDs, and I was attempting to  
convey that the use of *any file-based copy* required special  
attention to ownership, which seemed to me a reasonable point of  
contrast with block-based duplication. I apologize if I did not make  
the scope of my comment clear.


> Fanning the flames even more: With rsync, you can also backup across a
> network to your large storage array.  Unless you're recompiled bash  
> with
> socket support or are using udpcast, that's a bit harder to do with  
> dd.


It's not hard for me:
	dd of=/dev/stdout | ssh targethost 'dd if=/dev/stdin'
But if you were planning to copy across the network I'd use `buffer`,  
which copies from STDIN to STDOUT unless you tell it otherwise, and  
which provides buffering, as the name suggests.


> ... Backing up of live systems is *NOT* recommended with dd.


It's not recommended with rsync either, rsync just isn't capable of  
producing filesystem level errors like block-level copies. But you  
might still end up with inconsistent files.

Live backups are another place where LVM is a good choice -- you can  
spawn a snapshot and then use dd or rsync or any other duplication  
tool to get consistent (from a file system perspective; running apps  
may disagree) backups without shutting anything down at all. Or if you  
want to shutdown your apps first you can take a snapshot while they're  
down, restart them, and do a backup of the snapshot while they're  
running to avoid the extended downtime.

	Zach

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2746 bytes
Desc: not available
Url : http://cialug.org/pipermail/cialug/attachments/20080905/fd9332f2/smime.bin


More information about the Cialug mailing list