The problem is that drive letters change when you replace the primary and secondary hard disk.
Primary: sda (or hda)
Secondary: sbd (or hdb)
When the drive was primary, the system expected to find the root directory on sda1. When you have two drives in the system, Linux attempts to run from the slave, which is sdb now, but it still has pointers to sda1. And that doesn't work.
There are two ways to solve this:
One, the poor man's methos, quick and dirty:
Open /boot/grub/menu.lst and find the lines which boots the kernel you just installed. It looks something like this:
Code:
itle Debian GNU/Linux, kernel 2.6.18-4-k7
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-4-k7 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.18-4-k7
In the red line change hda1 to hdb1, or sda1 to sdb1, whatever you find there. Save the file.
Open /etc/fstab and find:
Code:
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda6 /home ext3 defaults 0 2
/dev/hda5 /usr ext3 defaults 0 2
And change hda to hdb, or sda to sdb.
This method fails if you would decide to move your slave hard disk to the secondary controller, then it becomes hdc, and the game starts again.
It is better to refer to the disk partitions by UUID. You get the UUID's by issuing:
on the command line.
You get an answer like:
Code:
/dev/hda1: LABEL="boot" UUID="c1420be7-ac52-477b-b31d-820d809105dc" TYPE="ext3"
/dev/hda3: TYPE="swap"
/dev/hda5: LABEL="/usr" UUID="5c35c1c8-a5d5-4e9d-9655-55e4ea4fed9c" TYPE="ext3" SEC_TYPE="ext2"
/dev/hda6: UUID="e7307d00-7354-44d4-81d3-502a0a860b7c" TYPE="ext3" SEC_TYPE="ext2"
/dev/hda7: LABEL="/var" UUID="60bd51f9-d5b5-413a-b74a-b26a2fd96a46" TYPE="ext3" SEC_TYPE="ext2"
Now in the /boot/grub/menu.list change this part:
to:
Code:
root=UUID=c1420be7-ac52-477b-b31d-820d809105dc
Be very careful where the '=' symbols are and where the quotes are not. Obviously, don't use the UUID from this example, but those you found yourself.
In /etc/fstab, replace
with the correct UUID for hda1:
Code:
UUID=c1420be7-ac52-477b-b31d-820d809105dc
And the correct UUIDs for the other partitions as well. Replace only the part /dev/hda1 with that UUID string, nothing more, nothing less.
Boot it first while your disk is still primary, then try to put it as secondary.
If you edit those files, you have to do that as root. (or sudo, or use crtl-F2 to start a GUI editor as root, but best is to do this in a console. Use nano as your editor)
/boot/grub/menu.lst might be grub.conf on your system.
jlinkels