Swapping Drives...
Jason Clinton
me at jasonclinton.com
Mon Jul 21 18:13:34 CDT 2003
Matt G wrote:
Is this the kind of thing where I should just mirror the 4gb drive onto the
15gb drive, and then remove the 4gb? Or can I add the 15, and tell
/home/whatever to be on the 15 somewhere? Then move all the /home/whatever
stuff from the 4gb drive to the 15 and leave all 4gb for system stuff.
Install the second drive on the cable as a slave. This should give
you:
/dev/hda = 4gb drive
/dev/hdb = 15gb drive
I'll explain how to move to exclusively the 15 GB drive since it
probably supports a higher DMA mode and it's decidedly more complex.
If you want to use the 15 GB as a secondary, you should be able to
understand how to do that after reading this.
# cfdisk /dev/hdb
(you can use fdisk if you don't have cfdisk)
You should be presented with the current partition table. Use the
arrow keys to highlight and delete everything. Create partitions that
look like the partition table you have /dev/hda. You can use cfdisk to
take a look at /dev/hda. Adjust the partition's size to larger sizes
to fill the whole 15 GB. Here is an example 4GB and the new 15GB
drive:
4GB
15GB
100 MB partition 1that will be mounted at /boot
100 MB partition 1 that will be mounted at /boot
256 MB partition 2 that will be SWAP space
512 MB partition that will be SWAP space
~3.5GB partition 3 that will be mounted as / (root)
~14.3GB partition 3 that will be mounted as / (root)
(stolen from Gentoo install guide -- if you have other partitions, the
same principle applies)
Be sure to set the correct flags for the partition types which are 82
for linux and 83 for linux swap -- in this case partition 1 and 3 are
type 82, partition 2 is type 83.
Write the partition table to disc and then reboot to a linux bootable
disk
Go back to a prompt and
#cd /mnt/
# mkdir olddrive
# mount /dev/hda3 olddrive
# cd olddrive
# mount /dev/hda1 boot
(repeat as many times as nessisary for each of you partitions that
AREN'T SWAP)
# mke2fs /dev/hdb1
# mke2fs -j /dev/hdb3
(repeat as many times as nessisary for each of you partitions that
AREN'T SWAP)
# mkswap /dev/hdb2
# cd /mnt
# mount /dev/hdb3 newdrive
# cd newdrive
# mkdir boot
# mount /dev/hdb1 boot
(repeat as many times as nessisary for each of you partitions that
AREN'T SWAP)
after you have finished mounting
At this point, you are running on a booted disk with both the old and
new drives completely mounted under /mnt/olddrive and /mnt/newdrive,
respectively with a completely identical partition layout and mount
configuration -- the only difference is that the new drive doesn't
have your files or a bootloader, yet.
To copy all your files:
# cp -R /mnt/olddrive /mnt/newdrive
To install the boot loader:
# chroot /mnt/newdrive
# /usr/bin/grub or /usr/bin/lilo
If all is well, lilo will install itself. Grub needs some commands:
> root (hd1,0)
> setup (hd1)
> quit
# halt
Swap the drives making the 15 GB the master.
And you should boot from your new 15 GB drive!
--
Just my three trits. GPG Finger Print:
7A81 0A2F 1ABE DC38 DABC 7C22 B2EE 2304 4A89 46BF
More information about the Kclug
mailing list