How do I stop PC booting the wrong partition ?[SOLVED]
Forum rules
LMDE 2 has reached end of support as of 1-1-2019
LMDE 2 has reached end of support as of 1-1-2019
Re: How do I stop PC booting the wrong partition ?
I didn't realise I could use Gparted when I went looking for partition clone/copy software, I assume it would need to be Gparted from a Live medium ? Since Clonezilla website made very clear you can only clone to a partition of equal (or greater) size, it seemed like a good idea to make the partitions of identical size.
Ron
Ron
Re: How do I stop PC booting the wrong partition ?
OK, done that, it's still wrong.
Ron
Code: Select all
grep vmlin /boot//grub/grub.cfg
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro quiet splash
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro single
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro quiet splash
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro single
- Spearmint2
- Level 16
- Posts: 6900
- Joined: Sat May 04, 2013 1:41 pm
- Location: Maryland, USA
Re: How do I stop PC booting the wrong partition ?
Code: Select all
cat /boot/grub/grub.cfg |grep UUID; sudo blkid & sudo fdisk -l & sudo parted -l
for a bit of twist on yours, try this instead;
Code: Select all
grep generic /boot//grub/grub.cfg
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
Re: How do I stop PC booting the wrong partition ?
From the same place
Just paste back the grep results.
Code: Select all
sudo -i
Code: Select all
mount /dev/sda8 /mnt
Code: Select all
egrep '^UUID|^/dev' /mnt/etc/fstab
Code: Select all
umount -l /dev/sda8
Code: Select all
exit
Re: How do I stop PC booting the wrong partition ?
Looks like I stuffed up the other day ....
That 'newuuidhere' shouldn't be there ... i remember I got that command wrong when I first tried it
So I reran it ... and it looks like that wasn't good enough
Ron
Code: Select all
sudo -i
[sudo] password for ron:
baby-2 ~ # mount /dev/sda8 /mnt
baby-2 ~ # egrep '^UUID|^/dev' /mnt/etc/fstab
UUID=newuuidhere / ext4 rw,errors=remount-ro 0 1
UUID=afc6dcda-65ea-446d-9c95-4d355a03debc swap swap sw 0 0
baby-2 ~ # umount -l /dev/sda8
baby-2 ~ # exit
logout
Code: Select all
sed -i.bak 's/c456e7bd-e79e-496c-93a1-5c522359fdaa/newuuidhere/1' /etc/fstab
Ron
Re: How do I stop PC booting the wrong partition ?
Yupron_h wrote:Looks like I stuffed up the other day ....
I was always under the impression that grub used blkid or tune2fs to retrieve the UUID for the partition, but now I see it doesn't.
It's a good thing nothing happened given the substitution string wasn't there otherwise you would have messed up the sda6 system.ron_h wrote:So I reran it ... and it looks like that wasn't good enough
Get back to where you were before, meaning boot and open the terminal
Code: Select all
sudo -i
Code: Select all
mount /dev/sda8 /mnt
Code: Select all
sed -i.bak 's/newuuidhere/015fac40-f127-11e3-ad5a-2b2b889acdff/1' /mnt/etc/fstab
Code: Select all
grep 2b2b889acdff /mnt/etc/fstab
Code: Select all
/usr/sbin/update-grub
Code: Select all
grep vmlin /boot//grub/grub.cfg
Re: How do I stop PC booting the wrong partition ?
Sadly, no
Ron
Code: Select all
ron@baby-2 ~ $ sudo -i
[sudo] password for ron:
baby-2 ~ # mount /dev/sda8 /mnt
baby-2 ~ # sed -i.bak 's/newuuidhere/015fac40-f127-11e3-ad5a-2b2b889acdff/1' /mnt/etc/fstab
baby-2 ~ # grep 2b2b889acdff /mnt/etc/fstab
UUID=015fac40-f127-11e3-ad5a-2b2b889acdff / ext4 rw,errors=remount-ro 0 1
baby-2 ~ # /usr/sbin/update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11-2-amd64
Found initrd image: /boot/initrd.img-3.11-2-amd64
No volume groups found
Found Windows Recovery Environment (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda3
Found LMDE Cinnamon Edition (1) on /dev/sda8
done
[127]baby-2 ~ # grep vmlin /boot//grub/grub.cfg
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro quiet splash
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro single
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro quiet splash
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro single
Re: How do I stop PC booting the wrong partition ?
It seems to me that using Clonezilla to create a clone on a partition on the same hard drive was not a good decision on my part. Even if this thread ends up SOLVED, I won't be doing things the same way ever again. So I'm starting a new thread to detemine how I should have done it
Ron
Ron
Re: How do I stop PC booting the wrong partition ?
Mount the partition or make sure it's mounted andron_h wrote:It seems to me that using Clonexzilla to create a clone on a partition on the same hard drive was not a good decision on my part. Even if this thread ends up SOLVED, I won't be doing things the same way ever again. So I'm starting a new thread to detemine how I should have done it
Ron
Code: Select all
cat /mnt/boot/grub/i386-pc/load.cfg
Re: How do I stop PC booting the wrong partition ?
sda6 is mounted, it's the running system. I also mounted sda8
The only subdirectory in /mnt/boot/grub is /locale, and there is no load.cfg file in /mnt/boot/grub or in /mnt/boot/grub/locale
Ron
Code: Select all
ron@baby-2 ~ $ cat /mnt/boot/grub/i386-pc/load.cfg
cat: /mnt/boot/grub/i386-pc/load.cfg: No such file or directory
Ron
Re: How do I stop PC booting the wrong partition ?
I can't find load.cfg at all
Ron
Ron
Re: How do I stop PC booting the wrong partition ?
Well, that's strange. If this is a clone of sda6 then it should be there. I've never touched that file, even when I rsync clone my running system to a flash and the flash to another computer.ron_h wrote:I can't find load.cfg at all
Ron
Lets just manually adjust grub and see if it boots. Use your text editor to change the UUID entry in grub.cfg. Just make a copy first.
Code: Select all
sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.bak
Code: Select all
sudo youreditor /boot/grub/grub.cfg&
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=015fac40-f127-11e3-ad5a-2b2b889acdff ro quiet splash
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=015fac40-f127-11e3-ad5a-2b2b889acdff ro single
Save the file and reboot.
Re: How do I stop PC booting the wrong partition ?
I made the backup then started gedit (I'm using Cinnamon) for grub.cfg. In your example code, do I have to specify the & that is at the end of the file ID ?
I have NOT yet made the changes. This is what I see for entries 5 and 6 in the grub menu, which do indeed boot the wrong partition !
For the entries 1 & 2 in the menu, all UUID references are to the sda6 UUID
I have NOT yet made the changes. This is what I see for entries 5 and 6 in the grub menu, which do indeed boot the wrong partition !
Code: Select all
menuentry "LMDE Cinnamon 64-bit, 3.11-2-amd64 (/dev/sda6) (on /dev/sda8)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 015fac40-f127-11e3-ad5a-2b2b889acdff
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro quiet splash
initrd /boot/initrd.img-3.11-2-amd64
}
menuentry "LMDE Cinnamon 64-bit, 3.11-2-amd64 (/dev/sda6) -- (recovery mode) (on /dev/sda8)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 015fac40-f127-11e3-ad5a-2b2b889acdff
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro single
initrd /boot/initrd.img-3.11-2-amd64
Re: How do I stop PC booting the wrong partition ?
No, but if you do it will put the editor in the background freeing-up the terminal in case you need to get into it.do I have to specify the & that is at the end of the file ID ?
You can change the menu options to
Code: Select all
menuentry "LMDE Cinnamon 64-bit, 3.11-2-amd64 on /dev/sda8)" --class gnu-linux --class gnu --class os {
menuentry "LMDE Cinnamon 64-bit, 3.11-2-amd64 recovery mode (on /dev/sda8)" --class gnu-linux --class gnu --class os {
Code: Select all
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=015fac40-f127-11e3-ad5a-2b2b889acdff ro quiet splash
linux /boot/vmlinuz-3.11-2-amd64 root=UUID=015fac40-f127-11e3-ad5a-2b2b889acdff ro single
Re: How do I stop PC booting the wrong partition ?
Many thanks again. I did copy/paste the lines, although I changed LMDE to LMDETEST which looks better (to my eyes) in the GRUB menu.
I confirm that I can now boot to the LMDE system or the LMDETEST system, which is what I started this thread for.
As long as I don't run update-grub or grub-mkconfig, or install another system in a different partition, I assume grub.cfg will remain unchanged. However, if I do any of those things, would I be right to assume that grub.cfg will become incorrect again with respect to sda8 ? If so, then I think I need to reinstall LMDETEST but not by a cloning method, rather by a filesystem copy method such as fsarchiver. That however is a whole different exercise, beyond the scope of this thread.
Ron
I confirm that I can now boot to the LMDE system or the LMDETEST system, which is what I started this thread for.
As long as I don't run update-grub or grub-mkconfig, or install another system in a different partition, I assume grub.cfg will remain unchanged. However, if I do any of those things, would I be right to assume that grub.cfg will become incorrect again with respect to sda8 ? If so, then I think I need to reinstall LMDETEST but not by a cloning method, rather by a filesystem copy method such as fsarchiver. That however is a whole different exercise, beyond the scope of this thread.
Ron
Re: How do I stop PC booting the wrong partition ?
It appears likely that an update to the kernel or initrd will mess up the grub file again. You can check withron_h wrote:As long as I don't run update-grub or grub-mkconfig, or install another system in a different partition, I assume grub.cfg will remain unchanged. However, if I do any of those things, would I be right to assume that grub.cfg will become incorrect again with respect to sda8 ? If so, then I think I need to reinstall LMDETEST but not by a cloning method, rather by a filesystem copy method such as fsarchiver. That however is a whole different exercise, beyond the scope of this thread.
Ron
Code: Select all
sudo /usr/sbin/grub-mkconfig
You can always save the grub file and just copy it back with changes to the kernel and initrd versions to reflect the new entries. I use symlink references in grub so I don't have to modify the grub file, just adjust the symlinks in /boot.
Also since this is LMDE and not the main edition, you might want to try posting your experience to the LMDE forum. Maybe there's a grub bug with this edition.
I've cloned my running system to a flash drive using rsync several times, chrooted and made the same modifications I had you do without any problems.
Whatever you decide to do good luck with it
- austin.texas
- Level 20
- Posts: 12003
- Joined: Tue Nov 17, 2009 3:57 pm
- Location: at /home
Re: How do I stop PC booting the wrong partition ?
Boot into Mint on sda6 and edit the /etc/fstab file on sda8.
Change from:
UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa / ext4 rw,errors=remount-ro 0 1
to:
UUID=015fac40-f127-11e3-ad5a-2b2b889acdff / ext4 rw,errors=remount-ro 0 1
Then run: sudo /usr/sbin/update-grub putting the new Mint on the GRUB menu.
When you boot into Mint on sda8, run sudo /usr/sbin/update-grub again there.
Change from:
UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa / ext4 rw,errors=remount-ro 0 1
to:
UUID=015fac40-f127-11e3-ad5a-2b2b889acdff / ext4 rw,errors=remount-ro 0 1
Then run: sudo /usr/sbin/update-grub putting the new Mint on the GRUB menu.
When you boot into Mint on sda8, run sudo /usr/sbin/update-grub again there.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Linux Linx 2018
- Spearmint2
- Level 16
- Posts: 6900
- Joined: Sat May 04, 2013 1:41 pm
- Location: Maryland, USA
Re: How do I stop PC booting the wrong partition ?
and this is why some like to use boot partitions where multiple systems may reside.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
Re: How do I stop PC booting the wrong partition ?
I am sure it is as a result of the fact that sda8 started life as a clone of sda6 but when I looked at fstab on sda8, it showed the right UUID for sda8 but pointed to sda6 rather than sda8. It would appear that the referenced partition is then what ends up being booted in spite of the fact that the UUID does not match the one in the fstab. I have corrected the fstab on sda8 to point to sda8. Hopefully everything is now kosher and I have 2 boot partitions where everything internally cross references correctly. I will run an update-grub but (I'm chicken) not now. Later today maybe.
I started this thread in Newbie Questions in Main Edition, it is now in LMDE Newbie Questions as someone has moved it.
Many thanks to all who've helped me get to this stage.
Ron
I started this thread in Newbie Questions in Main Edition, it is now in LMDE Newbie Questions as someone has moved it.
Many thanks to all who've helped me get to this stage.
Ron
Re: How do I stop PC booting the wrong partition ?
Ron,
This will not write to the grub.cfg file, it will just dump to the terminal so you can see if that problem will persist.
This will not write to the grub.cfg file, it will just dump to the terminal so you can see if that problem will persist.
Code: Select all
sudo /usr/sbin/grub-mkconfig