[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub rescue mode after removing extended partition in MBR

From: Pascal Hambourg
Subject: Re: Grub rescue mode after removing extended partition in MBR
Date: Thu, 6 Dec 2018 07:37:27 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.3.0


Le 06/12/2018 à 02:58, 유혁 a écrit :

Recently, I install ubuntu in MBR, and the firmware is BIOS.
I already uses 7 partitions in MBR (3 primary, 4 extended I think), so I 
install Ubuntu in /dev/sda8.
It works well until I remove one of the extended partition.
I removed /dev/sda7 which is ext4 partition, then system moves /dev/sda8 to 
/dev/sda7 automatically.
After rebooting grub goes to rescue mode.

When I type “set” in rescue mode, then it shows
- Root=hd0,msdos8
- prefix=(hd0,msdos8)/boot/grub
When I type ls, then it shows
- (hd0) (hd0,msdos7) … (hd0,msdos1)

As expected. It is a known problem. prefix uses the partition number when /boot/grub is on a partition on the same disk as the core image. But logical partition numbers are not stable. They may change when adding or removing a logical partition.

Bottom line : do not put /boot/grub on a logical partition.
More generally, do not use logical partitions.
If you need more than 4 partitions, do not use MBR/DOS partition tables, use GPT instead.

I think, If grub-core finds the booting device with uuid (which may be saved in 
core.img), then this can be fixed.
Therefore, is there any way to setting prefix and root with uuid instead of 
(hdX, msdosY) so that booting can process smoothly even if former extended 
partition is removed?!

Note that the prefix uses UUID if
- /boot/grub and the core image are on different disks
- or /boot/grub is on LVM, LUKS or software RAID

reply via email to

[Prev in Thread] Current Thread [Next in Thread]