Fixing opensuse partition boot / root

Hello

Recently i have upgraded the HDD in my laptop with a SSD. My laptop dual boots win 8 and Opensuse
Also the Opensuse root partition is encrypted with a separate boot partition.

After changing out the drives for the new ssd, i have been trying to boot into my old hard drive’s opensuse partition from an external HDD closure i placed the old drive in.
However i always receive an error that root partition can not be found.

I’m thinking this is because the un-encrypted boot partition is set to look for the encrypted root partition on something like “sda3” and because the drive is now not the internal drive, the partition for root is “sdb3” or something similar.

So my question is can someone please help me change the partition address that GRUB is looking for the root partition on.

Thank You!

This is most likely due to not being able to read an external drive because the needed module is not in the “initrd”.

Boot opensuse. If you don’t have a bootable one on the hard drive, then boot the live Rescue CD or similar. Make sure it is the same architecture (32bit or 64bit) as what is on that external drive.

Mount the root partition of the external drive as “/mnt”. If that requires some crypto, you will have to do that manually.

Mount the boot partition as “/mnt/boot”. Similarly, mount any other partitions (such as home) to the correct relative location.

Then:


# mount --bind /dev /mnt/dev
# mount --bind /proc /mnt/proc
# mount --bind /sys /mnt/sys

That should get everything mounted as needed. Then


# chroot /mnt
# mkinitrd
# exit

That should rebuild the “initrd”. This time, it should add the modules needed to access the partitions on the external drive.

On 2014-06-14 07:26, nrickert wrote:

> That should rebuild the “initrd”. This time, it should add the modules
> needed to access the partitions on the external drive.

As the drives have been changed, it is also possible that fstab has to
be edited to adapt. And grub as well.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Yes, a good point. If “/etc/fstab” uses device names (such as “/dev/sda1”), you will have a problem. If it uses device ID or UUID or label, it is probably okay.

I should add that I went through something similar about a year ago. An older computer that I was using for a desktop failed on me (power supply problem). I had a replacement available and switched to that. The disk drive was still good, so I put in an external enclosure and tried to boot. I ran into exactly the same problem. Grub could read the disk, but the opensuse system that I was booting could not.

I went through the procedure described in my earlier comment, and that got it working.