• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Best way to move Linux system from one HD to another?

Electrode

Diamond Member
I think the title says almost all that needs to be said. I'm going to set up LFS on one of my boxes, but before I do, I want to move my existing Linux setup from the 30 GB hard drive to a 13 GB hard drive I have temporarily installed, to make way for LFS.

What would be the best way to do this? I have moved all but about 6 gigs of stuff to my file server, so the 13 gig drive isn't going to overflow. 🙂

Useful info:
System is currently set up on the hda1 partition, which is a reiserfs partiton that takes up all but the 512 megs at the end of the HD used for swap space
Distro: Slackware 8
13 GB drive is hdb. The entire thing is filled with a single ext2 partition, hdb1.
 
This is just one more way in which Linux shines compared to Windows...

In Linux.. you just have to boot off a resuce floppy, and mount your root disk, and edit the /etc/fstab to reflect the new device names.. then reboot.
 
The only thing you really have to watch out for, is make sure you use tar or cpio to copy the files otherwise you'll have major problems with symlinks.
 
When I need to move my filesystems around, I tar the root dirs, excluding proc and mnt (if anything's mounted). Just make sure to tar with the -p switch when creating and extracting to preserve permissions/ownership to avoid a broken sendmail, users not being able to write to tmp...etc.
 


<< The only thing you really have to watch out for, is make sure you use tar or cpio to copy the files otherwise you'll have major problems with symlinks. >>




Hes right.. here is the best way to copy a directory tree and make sure all the permissions, ownership and links are maintained.

1) cd to the source directory. Example: cd /usr
2) run this command: find . -print | cpio -pdvm /dest_dir

 
That sounds like a good way to do it, but I'm wondering if that will properly handle entries in /dev and other irregular files?
 


<< That sounds like a good way to do it, but I'm wondering if that will properly handle entries in /dev and other irregular files? >>


worked fine for me when i repartitioned. just tar zcvxf. the x makes it stay on the same FS so it doesnt end up tarring other partitions (do each one individually), and also it doesnt tar up /proc. didnt have any problems with /dev. basically just tar it up, then untar it on the new drive, update fstab if needed, and run lilo via a boot floppy/cd.

good luck
 
That sounds like a good way to do it, but I'm wondering if that will properly handle entries in /dev and other irregular files?

Yes that's one of the things tar and cpio were meant to do, the only problem might be if you use devfs.
 
Well, I was successful. I did cp -a bin boot dev etc home lib opt root tmp usr var /mnt/hdb/ and went for a walk, then mkdir'd proc and my mnt heirarchy, edited fstab and lilo.conf, ran /sbin/lilo, and rebooted.

Thanks all. 🙂
 
Back
Top