FS#56112 - No Disk-Label or UUID under /dev/disk/ if you use mkfs.btrfs

Attached to Project: Release Engineering
Opened by Nicolai Mladenoff (unicks) - Wednesday, 25 October 2017, 12:25 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Saturday, 28 October 2017, 17:17 GMT
Task Type Bug Report
Category ArchISO
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

If you make a Btrfs (BTree-filesystem) with "mkfs.btrfs -L ROOT /dev/sda2", there is no label or UUID under /dev/disk created. (This is not the case, if you use e.g. "mkfs.ext4 -L BOOT /dev/sda1").
Now "genfstab -Lp /mnt >> /mnt/etc/fstab" uses device name "/dev/sda2" instead of "LABEL=ROOT".
After installation and first boot, labels and uuid exits under /dev/disk as expected.

Steps to reproduce:

Boot Arch ISO from Oktober 1st and create a Btrfs (BTree-filesystem) with "mkfs.btrfs -L ROOT /dev/sda2", then look at /dev/disk/by-id or /dev/disk/by-uuid no label or uuid for the Btrfs.
But "blkid /dev/sda2" will show Label and UUID.

My partition layout MS_DOS:

/dev/sda1 - EXT4 LABEL=BOOT
/dev/sda2 - Btrfs LABEL=ROOT
/dev/sda3 - swap LABEL=SWAP

or GPT UEFI:

/dev/sda1 - fat32 ESP LABEL=EFI
/dev/sda2 - Btrfs LABEL=ROOT
/dev/sda3 - swap LABEL=SWAP

This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Saturday, 28 October 2017, 17:17 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Not archiso issue.
Comment by Dave Reisner (falconindy) - Wednesday, 25 October 2017, 14:29 GMT
Works for me. The mechanism here is that creation of the filesystem triggers a "change" uevent, which causes udevadm to reread the block device and update its DB. As part of that, it'll create symlinks in /dev/disk/by-whatever.

If you run 'udevadm monitor' while you run mkfs.btrfs, do you see uevents for the relevant block device of both KERNEL and UDEV variety? What does 'udevadm info /dev/...' show before and after mkfs?
Comment by Nicolai Mladenoff (unicks) - Wednesday, 25 October 2017, 14:42 GMT
This happend in a Virutalbox VM, with and without EFI enabled. I just tried it on my Intel NUC and it did not happen again.

Maybe a Virtualbox Bug?

Host system is Arch Linx, Kernel 4.13.8-1-ARCH, Virtualbox 5.2.0-1.
Comment by Nicolai Mladenoff (unicks) - Wednesday, 25 October 2017, 14:57 GMT
Now I can not reproduce it with Virtualbox, had the issue twice today, as you could see in the screenshot. blkid shows label and uuid but ls /dev/disk/by-label and ls /dev/disk/by-uuid not.
I had the same problem with the Antergos IOS (screenshot), then I tried Arch ISO and same thing. Not sure what changed?
Comment by Nicolai Mladenoff (unicks) - Wednesday, 25 October 2017, 20:30 GMT
The issue is back, just created a new vm in Virtualbox and made a btrfs /dev/sda1 with LABEL=A and there is no label or uuid under /dev/disk.
This time I had udevadm monitor on tty2.
Then on /dev/sda2 with LABEL=B it worked as expected. Very strange?
Screenshots attached.

Loading...