0

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:

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:

root@Tree-Eater:/etc# cat /boot/cmdline.uuid
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?

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


root@Tree-Eater:/etc# lsblk -f
NAME        FSTYPE LABEL          UUID                                 MOUNTPOINT
sda
├─sda2      btrfs  external_btrfs b21e0b28-05d1-4518-a4c9-77cacdf83d08 /mnt/btrfs
└─sda1      ext4   swappy         74ac5717-c894-4d16-97e2-78a07bb219e3 /swap
mmcblk0
├─mmcblk0p2 ext4                  2f840c69-cecb-4b10-87e4-01b9d28c231c /mnt/sdroot
└─mmcblk0p1 vfat   boot           2D2D-CD16                            /boot


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


root@Tree-Eater:/etc# btrfs subvolume show /
/
        Name:                   ROOT
        UUID:                   db80ba63-dc08-bc42-8f65-ce0caee0cae1
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2017-05-22 00:09:26 -0700
        Subvolume ID:           257
        Generation:             4829
        Gen at creation:        6
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Snapshot(s):
                                ROOT-2017-05-23_08:15
  • Try putting the PARTUUID in UPPER CASE – Milliways May 25 '17 at 2:23
  • @Milliways it already is, check out the pasted line from cmdline.uuid above. 2nd code box under "This fails:" – arglebargle May 25 '17 at 2:26
  • No you have be046359-02 – Milliways May 25 '17 at 2:36
  • @Milliways ah, the actual UUID string. Yeah, I'll give that a shot when I get home. – arglebargle May 25 '17 at 3:13
  • @Milliways Still a no-go. The really odd thing here is that when I'm dumped into initrd's busybox shell the drive is there and blkid -o export shows all of the proper ids and labels for everything. – arglebargle May 25 '17 at 4:53
2

Booting with root=PARTUUID= doesn't appear to work at this time with the current kernel/boot image:

root@Tree-Eater:/# uname -a
Linux Tree-Eater 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
root@Tree-Eater:/# date
Thu May 25 14:17:02 PDT 2017

However, using root=UUID= does. So I'm up and running with

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

And program_usb_timeout=1 in /boot/config.txt

Apparently root=PARTUUID= did work with 3.x version kernels as seen here, while root=UUID= failed.

Hopefully this helps someone else!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.