Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.


  Search this Thread
Old 07-22-2004, 12:35 AM   #1
Registered: Jan 2004
Location: Tucson, AZ
Distribution: Fedora
Posts: 44

Rep: Reputation: 15
Moving LFS to a new drive

I am glad to say that after following the instructions in the LFS book, I was able to get the system built and running the first time out. Because I followed the instructions, the LFS files are on a partition of drive /dev/hda. I would like to move it to /dev/sd?. So far I have tried tarring everything and untarring it on the new drive without success. I've also tried a direct copy also with no success.

What am I missing here? TIA for your assistance!
Old 07-22-2004, 12:41 AM   #2
Senior Member
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
did you try ........
cp -Rav * /dev/sd?
make sure your in the LFS directory itself.........the * means all files get copied....... -Rav recursive,attributes,verbose
Old 07-23-2004, 06:05 AM   #3
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Just a slight correction:

The -a option stands for archive, not attributes, and is equivalent to -dpR.

So you don't need to use both the -a and -R options together.

The correct command is: cp -av * /dev/sd?

--- Cerbere

[edit] Doh! Just noticed an even bigger glitch: First you should run:

mount /dev/sd? /mnt


cp -av * /mnt/


Last edited by Cerbere; 07-23-2004 at 06:08 AM.
Old 07-23-2004, 04:45 PM   #4
Andrew Benton
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
The problem could be the active filesystems mounted on /dev /proc and /sys. Also, if you have X running there will be some sockets in /tmp that may cause you problems. I've had good results working from the host system. Reboot into the system you built lfs from, login as root and (assuming you have it mounted on /mnt/lfs)

cd /mnt
rm -rf lfs/tmp/*
tar cjf lfs.tar.bz2 lfs

that tar command may take a while but at the end of it you'll have a backup copy of your lfs system that should be small enough to burn onto a CD. I used this to take an lfs system from one computer to another. Obviously, I needed a host system to untar it on the target machine. I then had to edit /etc/fstab, change /etc/X11/XF86Config and recompile the kernel but it worked really well. It was a lot easier than building LFS on the new computer. Both machines were Pentium 4's. It probably won't work for different architectures.
Anyway, after you've tar'd up lfs, umount /mnt/lfs, mount the new drive you want lfs on and then untar it again

tar xjfp lfs.tar.bz2

that will uncompress it into the lfs folder. Whatever is mounted on /mnt/lfs will get it. The p option preserves the permissions, so I'm told.
Old 07-27-2004, 04:32 PM   #5
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
/dev/sd? suggests that your destination is a scsi-disc...

That would mean: the kernel you are trying to boot from there needs to have scsi-support compiled in! !Not as a module!
There may be other ways like using an initrd, but I can't help you with that - compiling in scsi is the easiest way.
Of course you would need to adjust yout /etc/fstab to reflect the layout of the new disc - all the names of the partitions would change from /dev/hd? to /dev/sd? ...
You'll need to create the partitions and make the filesystems you want to use _before_ you try to

1.) mount the partition (with the rigtht options for creating all the files with the original permissions)
and 2.) copy every partition to their new destination - in your case probably only one

Have a boot-medium ready from which you can boot into the new OS (on the new disk)
You can install the boot-manager from inside your "old" System, but I cannot give you exact hints on that right now - please search for instructions to do this - I have done this several times with no problem - but always from ata to ata (IDE-Disks) - but the only difference scould be the needed changes to /etc/fstab

If you cannot figure it out, I could try to reproduce the way I did it - I've been and I'm using lilo to boot 2 diffrent linux'es and WinXP without any problems.



Addition: it is all described in great detail in an excellent mini-howto called:
Hard Disk Upgrade Mini How-To

Im not sure where to find it, but this shold not prove difficult...
I could even send you the copy I have here if needed

Last edited by jomen; 07-28-2004 at 12:28 AM.
Old 07-29-2004, 06:28 PM   #6
LQ Newbie
Registered: May 2004
Posts: 4

Rep: Reputation: 0
Originally posted by Andrew Benton
The problem could be the active filesystems mounted on /dev /proc and /sys. Also, if you have X running there will be some sockets in /tmp that may cause you problems. I've had good results working from the host system. Reboot into the system you built lfs from, login as root and (assuming you have it mounted on /mnt/lfs)
I use cp -avx / /mnt/disk

-v verbose

-a keeps permisions and does a recursive copy. It handles /dev
cp /dev/hda1 . gives a large file with the contents of hda1
cp -a /dev/hda1 . copies the device to the current directory

-x stay on the same filesystem. Ignores any mounts eg /proc /sys
Old 08-02-2004, 05:41 PM   #7
Registered: May 2004
Distribution: Slackware
Posts: 48

Rep: Reputation: 15
why not try

It works every time for me!
Old 08-03-2004, 03:53 AM   #8
Not now, John!
Registered: Jul 2004
Distribution: LFS 5.1
Posts: 161

Rep: Reputation: 30
Did you update your /etc/fstab and /boot/grub/menu.lst?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving files from NTFS drive to a EXT3 drive?? webshark Slackware 10 05-28-2006 03:02 PM
Moving Windows to new drive ? DavidTempler General 26 07-29-2005 05:48 AM
moving /home to a new drive? tardigrade Linux - Newbie 5 10-18-2004 05:56 PM
moving to another drive? dittohead Linux - Hardware 4 07-07-2003 10:43 AM
moving to a new hard drive n1wil Linux - Software 4 05-21-2003 02:38 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration