Can LFS be copied from 1 hard drive to another after the build?

ilja.siera at ilja.siera at
Wed Jun 15 07:43:32 PDT 2005

Quoting Andrew Benton <b3nt at>:

> rblythe wrote:
> > I have completed the LFS 6.0 book.  System boots like a champ.  I have
> started 
> > putting together things from BLFS.  Still working smoothly.  Before I go
> too 
> > much farther, I would like to know:
> > 
> > Can my current LFS be copied to another hard drive for future build 
> > considerations.  I am only talking about the base LFS (no other packages 
> > installed).  Currently, my LFS is on /dev/hda4.  I would like to copy it 
> > to /dev/sda1 because I have a SCSI drive sitting there doing nothing.  My 
> > host disto is on /dev/hda1 with /home on /dev/hda3.  The swap partition for
> > LFS and host is /dev/hda2.
> > 
> > What I am hoping to do is copy (not move) the root LFS to /dev/sda1, 
> > use /dev/sda2 for swap and /dev/sda3 for /home.  I know I should have set
> my 
> > drive up with /dev/hda4, /dev/hda5, /dev/hda6 but I didn't realize the
> value 
> > of that when I started LFS.
> > 
> > Anyway, can it be copied?
> > 
> I find tar to be quite effective
> cd /mnt
> tar cjf lfs.tar.bz2 lfs
> then unmount the partition that has lfs on it, edit /etc/fstab to mount the
> blank partition in it's place and then untar lfs onto the new blank
> partition
> cd /mnt
> tar xjf lfs.tar.bz2
> -- 
> FAQ:
> Unsubscribe: See the above information page

I have copied LFS about a dozen times. I compiled on a dual PIII-1000 and now 
use it on 5 other PIII's with different mainboards and pheriphals (including 
laptop. Copying won't effect anything (on a similar architecture). If you'd 
copy to a new system you'd just have to recompile the kernel to encorporate 
new/different features of that system. But that doesn't even apply in your case.
Just make sure that you maintain your file permissions during a copy (-p 
options). Either when extracting if you use the tar method (tar -xvjpf ......) 
preposed by Andrew or executing a simple copy command (cp -pR .....).
I don't think LFS has a lot of different permissions, but blfs surely has and 
you'd run into trouble (well, I did at least).

Tar is effective and works as a backuptool as well. It's just not effective 
when you've encorporated loads of blfs. The file will become massive and 
sensitive to errors (I had some in the past)

Don't forget to update your fstab and grub menu file before you reboot ;) 
something I always forget and forces me into time consuming floppy boots to get 
them right.

And one more thing: I'm not sure if you're actually booting from your LFS, but 
It's faster and smoother to copy while running from an other filesystem (some 
boot-cdrom or other partition) otherwise it complains about the /proc dir and 
if you have partitions mounted in /mnt, you would copy those too. 
I know these are minor things, but they all happend to me and knowing them 
saves you time.


This mail sent through

More information about the lfs-support mailing list