Cloning a running Linux OS

Tyler Aviss tjaviss-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Sep 10 15:14:57 UTC 2008


Just as a side-question - I generally don't use extended ACL's on my
machines so I can't test it - if you boot from a bootdisk and copy/zip
a filesystem with extended permissions/ACLs/attributes, what happens
to them if the liveCD kernel doesn't have support for them.

Are they copied and ignored, or are they not copied at all as the host
FS doesn't know how to deal with them?



On Wed, Sep 10, 2008 at 10:56 AM, Lennart Sorensen
<lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> wrote:
> On Wed, Sep 10, 2008 at 10:35:20AM -0400, Tyler Aviss wrote:
>> Just out of curiosity, while do you need to clone it while it is running?
>> In most cases, I've managed to clone a non-running OS by plugging in a
>> secondary drive (via USB or as a slave) and then mounting and
>> tar-copying the files
>>
>> cd /path/to/drive/mount
>> tar -cf - * | tar -xvf - -C /path/to/new/mount
>>
>> (or if you want it in a file, just tar to it).
>>
>>
>> Tar's a little nicer about copying any special file attributes etc
>> than a normal "cp"
>
> cp -ax does a perfectly good job.  rsync -ax does as well.  With rsync
> 3, using -Aax even does ACL stuff, which tar doesn't.  Not sure if cp
> does.  So tar is certainly NOT the tool for this job if you want to
> preserve all attributes.  The -x makes it stick to one filesystem, so
> repeate for each mounted partition seperately, which takes care of /sys,
> /proc, /dev, etc without issues.
>
>> Depending on what's running, you might be able to get away with
>> tar'ing most of the drive live. Just skip the files in /dev and a few
>> other places because I believe some of those
>> behave a bit oddly (like copying memory-related /dev entries).
>
> --
> Len Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>



-- 
Tyler Aviss
Systems Support
LPIC/LPIC-2
(647) 302-0942
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list