How do I stop PC booting the wrong partition ?[SOLVED]

Archived topics about LMDE 1
Forum rules
ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

How do I stop PC booting the wrong partition ?[SOLVED]

Postby ron_h » Tue Jun 10, 2014 7:52 pm

LMDE 201403 Cinnamon 64bit (but I don't think this question is LMDE realated)

I downloaded Clonezilla Live (*) iso and burnt it to a USB stick. I then used it taking all defaults to clone the local LMDE partition (which is on sda6 **) to another local partition (sda8) which I want to use in future for testing changes before updating the main system. Clonezilla finished OK and I shut it down. I rebooted the netbook and LMDE came up just fine. However, when I checked the partitions using Gparted, sda8 was mounted and sda6 wasn't, not what I expected. I shut down and rebooted. The GRUB menu definitely says the LMDE system I chose to boot is on sda6, not sda8. I guess that it was something Clonezilla did which caused sda8 to become the default boot partition, and ignore the previous default boot partition, but Clonezilla did not update the GRUB menu accordingly.

1. Can I stop this happening on a different PC if I also clone the current LMDE partition ? If so, how ? I've looked at the Clonezilla doc online and I can't see anything there to help.
2. How do I modify the GRUB menu to boot the sda6 partition like it used to, also to boot sda6 in recovery mode if required ?
3. How do I modify the GRUB menu to add additional options to boot the sda8 partition in ordinary or recovery mode ?

Ron

* I decided not to use the Clonezilla package in Synaptic Package Manager as it was the Server Edition. I thought Clonezilla Live was a better fit for me.
** sda1 through sda5 are partitions as Acer supplied with the netbook including Win 7 system, while sda7 is the Linux Swap.
Last edited by ron_h on Wed Jun 18, 2014 1:06 am, edited 5 times in total.

User avatar
WharfRat
Level 16
Level 16
Posts: 6976
Joined: Thu Apr 07, 2011 8:15 pm

Re: How do I stop PC booting the wrong partition ?

Postby WharfRat » Tue Jun 10, 2014 8:12 pm

Ron,

I suspect that Clonezilla preserved the UUID of the partition so it's the same as sda6. The initrd uses the UUID to to fetch some pre-booting info from the partition and sda6 is most likely found first.

paste back

Code: Select all

sudo blkid

and

Code: Select all

egrep  'vmlinuz|initrd' /boot/grub/grub.cfg
Image

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Tue Jun 10, 2014 9:01 pm

OK, here goes :

Code: Select all

/dev/sda1: LABEL="PQSERVICE" UUID="16BCF517BCF4F1DB" TYPE="ntfs"
/dev/sda2: UUID="E2F0-474B" TYPE="vfat"
/dev/sda3: LABEL="SYSTEM RESERVED" UUID="28BCF745BCF70BD6" TYPE="ntfs"
/dev/sda5: LABEL="Acer" UUID="B030F98030F94E3A" TYPE="ntfs"
/dev/sda7: UUID="afc6dcda-65ea-446d-9c95-4d355a03debc" TYPE="swap" LABEL="SWAP"
/dev/sda6: UUID="c456e7bd-e79e-496c-93a1-5c522359fdaa" TYPE="ext4" LABEL="LMDE"
/dev/sda8: LABEL="LMDE" UUID="c456e7bd-e79e-496c-93a1-5c522359fdaa" TYPE="ext4"


I see the UUIDs are indeed identical. Also, the Label I had specified for sda8 has been overridden as well by Clonezilla. sda4 is the whole extended partition.

and

Code: Select all

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
   linux   /boot/vmlinuz-3.11-2-amd64 root=UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa ro single
   initrd   /boot/initrd.img-3.11-2-amd64


Ron

Mute Ant
Level 10
Level 10
Posts: 3024
Joined: Tue Sep 03, 2013 7:45 pm

Re: How do I stop PC booting the wrong partition ?

Postby Mute Ant » Tue Jun 10, 2014 9:37 pm

So it is booting the correct partition and has the paperwork to prove it!
The half-life of a running drive is around six years...there's a 1-in-3000 chance that yours fails today.
"And those who were seen dancing were thought insane by those who could not hear the music"

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Tue Jun 10, 2014 9:56 pm

Hmm. The GRUB menu as displayed to the wetware (not to be confused with what the software sees) says specifically sda6, but what is booted is sda8.

Ron

wayne128
Level 10
Level 10
Posts: 3420
Joined: Tue Jul 13, 2010 12:15 am

Re: How do I stop PC booting the wrong partition ?

Postby wayne128 » Tue Jun 10, 2014 10:07 pm

Years ago when I learned how to clone partition OS ( except I simply use gparted to copy and paste),
at time I run OS plus its clone in the same hard disk, but different partition, then I experienced what you reported.
In additions, I even dist-upgrade, and eventually found all sort of weird things..

So I learned it is not advisable to run OS with its clone partition also active at the same time!!

Now my practice , if I wish to have another 'same OS' running in the same internal hard disk, or external USB drive, I no longer use clone method, what I have been doing is, use qt4-fsarchiver to backup the OS partition to a 'compressed file', it can be store anywhere, in data partition, in external USB, etc

Then, run qt4-fsarchiver again, restore this to another partition, it will have different UUID and it will become not a clone but another 'same OS'.. this way I stayed away from the problem you reported. :mrgreen:

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Tue Jun 10, 2014 10:25 pm

Many thanks. I thought I'd made things simple by using Clonezilla. Silly me. I'll investigate qt4-fsarchiver now.
UPDATE : I can see fsarchiver in Synaptic Package Manager but no sign of qt4-fsarchiver ...
UPDATE 2 : I have found qt4-fsarchiver on its own site and am downloading the Live-CD image

Would reformatting sda8 after booting with LMDE-Live clear the duplicate UUID ? If not, how do I get rid of the duplicate UUID ?
UPDATE 2 : answered in the post following

Ron
Last edited by ron_h on Wed Jun 11, 2014 6:42 am, edited 2 times in total.

User avatar
WharfRat
Level 16
Level 16
Posts: 6976
Joined: Thu Apr 07, 2011 8:15 pm

Re: How do I stop PC booting the wrong partition ?

Postby WharfRat » Tue Jun 10, 2014 10:37 pm

Ron,

A few minor adjustments will get both installations running

Code: Select all

sudo -i

Make sure the partition is unmounted

Code: Select all

if mount|grep sda8; then umount -l /dev/sda8;fi

Change the label

Code: Select all

tune2fs /dev/sda8 -L LMDETEST

Install uuid if it's not already installed

Code: Select all

test $(which uuid) || sudo apt-get install uuid

Change the uuid

Code: Select all

tune2fs /dev/sda8 -U $(uuid)

Now mount the partition and chroot to sda8

Code: Select all

mount /dev/sda8 /mnt

Code: Select all

mount -t proc none /mnt/proc

Code: Select all

mount --rbind /sys /mnt/sys

Code: Select all

mount --rbind /dev /mnt/dev

Code: Select all

/usr/sbin/chroot /mnt /bin/bash

Code: Select all

source /etc/profile

Code: Select all

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

Code: Select all

export PS1="\[\033[1;33m\]chroot to ->\[\033[1;31m\](system) #\[\e[0m\] "

Copy this new uuid and use it in the sed line below

Code: Select all

blkid|grep sda8|awk '{print $3}'|tr -d 'UUID="'

Replace newuuidhere with the uuid you copied

Code: Select all

sed -i.bak 's/c456e7bd-e79e-496c-93a1-5c522359fdaa/newuuidhere/1' /etc/fstab

Update the initial ram

Code: Select all

update-initramfs -uv -k $(ls /boot/|grep vmlinuz|cut -c 9-)

Done

Code: Select all

exit

Code: Select all

reboot


After rebooting back to sda6 open the terminal and

Code: Select all

sudo /usr/sbin/update-grub


That should give you the two versions to boot to and that's all there is to it...

Good luck :wink:
Image

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How stop PC booting the wrong partition ?

Postby ron_h » Wed Jun 11, 2014 1:58 am

Many thanks, I have done all that, and, yes there are 2 extra entries at the bottom of the GRUB menu while Gparted shows the label of the test partition as LMDETEST. The 2 partitions sda6 and sda8 have different UUIDs.

It would be nice if I could change the entries relating to LMDETEST to be a little more distinctive, preferably including LMDETEST. They currently both start

Code: Select all

LMDE Cinnamon 64-bit, 3.11-2-amd64 (/dev/sda6) (on /dev/sda8)

whereas the top 2 entries relating to LMDE are identical for the first 40 or so characters

Code: Select all

LMDE Cinnamon 64-bit, 3.11-2-amd64 (/dev/sda6)


Ron

UPDATE I had marked this thread as SOLVED but that is not the case. The symptom noted above actually tells me (but I didn't realise it) that I now have 4 choices for booting the LMDE partition, sda6, 2 at the top of the GRUB menu, either running system or recovery mode, and 2 at the bottom of the GRUB menu, also running system or recovery mode. I had assumed that the 2 at the bottom of the GRUB menu would boot the LMDETEST partition, sda8, but they don't. Instead they boot the LMDE partition, sda6. I do not have a GRUB menu option which boots the LMDETEST partition.

What do I need to do to get GRUB to contain an option to boot the LMDETEST partition, sda8

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Thu Jun 12, 2014 9:27 pm

More info

When I had 2 identical partitions, both were shown as having a mount point /

Now I have non-identical partitions, only sda6 is shown as having a mount point /

Ron

User avatar
WharfRat
Level 16
Level 16
Posts: 6976
Joined: Thu Apr 07, 2011 8:15 pm

Re: How do I stop PC booting the wrong partition ?

Postby WharfRat » Sat Jun 14, 2014 10:52 am

Start the first listed installation, run and paste back

Code: Select all

mount|grep -w /

Code: Select all

egrep '^UUID|^/dev' /etc/fstab


Then reboot to the second installation and do the same.
Image

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Sat Jun 14, 2014 6:19 pm

I can only boot one partition, even though there are GRUB menu items for booting two, selecting either just gives me the same partition. So I can't do as you suggest for both partitions. For the partition that does boot I'll run those 2 commands and post the results

Ron

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Sat Jun 14, 2014 6:33 pm

Code: Select all

ron@baby-2 ~ $ mount |grep -w /
/dev/disk/by-uuid/c456e7bd-e79e-496c-93a1-5c522359fdaa on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

Code: Select all

ron@baby-2 ~ $ egrep '^UUID|^dev' /etc/fstab
UUID=c456e7bd-e79e-496c-93a1-5c522359fdaa   /   ext4   rw,errors=remount-ro   0   1
UUID=afc6dcda-65ea-446d-9c95-4d355a03debc   swap   swap   sw   0   0


Ron

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Sat Jun 14, 2014 7:17 pm

I've just confirmed that whether I select the first GRUB menu item or the fifth, I get the same partition booted, LMDE, not LMDETEST.

The GRUB items are (abbreviated, I don't know how to do a screen capture of the GRUB screen)

Code: Select all

LMDE Cinnamon ... sda6
LMDE Cinnamon ... sda6 recovery
Win 7
Win 7 recovery
LMDE Cinnamon ... sda6 ... on sda8
LMDE Cinnamon ... sda6 ... on sda8 recovery


I'd post a screen capture of what Gparted shows but I don't know how to paste an image into a post :-(

Ron

User avatar
WharfRat
Level 16
Level 16
Posts: 6976
Joined: Thu Apr 07, 2011 8:15 pm

Re: How do I stop PC booting the wrong partition ?

Postby WharfRat » Sat Jun 14, 2014 7:27 pm

From where you are now, hopefully the same place you were when you posted the above, paste back

Code: Select all

sudo blkid

and

Code: Select all

grep vmlin /boot//grub/grub.cfg
Image

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Sat Jun 14, 2014 9:43 pm

OK

Code: Select all

ron@baby-2 ~ $ sudo blkid
[sudo] password for ron:
/dev/sda1: LABEL="PQSERVICE" UUID="16BCF517BCF4F1DB" TYPE="ntfs"
/dev/sda2: UUID="E2F0-474B" TYPE="vfat"
/dev/sda3: LABEL="SYSTEM RESERVED" UUID="28BCF745BCF70BD6" TYPE="ntfs"
/dev/sda5: LABEL="Acer" UUID="B030F98030F94E3A" TYPE="ntfs"
/dev/sda7: UUID="afc6dcda-65ea-446d-9c95-4d355a03debc" TYPE="swap" LABEL="SWAP"
/dev/sda6: UUID="c456e7bd-e79e-496c-93a1-5c522359fdaa" TYPE="ext4" LABEL="LMDE"
/dev/sda8: LABEL="LMDETEST" UUID="015fac40-f127-11e3-ad5a-2b2b889acdff" TYPE="ext4"


and

Code: Select all

ron@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

User avatar
WharfRat
Level 16
Level 16
Posts: 6976
Joined: Thu Apr 07, 2011 8:15 pm

Re: How do I stop PC booting the wrong partition ?

Postby WharfRat » Sat Jun 14, 2014 10:00 pm

What about this :?:

Code: Select all

sudo /usr/sbin/grub-mkconfig|grep vmlinuz
Image

User avatar
Spearmint2
Level 12
Level 12
Posts: 4342
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How do I stop PC booting the wrong partition ?

Postby Spearmint2 » Sat Jun 14, 2014 10:48 pm

How I avoid the "clone syndrome" is to make a new partition a little larger using GParted, which gives it unique characteristics, then use the Copy/Paste in GParted to copy the old partition onto the new one. I've never run into that clone problem doing that. I suppose the cloning software expects to find the clone on a different hard drive which also would solve the problem.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....

ron_h
Level 4
Level 4
Posts: 235
Joined: Tue Apr 15, 2014 7:03 am
Location: Sydney, NSW, AU

Re: How do I stop PC booting the wrong partition ?

Postby ron_h » Sun Jun 15, 2014 12:26 am

OK

Code: Select all

sudo /usr/sbin/grub-mkconfig|grep vmlinuz
[sudo] password for ron:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11-2-amd64
Found initrd image: /boot/initrd.img-3.11-2-amd64
   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
  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
   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
done


And, it's wrong again, isn't it ? The UUID it's using for sda8 is not the UUID of sda8

Code: Select all

sudo blkid
/dev/sda1: LABEL="PQSERVICE" UUID="16BCF517BCF4F1DB" TYPE="ntfs"
/dev/sda2: UUID="E2F0-474B" TYPE="vfat"
/dev/sda3: LABEL="SYSTEM RESERVED" UUID="28BCF745BCF70BD6" TYPE="ntfs"
/dev/sda5: LABEL="Acer" UUID="B030F98030F94E3A" TYPE="ntfs"
/dev/sda7: UUID="afc6dcda-65ea-446d-9c95-4d355a03debc" TYPE="swap" LABEL="SWAP"
/dev/sda6: UUID="c456e7bd-e79e-496c-93a1-5c522359fdaa" TYPE="ext4" LABEL="LMDE"
/dev/sda8: LABEL="LMDETEST" UUID="015fac40-f127-11e3-ad5a-2b2b889acdff" TYPE="ext4"

User avatar
Spearmint2
Level 12
Level 12
Posts: 4342
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How do I stop PC booting the wrong partition ?

Postby Spearmint2 » Sun Jun 15, 2014 12:29 am

you haven't run update-grub yet.

Code: Select all

sudo update-grub
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 4 guests