Wanny
Posts: 8
Joined: Sat Oct 21, 2017 12:14 am

cmdline.txt UUID setting. Also, can be used with LABEL?

Sat Oct 21, 2017 3:08 am

After my issue with setting the USB boot mode bit is resolved, I want to set the cmdline.txt file to boot from UUID and I have a bit of confusion:

1.- I've read in some places to use root=UUID and in others they say to use root=PARTUUID. Which one is correct?

2.- I put the same image on the USB drive than the one I put on the SD and I noticed that the partitions in the SD drive and the USB drive have the very same (PART)UUID, so I want to make sure I boot the correct device (at least initially since I'll remove the SD card definitely).
I read that the parameter in this case is root=LABEL=whateverlabel

Is there a way to set both the UUID and the drive label in cmdline.txt?

RonR
Posts: 209
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sat Oct 21, 2017 7:51 am

I believe UUID, PARTUUID, and LABEL are all valid for booting, but I've only used PARTUUID.

The ext4 (root) UUID and volume label can be set with tune2fs (see: man tune2fs)

set-boot will set the PARTUUID:

download/file.php?id=19909

Usage:

set-boot device <ptuuid | /dev/mmcblk0>

The first parameter (device) may be /dev/sda through /dev/sdz, or /dev/mmcblk0

The second parameter may be 8 hex digits (ptuuid) or /dev/mmcblk0
If ptuuid is specified, the partition table uuid is set. /boot/cmdline.txt and /etc/fstab are set to match using PARTUUID notation.
If /dev/mmcblk0 is specified, the partition table uuid is not altered. /boot/cmdline.txt and /etc/fstab are set using /dev/mmcblk0 notation.

Wanny
Posts: 8
Joined: Sat Oct 21, 2017 12:14 am

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sat Oct 21, 2017 2:03 pm

OK, let's see... since I configured the USB booting mode with Raspbian Lite, now the (PART)UUIDs of the USB drive (that has a freshly flashed xubuntu image) and the SD card are different. Now blkid outputs this:

Code: Select all

/dev/mmcblk0p1: LABEL="boot" UUID="B60A-B262" TYPE="vfat" PARTUUID="ef57b881-01"
/dev/mmcblk0p2: UUID="9a7608bd-5bff-4dfc-ac1d-63a956744162" TYPE="ext4" PARTUUID="ef57b881-02"
/dev/sda1: SEC_TYPE="msdos" LABEL="PI_BOOT" UUID="C90C-5B63" TYPE="vfat" PARTUUID="6481607d-01"
/dev/sda2: LABEL="PI_ROOT" UUID="cd3a59dd-483f-459b-98c0-9423af4c9160" TYPE="ext4" PARTUUID="6481607d-02"
/dev/mmcblk0: PTUUID="ef57b881" PTTYPE="dos"
- I set root=PARTUUID=6481607d-02 in the SD card's cmdline.txt without changing anything in the USB drive. Xubuntu boots, but when I'm greeted with the initial configuration screen it stops recognizing the keyboard and mouse...

- I then tried to set the value in the USB drive's cmdline.txt (and removing the SD card) and it "boots"... but after a while with the xbuntu boot screen I'm greeted with Emergency Mode (i.e. the filesystems aren't mounted).

- I checked Raspbian Lite's fstab and noticed that it lists the partitions with their respective PARTUUID as well. I tried that, changing the USB drive's fstab from

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p2  /               ext4   defaults,noatime  0       1
/dev/mmcblk0p1  /boot/          vfat    defaults          0       2
to

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=6481607d-01  /boot           vfat    defaults          0       2
PARTUUID=6481607d-02  /               ext4    defaults,noatime  0       1
And I'm greeted with Emergency Mode as well =C

I restored the SD card's original cmdline.txt to be able of booting Raspbian... So I'm now like this:
Image
(to be able of changing stuff directly in Raspbian I mounted the USB drive's partitions in /mnt/USB1 and /mnt/USB2 respectively )


Booting from the SD card with the cmdline.txt pointing to the USB drive's UUID I see that there's two big FAILED lines, that I think are pretty critical:
* [FAILED] Failed to start Load Kernel Modules, and....
* [FAILED] Failed to start Remount Root and Kernel File Systems

RonR
Posts: 209
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sat Oct 21, 2017 6:58 pm

Sorry, I can't help with Xubuntu. Everything works as expected with vanilla Raspbian images (I've been running off of USB flash drives booted via SD cards for years with no problems).

Wanny
Posts: 8
Joined: Sat Oct 21, 2017 12:14 am

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sun Oct 22, 2017 1:58 pm

RonR wrote:
Sat Oct 21, 2017 6:58 pm
Sorry, I can't help with Xubuntu. Everything works as expected with vanilla Raspbian images (I've been running off of USB flash drives booted via SD cards for years with no problems).
Can you please share your cmdline.txt / fstab setup, to see if it can help to enlighten me?

User avatar
DougieLawson
Posts: 30459
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sun Oct 22, 2017 6:22 pm

Wanny wrote:
Sat Oct 21, 2017 2:03 pm

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=6481607d-01  /boot           vfat    defaults          0       2
PARTUUID=6481607d-02  /               ext4    defaults,noatime  0       1
Set it up like that with root=PARTUUID=6481607d-02 in /boot/cmdline.txt on your 6481607d-01 partition.

Eject the SDCard and it should boot from the USB with /boot on /dev/sda1 and the rootfs on /dev/sda2.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

RonR
Posts: 209
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sun Oct 22, 2017 6:42 pm

I use PARTUUID references in cmdline.txt and fstab since /dev/sdX references can shift if additional USB storage devices are plugged in.

Use blkid to verify that all USB devices have unique PARTUUID's and that none of them are the same as the SD card.

set-boot (download/file.php?id=19909) can be used to make any necessary changes.

Wanny
Posts: 8
Joined: Sat Oct 21, 2017 12:14 am

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sun Oct 22, 2017 11:02 pm

Guys, please read my first post, I indicated all that stuff.

This is the output of blkid:

Code: Select all

/dev/mmcblk0p1: LABEL="boot" UUID="B60A-B262" TYPE="vfat" PARTUUID="ef57b881-01"
/dev/mmcblk0p2: UUID="9a7608bd-5bff-4dfc-ac1d-63a956744162" TYPE="ext4" PARTUUID="ef57b881-02"
/dev/sda1: SEC_TYPE="msdos" LABEL="PI_BOOT" UUID="C90C-5B63" TYPE="vfat" PARTUUID="6481607d-01"
/dev/sda2: LABEL="PI_ROOT" UUID="cd3a59dd-483f-459b-98c0-9423af4c9160" TYPE="ext4" PARTUUID="6481607d-02"
/dev/mmcblk0: PTUUID="ef57b881" PTTYPE="dos"

This is the cmdline.txt of the /boot partition of the SD card:

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=6481607D-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

And this is the cmdline.exe of the /boot partition of the USB drive:

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=6481607D-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
(yup, identical save from the uppercase D)


This is the fstab of the Raspbian installed in the SD card:

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=ef57b881-01  /boot           vfat    defaults          0       2
PARTUUID=ef57b881-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

And this is the current fstab of the Xubuntu installed in the USB drive:

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=6481607d-01  /boot           vfat    defaults          0       2
PARTUUID=6481607d-02  /               ext4    defaults,noatime  0       1
I'm going to try copying the bootcode.bin, fixup.dat and start.elf from the SD card to the USB drive. I had followed the Ubuntu guide and had copied the latest versions from here
Last edited by Wanny on Sun Oct 22, 2017 11:16 pm, edited 2 times in total.

RonR
Posts: 209
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sun Oct 22, 2017 11:14 pm

At first glance, everything looks correct.

Why don't you try the same thing using Raspbian on the USB drive just to prove that you're not doing anything wrong and that the problem is with Xubuntu?

Wanny
Posts: 8
Joined: Sat Oct 21, 2017 12:14 am

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Sun Oct 22, 2017 11:27 pm

SEEMS that the problem is with Xubuntu.

I'm in Emergency Mode and using journalctl -xb I find the following lines:

Code: Select all

systemd-remount-fs: mount: can't find PARTUUID=6481607D-02
systemd-remount-fs: /bin/mount for / exited with exit status 1.
Will try changing the fstab to match the case of the PARTUUID....

EDIT: OK, got past the initial check of systemd-remount-fs but apparently the issue is now in the xubuntu kernel itself. Examples:

Code: Select all

xubuntu kernel: brcmfmac: brcmf_c_preinit_dcmcs: Firmware version = w10: Dec 15 2015 18:10:45 version 7.45.41.23 (r606571) FWID 01-cc4eda9c
(this line appears with red text)

and

Code: Select all

xubuntu systemd: dev-disk-by\x2dpartuuid-6481607d\x2d01.device: Job dev-disk-by\x2dpartuuid-6481607d\x2d01.device/start timed out.
Screw xubuntu. I'll have to use Raspbian... hope the desktop is prettier than the last time I used it :P

Wanny
Posts: 8
Joined: Sat Oct 21, 2017 12:14 am

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Mon Oct 23, 2017 3:59 am

Haha, I installed Raspbian in the USB drive and trying booting it straight away without SD card. Voilà!

User avatar
DougieLawson
Posts: 30459
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: cmdline.txt UUID setting. Also, can be used with LABEL?

Mon Oct 23, 2017 10:59 am

Then the bootcode/kernel for xubuntu is too old to support USB booting. If you can run rpi-update on it that's one way to get the latest versions.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

Return to “Troubleshooting”

Who is online

Users browsing this forum: lucasgsantos and 40 guests