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

Dan McGhee beesnees at grm.net
Sun Dec 22 14:19:51 PST 2013

On 12/22/2013 01:45 PM, akhiezer wrote:
>> 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
> source-partition(s).
Hopefully, except for the partition designation they will be the same.
>> 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.
I need to look at the cpio-manual and man page to see what those other 
options do. My main goal, and I think this partially addresses what you 
say below, is to preserve all the ownership, group and permissions 
attributes of all files and directories. This refers to the Package 
Users system. It's really only a pain when building something or if 
someone, like I did, forgets that Xorg needs to be root:root and 4755.
>> 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 ...
> kernel-config-wise.
> You _would_ very likely want to at least adjust fstab and boot-loader setups.
I think "unusual" applies here. I am utilizing my UEFI firmware and 
haven't gotten GRUB to work yet. So I boot from the EFI partition using 
the kernel efi-stubs. I need to recompile the current kernel because I 
have "root=/dev/sda6 ro" and the new system will need "root=/dev/sda5" 
passed to it somehow.
> 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.
I think you're referring to the Package Users system. It gets in the way 
sometimes. But, and one reason why I adopted it so many years ago, I 
really learn what's on my system and how it all fits together, which is 
why I chose LFS in the first place. I've never tried Slack or Arch, but 
LFS is so much more stable and reliable than the major distros I've tried.

Thanks for your input.


More information about the blfs-support mailing list