arglebargle
Posts: 9
Joined: Tue May 23, 2017 1:43 am
Location: California

[Solved] Issues with root=PARTUUID= in cmdline.txt at boot

Wed May 24, 2017 7:12 pm

Edit: Using an initrd caused this confusion. Mounting root with root=PARTUUID= works without an initrd, with an initrd root=PARTUUID= fails and root=UUID= works.

Hey all,

I'm having some trouble understanding which drive identifiers are available at different stages of system boot. I'm running a Pi 2B with a btrfs root mounted on an external USB SSD. I'd like to address the root fs by PARTUUID rather than kernel name descriptor in case USB storage plug order ever changes but I'm having a hard time getting bootup working. I've built an initrd.img containing neccessary btrfs modules; bootup is fine using /dev/XdXn but PARTUUID naming fails every time and dumps me out into busybox. initrd.img is setup in config.txt using "initramfs initrd.img-4.9.24-v7+ followkernel". Note: / is mounted on a subvolume of the btrfs volume named ROOT.

This boots:

Code: Select all

root@Tree-Eater:/etc# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=btrfs rootflags=subvol=ROOT elevator=deadline rootwait rootdelay=5 quiet splash plymouth.ignore-serial-consoles
This fails:

Code: Select all

root@Tree-Eater:/etc# cat /boot/cmdline.partuuid
dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=be046359-02 rootfstype=btrfs rootflags=subvol=ROOT elevator=deadline rootwait rootdelay=5 quiet splash plymouth.ignore-serial-consoles
Relevant fs & block device info below, any thoughts?

Code: Select all

root@Tree-Eater:/etc# cat /etc/fstab
proc                    /proc           proc    defaults          0       0
/dev/mmcblk0p1          /boot           vfat    defaults          0       2

LABEL=external_btrfs    /               btrfs   defaults,space_cache,ssd,noatime,nodiratime,subvol=ROOT         0 0
LABEL=swappy            /swap           ext4    defaults,noatime,nodiratime                                     0 2

# btrfs fs root for snapshots
LABEL=external_btrfs    /mnt/btrfs      btrfs   defaults,noauto,space_cache,ssd,noatime,nodiratime              0 0
/dev/mmcblk0p2          /mnt/sdroot     ext4    defaults,noatime,nodiratime,noauto                              0 0

Code: Select all

root@Tree-Eater:/etc# blkid -o export
DEVNAME=/dev/mmcblk0p1
SEC_TYPE=msdos
LABEL=boot
UUID=2D2D-CD16
TYPE=vfat
PARTUUID=d660c869-01

DEVNAME=/dev/mmcblk0p2
UUID=2f840c69-cecb-4b10-87e4-01b9d28c231c
TYPE=ext4
PARTUUID=d660c869-02

DEVNAME=/dev/sda1
LABEL=swappy
UUID=74ac5717-c894-4d16-97e2-78a07bb219e3
TYPE=ext4
PARTUUID=be046359-01

DEVNAME=/dev/sda2
LABEL=external_btrfs
UUID=b21e0b28-05d1-4518-a4c9-77cacdf83d08
UUID_SUB=d2439418-1cc2-47d4-9e36-3598de7fb75b
TYPE=btrfs
PARTUUID=be046359-02

DEVNAME=/dev/mmcblk0
PTUUID=d660c869
PTTYPE=dos

Code: Select all

root@Tree-Eater:~# tree /dev/disk
/dev/disk
├── by-id
│   ├── ata-SAMSUNG_SSD_PM810_mSATA_32GB_S0UFNEABC00046 -> ../../sda
│   ├── ata-SAMSUNG_SSD_PM810_mSATA_32GB_S0UFNEABC00046-part1 -> ../../sda1
│   ├── ata-SAMSUNG_SSD_PM810_mSATA_32GB_S0UFNEABC00046-part2 -> ../../sda2
│   ├── mmc-SS08G_0x8a9a424b -> ../../mmcblk0
│   ├── mmc-SS08G_0x8a9a424b-part1 -> ../../mmcblk0p1
│   ├── mmc-SS08G_0x8a9a424b-part2 -> ../../mmcblk0p2
│   ├── wwn-0x50000f0000000000 -> ../../sda
│   ├── wwn-0x50000f0000000000-part1 -> ../../sda1
│   └── wwn-0x50000f0000000000-part2 -> ../../sda2
├── by-label
│   ├── boot -> ../../mmcblk0p1
│   ├── external_btrfs -> ../../sda2
│   └── swappy -> ../../sda1
├── by-partuuid
│   ├── be046359-01 -> ../../sda1
│   ├── be046359-02 -> ../../sda2
│   ├── d660c869-01 -> ../../mmcblk0p1
│   └── d660c869-02 -> ../../mmcblk0p2
├── by-path
│   ├── platform-3f202000.sdhost -> ../../mmcblk0
│   ├── platform-3f202000.sdhost-part1 -> ../../mmcblk0p1
│   ├── platform-3f202000.sdhost-part2 -> ../../mmcblk0p2
│   ├── platform-3f980000.usb-usb-0:1.3:1.0-scsi-0:0:0:0 -> ../../sda
│   ├── platform-3f980000.usb-usb-0:1.3:1.0-scsi-0:0:0:0-part1 -> ../../sda1
│   └── platform-3f980000.usb-usb-0:1.3:1.0-scsi-0:0:0:0-part2 -> ../../sda2
└── by-uuid
    ├── 2D2D-CD16 -> ../../mmcblk0p1
    ├── 2f840c69-cecb-4b10-87e4-01b9d28c231c -> ../../mmcblk0p2
    ├── 74ac5717-c894-4d16-97e2-78a07bb219e3 -> ../../sda1
    └── b21e0b28-05d1-4518-a4c9-77cacdf83d08 -> ../../sda2

Last edited by arglebargle on Wed Jun 07, 2017 6:33 pm, edited 4 times in total.

brucetexpeditefile
Posts: 24
Joined: Tue Jun 23, 2015 10:48 pm

Re: Issues with root=PARTUUID= in cmdline.txt at boot

Thu May 25, 2017 2:31 pm

Yea, never did get the PARTUUID to work. I don't have direct access to my pi systems right now but here are some of my notes that should get you going. Note that I haven't used the subvol but this should get you started.

You are on the right track with the blkid command. Use the UUID= entry and ignore the rest.

Then, use UUID rather than PARTUUID in the cmdline.txt file. (root=UUID=xxxxxxxxxxxxxxxxx)

Then, use the same UUID in the fstab rather than the device. Make sure to set the fsck entry to zero (like you have done)

That should get you started. If that doesn't work, I'll go get my setup, power it up, and send you the exact configuration.

This should get you going so you can root your system via btrfs.

Bruce

arglebargle
Posts: 9
Joined: Tue May 23, 2017 1:43 am
Location: California

Re: Issues with root=PARTUUID= in cmdline.txt at boot

Thu May 25, 2017 9:30 pm

Yeah, I just tested that again this morning and I'm up and running using root=UUID= syntax. Thanks! I could have sworn I tested that before I switched to PARTUUID but I must've made some other mistake then.

There's some confusing information out there about this as older 3.x kernels refused to boot using UUID= but /did/ work with PARTUUID= (see here: viewtopic.php?p=506852#p506852) which is where I think I got confused.

e: fstab doesn't need to match the syntax in cmdline.txt - you can address drives with UUID, LABEL or PARTUUID without issue once you get to that stage of boot. I'm using root=UUID= in cmdline.txt and LABLE= in fstab without problems.

Code: Select all

root@Tree-Eater:/# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=UUID=b21e0b28-05d1-4518-a4c9-77cacdf83d08 rootfstype=btrfs rootflags=subvol=ROOT elevator=deadline rootwait quiet splash plymouth.ignore-serial-consoles

Code: Select all

root@Tree-Eater:/# cat /etc/fstab
proc                    /proc           proc    defaults          0       0
/dev/mmcblk0p1          /boot           vfat    defaults          0       2

LABEL=external_btrfs    /               btrfs   defaults,space_cache,ssd,noatime,nodiratime,subvol=ROOT         0 0
LABEL=swappy            /swap           ext4    defaults,noatime,nodiratime                                     0 2

# btrfs fs root
LABEL=external_btrfs    /mnt/btrfs      btrfs   defaults,noauto,space_cache,ssd,noatime,nodiratime              0 0
/dev/mmcblk0p2          /mnt/sdroot     ext4    defaults,noatime,nodiratime,noauto                              0 0

# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

User avatar
elkberry
Posts: 167
Joined: Wed Dec 28, 2016 9:21 pm

Re: [Solved] Issues with root=PARTUUID= in cmdline.txt at bo

Sat May 27, 2017 3:42 pm

PARTUUID != UUID

The new Jessie images as of April 2017 finally mount by PARTUUID, which is 32+8 bits, instead of UUID,a which is 128 bits. See also viewtopic.php?p=1161764#p1161764

They work great, especially when you clone images from mSD to USB memory thumb drives. No more hassle with updating the boot and mount configuration, just bootin'.
From ZX81 to Raspberry Pi, but wait ... where's the 7805 gone?

arglebargle
Posts: 9
Joined: Tue May 23, 2017 1:43 am
Location: California

Re: [Solved] Issues with root=PARTUUID= in cmdline.txt at bo

Sun May 28, 2017 2:41 am

elkberry wrote:PARTUUID != UUID

The new Jessie images as of April 2017 finally mount by PARTUUID, which is 32+8 bits, instead of UUID,a which is 128 bits. See also viewtopic.php?p=1161764#p1161764

They work great, especially when you clone images from mSD to USB memory thumb drives. No more hassle with updating the boot and mount configuration, just bootin'.
Shouldn't this also work on a fully updated system running Jessie, or does it require a fresh install?

If you take a look back through my post you'll see that I'm running a fully patched Jessie install, including the most recently available kernel/firmware packages, and referencing root by PARTUUID fails to locate the root partition. I'm using the actual PARTUUID, /not/ the partition UUID, when attempting to boot with root=PARTUUID=be046359-02 in cmdline.txt. That's why I posted, everything /should/ be correct to boot with PARTUUID unless there's something missing or something has gotten weird with this install. All of the details are posted above.

L0cutus
Posts: 4
Joined: Sat Jun 10, 2017 1:22 pm

Re: [Solved] Issues with root=PARTUUID= in cmdline.txt at bo

Sat Jun 10, 2017 1:25 pm

where can i find a tutorial/guide to make my RPi2+3 to boot on btrfs also ?
Any way to have also a more recent version of btrfs-tools ?
Thanks !

pws
Posts: 92
Joined: Mon Apr 11, 2016 4:16 pm

Re: [Solved] Issues with root=PARTUUID= in cmdline.txt at bo

Mon Jun 12, 2017 7:50 pm

Google is your friend. You might also explore "thread hijacking".....
L0cutus wrote:where can i find a tutorial/guide to make my RPi2+3 to boot on btrfs also ?
Any way to have also a more recent version of btrfs-tools ?
Thanks !

Return to “Advanced users”