View previous topic :: View next topic |
Author |
Message |
Herodot Guru
Joined: 29 Jul 2002 Posts: 429 Location: Professor Xavier's school for gifted youngsters
|
Posted: Tue Aug 20, 2002 7:16 pm Post subject: Moving hard disks |
|
|
Hi,
I have gentoo running nicely on hdd. Can I move it to hdb, and have the system working as if nothing happened?
I'll have to edit menu.lst and fstab of course. Anything else? mtab? (I'll admit I don't know what mtab does...)
- Herodot |
|
Back to top |
|
|
rommel Veteran
Joined: 19 Apr 2002 Posts: 1145 Location: Williamsburg Virginia
|
Posted: Tue Aug 20, 2002 8:20 pm Post subject: |
|
|
you might want to have a grub floppy made before you try it...that way if you have to you can reinstall grub and enter the new location of root and setup if it fails to work....i havent tried what your going to do since i only run linux (gentoo) but you can also use the install iso to get back to your system to...but a grub floppy is a nice thing to have just as a tool |
|
Back to top |
|
|
BackSeat Apprentice
Joined: 12 Apr 2002 Posts: 242 Location: Reading, UK
|
Posted: Tue Aug 20, 2002 10:33 pm Post subject: |
|
|
You need to copy your existing partitions, one by one, to the new disk. First create the new partitions on the new disk (using fdisk or, better still, cfdisk). Next create the filesystems on them with mke2fs [-j for ext3]. Then it would be best to go to single user mode:
Next ummount (umount) all partitions except root.
Now mount the new partitions, one by one, on /mnt and copy the appropriate partition across. For the sake of example, assume you have partition /dev/hda1 as / and /dev/hda3 as /boot, and you want to copy them to /dev/hdb1 and /dev/hdb3:
Code: | # mount /dev/hdb1 /mnt
# cd /
# tar cf - . | (cd /mnt; tar xvf - )
# umount /mnt
# mount /dev/hdb3 /mnt
# mount /boot
# cd /boot
# tar cf - . | (cd /mnt; tar xvf - ) |
Then set your new root partion to boot, fixup menu.lst and fstab (no need to worry about mtab), and reboot. The advice to create a bootable floppy first is sensible.
Good luck: let us know how you get on.
BS |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Tue Aug 20, 2002 10:35 pm Post subject: |
|
|
well, i would do a 'grep -ri "/dev/hdd" /etc/' just to be sure to modify all files
mtab, is produced by mount, see 'man mount' .. _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
|