Linux grub2 /boot partitions strangeness
Posted: Fri Oct 07, 2016 12:23 pm
The issue I will describe here is not necessarily a BIBM issue, but it does show up when I use the Terabyte GRUB2 bootable disk to bootup a Linux OS, so I will ask it here and maybe someone will recognize what might be happening.
I have multiple Linux distros and Windows OSs installed on a computer and BIBM works great. Two of my Linux distros are Mint and Ubuntu. Each one has its own separate /boot partitions and they are, in Linux terms, /dev/sda10 and /dev/sda11 respectively on my first hard disk. I ordinarily have no problems pointing to these /boot partitions and using BIBM to boot into those distros. In my Linux distros I always use UUIDs in the respective /etc/fstabs to denote the actual partitions but of course grub2 itself uses /dev/sdann notation in its grub-install and update-grub commands.
Although the Mint /boot partition is /dev/sda10 and the Ubuntu /boot partition is /dev/sda11, they are actually physically in reverse order on my first hard disk. In other words physically /dev/sda10 comes after /dev/sda11 on the hard disk. At some point in the past they were physically in the normal order but I had to restore backups of these boot partitions from an external hard drive and the physical position of the partitions on the hard drive got reversed as far as the /dev/sda10 and /dev/sda11 notation was concerned. Nonetheless booting into Mint or Ubuntu through BIBM continued to work.
Now for the problem I am seeing. When I am booted into Mint, update software ( I use Synaptic ), and either some part of the grub2 software gets updated or a new kernel gets installed, evidently the 'update-grub' command gets run automatically because I can see the update process regenerating the grub2 menu. This works fine when I reboot into Mint with BIBM but unfortunately when I boot into Ubuntu with BIBM I now see the Mint grub2 menu of items and not the Ubuntu menu of items. What could be happening here ? My original though is that this strictly a Mint problem, in which I case I shouldn't be bothering to ask about it here.
So now I use the Terabyte GRUB2 restore program from a bootable disk to boot into Ubuntu and regenerate the correct Ubuntu grub2 menu, and it works like a charm. But here is the odd thing and the reason I am asking about this on BIBM's online forum here. When I run the Terabyte GRUB2 restore program from a bootable DVD, after setting my partitions for the Ubuntu BIBM menu item beforehand which hides all but the necessary Ubuntu partitions I need, I start by using the "search -f --no-floppy /grub/grub.cfg' from the grub2 prompt. And what is returned to me is both the 'hd0,msdos11' and 'hd0,msdos10' partitions in that order. Of course 'hd0,msdos11' is the one I want and the one I use in the 'configfile' command to reboot into Ubuntu so I can fix the Ubuntu grub2 bootup menu. But why would the 'search' command be finding both the Ubuntu and Mint boot partition cfg files when I have hidden the Mint /boot partition ( along with a bunch of other Linux distro and Windows partitions ) before using the GRUB2 recovery program from my bootable DVD ? So my thinking that this odd behavior has something to do with Mint placing its grub2 menu items on both my Mint and Ubuntu /boot partitions has something to do with this strangeness, so I am asking about this here.
If anybody has any clue or thoughts about what is happening in this situation it would be greatly appreciated.
I have multiple Linux distros and Windows OSs installed on a computer and BIBM works great. Two of my Linux distros are Mint and Ubuntu. Each one has its own separate /boot partitions and they are, in Linux terms, /dev/sda10 and /dev/sda11 respectively on my first hard disk. I ordinarily have no problems pointing to these /boot partitions and using BIBM to boot into those distros. In my Linux distros I always use UUIDs in the respective /etc/fstabs to denote the actual partitions but of course grub2 itself uses /dev/sdann notation in its grub-install and update-grub commands.
Although the Mint /boot partition is /dev/sda10 and the Ubuntu /boot partition is /dev/sda11, they are actually physically in reverse order on my first hard disk. In other words physically /dev/sda10 comes after /dev/sda11 on the hard disk. At some point in the past they were physically in the normal order but I had to restore backups of these boot partitions from an external hard drive and the physical position of the partitions on the hard drive got reversed as far as the /dev/sda10 and /dev/sda11 notation was concerned. Nonetheless booting into Mint or Ubuntu through BIBM continued to work.
Now for the problem I am seeing. When I am booted into Mint, update software ( I use Synaptic ), and either some part of the grub2 software gets updated or a new kernel gets installed, evidently the 'update-grub' command gets run automatically because I can see the update process regenerating the grub2 menu. This works fine when I reboot into Mint with BIBM but unfortunately when I boot into Ubuntu with BIBM I now see the Mint grub2 menu of items and not the Ubuntu menu of items. What could be happening here ? My original though is that this strictly a Mint problem, in which I case I shouldn't be bothering to ask about it here.
So now I use the Terabyte GRUB2 restore program from a bootable disk to boot into Ubuntu and regenerate the correct Ubuntu grub2 menu, and it works like a charm. But here is the odd thing and the reason I am asking about this on BIBM's online forum here. When I run the Terabyte GRUB2 restore program from a bootable DVD, after setting my partitions for the Ubuntu BIBM menu item beforehand which hides all but the necessary Ubuntu partitions I need, I start by using the "search -f --no-floppy /grub/grub.cfg' from the grub2 prompt. And what is returned to me is both the 'hd0,msdos11' and 'hd0,msdos10' partitions in that order. Of course 'hd0,msdos11' is the one I want and the one I use in the 'configfile' command to reboot into Ubuntu so I can fix the Ubuntu grub2 bootup menu. But why would the 'search' command be finding both the Ubuntu and Mint boot partition cfg files when I have hidden the Mint /boot partition ( along with a bunch of other Linux distro and Windows partitions ) before using the GRUB2 recovery program from my bootable DVD ? So my thinking that this odd behavior has something to do with Mint placing its grub2 menu items on both my Mint and Ubuntu /boot partitions has something to do with this strangeness, so I am asking about this here.
If anybody has any clue or thoughts about what is happening in this situation it would be greatly appreciated.