[blfs-support] Complete Backup of {,B}LFS

akhiezer lfs65 at cruziero.com
Sun Dec 22 11:45:33 PST 2013

> Date: Sun, 22 Dec 2013 12:06:23 -0600
> From: Dan McGhee <beesnees at grm.net>
> To: BLFS Support List <blfs-support at linuxfromscratch.org>
> Subject: [blfs-support] Complete Backup of {,B}LFS
> I should have thought of this when I had a minimal, bootable LFS. But I 
> didn't.  I'm asking for comments so that the probability of getting 
> another bootable LFS-7.4 system is high.  Here are the steps in my plan:
> 1.  Set up and mount a new partition for this system--done

Careful to not have new filesys format/mount options too-different from 

> 2.  As root in / run: $ find . -xdev -depth -print0 | cpio --null -pd 
> <mount point>

What's your fstab? Is all of the current system - other than /dev &c - 
definitely on a single partition that is mounted at '/'? If so, then the use 
of '-xdev' in the above is fine.

The '-xdev' also means that you're not backing-up/copying-over any /dev or 
similar 'virtual-fs' stuff; and so you'd need to setup that for new system - 
e.g. by following how the book does it for normal lfs-build. Here, fwiw, we 
often _would_ include /dev in such backups (tho' depends on the situation), 
as we tend to use static device nodes (via mknod): but depends on your setup 
on whether you'd want to include /dev or not - it might cause you (a few) 
more hassles than not on the new system.

For the cpio part, I'd suggest using:

    cpio -0pdam -v	# - or '-V' in place of '-v'  .

; but the '-a', '-m', '-v', and '-V' are optional and depend on personal 
taste &/or what the situation requires. You shouldn't need to have to 
bother with either of '-H' or '--no-preserve-owner'  .

It's pleasing to see proper-tool-for-the-job - namely cpio - being used; the 
likes of tar &c still have problems with certain types of fs objects - there 
was a thread back in approx early 2013 re this.

> 3.  Enter chroot environment as in LFS book
> 4.  Reconfigure kernel

Not sure that you'd need to reconfig kernel for moving to a new _partition_ 
if is on same machine, unless you're doing something ... unusual ... 

You _would_ very likely want to at least adjust fstab and boot-loader setups.

> 5.  Boot new system
> I need to reconfigure the kernel since I use the efi-stubs and put the 
> kernel image on the EFI partition.  And, although I don't know this for 
> a fact, it seems logical to me that the kernel must be reconfigured to 
> account for moving to a new partition.
> I'm asking for comments on this plan or recommendations for a different 
> backup procedure.

The above steps, namely backup/migrate + adjust fstab + adjust boot-loader, 
then reboot, have worked fine here over the years. Wouldn't be overly 
surprised if you'd need an extra detail/step or so, given some of the 
'technologies' that - from your posts - I'd guess may be on your system 
(this is not a 'criticism' per se - just a practical consideration). Hope 
have not omitted anything glaringly-obv.


> Dan


More information about the blfs-support mailing list