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?
1 Answer
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.
-
The partition from the first drive is still visible as
/dev/sda2
,, though. Sep 2, 2016 at 20:53 -
Don't forget that you can pass device names for the rootfs in the boot manager, too (kernel parameters). Sep 2, 2016 at 20:59
-
-
Do you have the kernel parameter
root=/dev/sda2
set or is it omitted? Sep 2, 2016 at 21:21 -
1You haven't told anything about how you installed the new Linux system. Are duplicate UUIDs involved? Are you absolutely sure that the kernel from
/dev/sda
is loading? Are there any hints in the log how devices and partitions are probed and if there are failures/errors? Sep 2, 2016 at 21:37