WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: /dev/disk/by-label not populated  (Read 3267 times)

Offline caracalla

  • Newbie
  • *
  • Posts: 21
/dev/disk/by-label not populated
« on: July 03, 2018, 03:42:10 AM »
I am running Tiny Core Linux 64 bit variant with the following Extlinux bootloader configuration

Code: [Select]
DEFAULT menu.c32
PROMPT 0

NOESCAPE 1
NOCOMPLETE 1
ALLOWOPTIONS 0

LABEL nicehash-os
    KERNEL /boot/vmlinuz64
    INITRD /boot/corepure64.gz
    APPEND loglevel=3 waitusb=10:LABEL=SYSTEM home=LABEL=SYSTEM tce=LABEL=SYSTEM opt=LABEL=SYSTEM

What I've just noticed is that there are missing entries in the /dev/disk for by-label and by-uuid, while entry for by-path is there.

Code: [Select]
$ ls -al /dev/disk/
total 0
drwxr-xr-x  3 root root    60 Jul  3 12:16 ./
drwxrwxr-x 16 root staff 6800 Jul  3 12:16 ../
drwxr-xr-x  2 root root   200 Jul  3 12:16 by-path/


Info available on the internet suggest that there is a udev rule in /etc/udev/rules.d/60-persistent-storage.rules that should take care of populating these entries and for some reason this is not working for me.

Code: [Select]
$ cat /etc/udev/rules.d/60-persistent-storage.rules
# do not edit this file, it will be overwritten on update

# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path}
# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>

# forward scsi device event to corresponding block device
ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"

ACTION=="remove", GOTO="persistent_storage_end"

# enable in-kernel media-presence polling
ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000"

SUBSYSTEM!="block", GOTO="persistent_storage_end"

# skip rules for inappropriate block devices
KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end"

# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"

# for partitions import parent information
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"

# virtio-blk
KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"

# by-path (parent device path)
ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"

# skip unpartitioned removable media devices from drivers which do not send "change" events
ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"

# watch metadata changes by tools closing the device after writing
KERNEL!="sr*", OPTIONS+="watch"

# by-label/by-uuid links (filesystem metadata)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"

# by-id (World Wide Name)
ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}"
ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n"

# by-partlabel/by-partuuid links (partition metadata)
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"

LABEL="persistent_storage_end"

I am far from being an expert on udev rules and to be able to identify what might be wrong here. Could it be that I am missing some extension package for this to work?

At the moment these extensions are loaded on boot

Code: [Select]
$ cat /mnt/sda1/tce/onboot.lst
pciutils.tcz
usb-utils.tcz
libX11.tcz
libXext.tcz
wireless-4.14.10-tinycore64
wl-modules-4.14.10-tinycore64.tcz
ndiswrapper-modules-4.14.10-tinycore64.tcz
ndiswrapper.tcz
openssh.tcz
ncurses-terminfo.tcz
wifi.tcz


Please help me out here if you can. Thanks!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: /dev/disk/by-label not populated
« Reply #1 on: July 03, 2018, 04:08:40 AM »
I’m away from a tc machine, but there’s an extension called udev-extras or similar you could try.

Offline caracalla

  • Newbie
  • *
  • Posts: 21
Re: /dev/disk/by-label not populated
« Reply #2 on: July 03, 2018, 04:58:54 AM »
Adding this extension to the stack really did help. From the extension content I can see that there are some udev rules and libraries being owervritten/added to the system.

Code: [Select]
$ cat udev-extra.tcz.list
/etc/udev/udev.conf
/lib/udev/accelerometer
/lib/udev/ata_id
/lib/udev/cdrom_id
/lib/udev/collect
/lib/udev/firmware
/lib/udev/mtd_probe
/lib/udev/pci-db
/lib/udev/rule_generator.functions
/lib/udev/rules.d/60-cdrom_id.rules
/lib/udev/rules.d/60-persistent-storage.rules
/lib/udev/rules.d/60-persistent-v4l.rules
/lib/udev/rules.d/61-accelerometer.rules
/lib/udev/rules.d/75-cd-aliases-generator.rules
/lib/udev/rules.d/75-net-description.rules
/lib/udev/rules.d/75-persistent-net-generator.rules
/lib/udev/rules.d/75-probe_mtd.rules
/lib/udev/rules.d/75-tty-description.rules
/lib/udev/rules.d/78-sound-card.rules
/lib/udev/scsi_id
/lib/udev/usb-db
/lib/udev/v4l_id
/lib/udev/write_cd_rules
/lib/udev/write_net_rules
/usr/local/etc/udev-extra.conf
/usr/local/tce.installed/udev-extra

Among other /etc/udev/rules.d/60-persistent-storage.rules is updated as well. Maybe udev rules that come with the corepure64.gz should be updated to reflect the ones from the udev-exstra package.

Thank you for your help!

Offline hiro

  • Hero Member
  • *****
  • Posts: 1217
Re: /dev/disk/by-label not populated
« Reply #3 on: July 03, 2018, 10:46:53 AM »
I'd be curious, too what this is about. I wasn't aware of udev-extra till today :)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: /dev/disk/by-label not populated
« Reply #4 on: July 03, 2018, 10:59:55 AM »
It's a space-saving measure mainly. Not many apps require the results of those rules/helper programs, and so they're in an extension instead of base.
The only barriers that can stop you are the ones you create yourself.