I connected a second hard drive to my computer with the intention of mounting a partition which it contains (an older version of my current Linux partition). What happens after I turn the computer on is that the bootloader from the first drive launches and loads the kernel, also from the first drive, but the partition from the second drive gets mounted as the root filesystem (even though the partition from the first one is visible as /dev/sda2 and /etc/fstab on it says that /dev/sda2 should be mounted as /). Why does it happen and what should I do to get the system to boot as before?
Partition from second hard drive gets mounted as /
linux;hard disk
This problem is usually caused when you add a drive and forget to change device names in /etc/fstab or where ever the root filesystem is referenced.For example the drive can change its device name from /dev/sda to /dev/sdb. This is why modern systems use labels or UUIDs to identify filesystems correctly, even if they are reordered for some reason.