Fwd: How to save and replicate a LFS

Wit WitlessIdiot at triad.rr.com
Sat Feb 21 06:25:40 PST 2009


thorsten wrote:
>> OTOH, if you instead use something like tar or cpio and compress the 
>> output, you can put it on the stick's native FS. I've not looked at the 
>> parameters (use man), but something like
>>
>> tar -cjf /mnt/usbstick/output.file.z .
>>
>> with additional parameters for preservation of attributes ought to get 
>> you started.
>>
>> Then on the receiving system, after cd'ing to the target directory, 
>> something like
>>
>> tar -xjf /mnt/usbstick/output.file.z
>>
>> Be sure and use the man pages. Test and refine your parameters on a 
>> small subset first.
> 
> 
> I use
> 
> mount --bind / /mnt/sys-bkup
> cd /mnt/sys-bkup/
> tar -cpvjf /mnt/backup/backup.tar.bz2 ./*

That reminds me: IIRC the default for tar is gzip, not bzip? And the 
"default" suffix would be ".tgz"? I guess it's time to go back and 
review some docs!  :-(( UGH!

> 
> to backup my systems, which does work well.
> The bind mount is nice IMO because you don't copy any mounted
> subfilesystems with it. No /proc /sys /dev pseudo filesystems get
> copied. Just the contents of rootfs.

The same effect can be had with tar's "-l" or "--one-file-system" 
parameters. This can be useful if you want to back up including the 
topmost directory name, e.g. including "/home" rather than just "./". It 
also allows you to do the backup from any location if you want to.

> 
> thorsten

-- 
Wit



More information about the lfs-support mailing list