There are various ways to clone partitions to new locations. In addition to software that you mentioned, there are other methods using simple utilities such as tar, cp, rsync, cpio, and so on. Some examples...
http://linuxmafia.com/faq/VALinux-kb...ory-trees.html
I prefer tar and use it for that purpose all the time. And although some people do it, I choose not to copy a system's partition while it's running. Nothing special has to be done about the folders with the kernel's stuff that way. I prefer to boot into another system, mount the partition to be copied, cd to it, archive it to a tarball, and untar it in the new partition. The tar example in the link above pipes the output of the tar command to another tar command, but I prefer breaking that up into two steps and create a tarball that I often keep as a backup after using it to clone something somewhere.
Anyway, I recommend that you also compile a new kernel and build in support for USB drives. I usually build in these...
Code:
...[*] USB support ---> (CONFIG_USB_SUPPORT=y)
|
|...<*> Support for Host-side USB (CONFIG_USB=y)
|...<*> EHCI HCD (USB 2.0) support (CONFIG_USB_EHCI_HCD=y)
|...<*> Generic EHCI driver for a platform device (CONFIG_USB_EHCI_HCD_PLATFORM=y)
|...<*> OHCI HCD (USB 1.1) support (CONFIG_USB_OHCI_HCD=y)
|...<*> OHCI support for PCI-bus USB controllers (CONFIG_USB_OHCI_HCD_PCI=y)
|...<*> Generic OHCI driver for a platform device (CONFIG_USB_OHCI_HCD_PLATFORM=y)
|...<*> UHCI HCD (most Intel and VIA) support (CONFIG_USB_UHCI_HCD=y)
|...<*> USB Mass Storage support (CONFIG_USB_STORAGE=y)
|
The HCD port drivers usually are EHCI for high-speed USB plus either OHCI or UHCI for a fallback to legacy USB. Use whatever your host system uses.
SCSI device support (CONFIG_SCSI) also should be built in (required by USB support)...
Code:
... SCSI device support --->
|
|...-*- SCSI device support (CONFIG_SCSI=y)
|...<*> SCSI disk support (CONFIG_BLK_DEV_SD=y)
|...<*> SCSI CDROM support (CONFIG_BLK_DEV_SR=y)
|...<*> SCSI generic support (CONFIG_CHR_DEV_SG=y)
Because USB drives can be discovered and enumerated differently when other devices are plugged in, I also recommend that you use LABEL or UUID instead of the drive's device name in fstab and grub.cfg. Partition labels and UUIDs reside in the filesystem, so you need to create an initial ram filesystem to use them (see the BLFS book). If you are using GPT, then you can skip the initial ram filesystem and use PARTUUID to specify partitions in fstab and grub.cfg. Examples with UUID...
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
menuentry “Linux From Scratch (USB Version)” {
insmod search_fs_uuid
search --no-floppy --fs-uuid --set=root 98790171-5ab5-45c6-9764-096c056918cf
linux /boot/vmlinuz root=UUID=98790171-5ab5-45c6-9764-096c056918cf ro rootfstype=ext4 rootdelay=5
initrd /boot/initrd.img
}
# End /boot/grub/grub.cfg
That example is for no separate boot partition. The
rootdelay=5 kernel parameter is to compensate for the slower response of the USB drive. The number is the delay in seconds, and you may get by with less or need more.
Code:
# Begin /etc/fstab
UUID=98790171-5ab5-45c6-9764-096c056918cf / ext4 defaults 0 1
UUID=8e67110b-9799-4665-85b6-4f7795b2ce88 swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
/dev/sr0 /media/cdrom auto noauto,user 0 0
# End /etc/fstab
If you decide to create an initial ram filesystem, the kernel has to be configured to support that. I enable these...
Code:
....General setup --->
|
|...[*]Initial RAM filesystem and RAM disk (initramfs/initrd) support (CONFIG_BLK_DEV_INITRD=y)
...Device Drivers --->
|
|...[*] Block devices ---> (CONFIG_BLK_DEV=y)
|
|...<*> RAM block device support (CONFIG_BLK_DEV_RAM=y)
|...(16) Default number of RAM disks (CONFIG_BLK_DEV_RAM_COUNT=<integer>)
|...(4096) Default RAM disk size (kbytes) (CONFIG_BLK_DEV_RAM_SIZE=<integer>)
I think that's really all I know about booting LFS from a USB drive. It's what I do anyway.