Problem statement:
running as a user 'ls -l /dev/disk/by-id/' results in all disks and partitions being available.
running the same command from a golang executable omits the partitions for all disks except the os disk.
The intention here is an executable that takes a golden image and configures it based on the config files provided in a disk attached to the system.
dmesg shows that the executable is unable to lookup the blockdev for the device
e.g.
This was working correctly up until recently, but a recent OS update seems to have broken it.
Things I've Tried:
This is not an SELinux issue as even disabling it does not fix the issue.
Running as root does not solve the issue
reloading the partition table for the root disk prior to attempting to access it
Current work around:
Manually parsing the symlink of the root disk of the partition i want to mount to, in this case /dev/sdb, and adding the partition number on the end will allow me to mount the partition, despite still creating a similar dmesg error failing to lookup blockdev.
The common advice seems to be to mount based on UUID, but i do not know the disk UUIDs ahead of time as these are virtual disks,.
running as a user 'ls -l /dev/disk/by-id/' results in all disks and partitions being available.
running the same command from a golang executable omits the partitions for all disks except the os disk.
The intention here is an executable that takes a golden image and configures it based on the config files provided in a disk attached to the system.
dmesg shows that the executable is unable to lookup the blockdev for the device
e.g.
Code:
/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part1: Can't lookup blockdev
Things I've Tried:
This is not an SELinux issue as even disabling it does not fix the issue.
Running as root does not solve the issue
reloading the partition table for the root disk prior to attempting to access it
Code:
blockdev --rereadpt /dev/disk/by-id/DISK_ID_HERE
Manually parsing the symlink of the root disk of the partition i want to mount to, in this case /dev/sdb, and adding the partition number on the end will allow me to mount the partition, despite still creating a similar dmesg error failing to lookup blockdev.
The common advice seems to be to mount based on UUID, but i do not know the disk UUIDs ahead of time as these are virtual disks,.