Skip to main content
Topic: udev missing drive data (Read 419 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

udev missing drive data

Recently I had to restore my system from a backup which I unwittingly set up not to delete missing files, but I couldn't test the restore beforehand due to not having a spare drive on hand.  This has caused me no end of problems of course, but I've slowly been working through them.  I'm back to wanting to setup my backup properly this time, but when I went to mount my backup drive, my mount call just gives me:

Code: [Select]
fsconfig system call failed: /dev/sda1/: Can't lookup blockdev.
       dmesg(1) may have more information after failed mount system call.

I go and run lsblk -f and find this:

Code: [Select]
lsblk -f
NAME        FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda                                               
└─sda1                                            
nvme0n1                                           
├─nvme0n1p1                          383.9M    14% /boot
├─nvme0n1p2                          510.7M     0% /boot/efi
├─nvme0n1p3                          148.7G    19% /
├─nvme0n1p4                          839.1G    43% /home
└─nvme0n1p5                                        [SWAP]

Continuing to google things, apparently lsblk fetches this data from udev, so I ran
udevadm info /dev/sda

Code: [Select]
P: /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/host8/target8:0:0/8:0:0:0/block/sda
M: sda
J: b8:0
U: block
T: disk
D: b 8:0
N: sda
L: 0
S: disk/by-path/pci-0000:00:14.0-usbv3-0:4:1.0-scsi-0:0:0:0
S: disk/by-path/pci-0000:00:14.0-usb-0:4:1.0-scsi-0:0:0:0
S: disk/by-diskseq/2
S: disk/by-id/ata-HUS726060ALE611_NAGPT26Y
S: disk/by-id/wwn-0x5000cca242c9e627
S: disk/by-id/usb-PRO_X_Avolusion_000000000001-0:0
Q: 2
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/host8/target8:0:0/8:0:0:0/block/sda
E: DEVNAME=/dev/sda
E: DEVTYPE=disk
E: DISKSEQ=2
E: MAJOR=8
E: MINOR=0
E: SUBSYSTEM=block
E: USEC_INITIALIZED=234383267
E: ID_ATA=1
E: ID_TYPE=disk
E: ID_BUS=ata
E: ID_MODEL=HUS726060ALE611
E: ID_MODEL_ENC=HUS726060ALE611\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_REVISION=APGL0001
E: ID_SERIAL=HUS726060ALE611_NAGPT26Y
E: ID_SERIAL_SHORT=NAGPT26Y
E: ID_ATA_WRITE_CACHE=1
E: ID_ATA_WRITE_CACHE_ENABLED=1
E: ID_ATA_READ_LOOKAHEAD=1
E: ID_ATA_READ_LOOKAHEAD_ENABLED=1
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=66176
E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=65538
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
E: ID_ATA_FEATURE_SET_PUIS=1
E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
E: ID_ATA_FEATURE_SET_APM=1
E: ID_ATA_FEATURE_SET_APM_ENABLED=0
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_ATA_ROTATION_RATE_RPM=7200
E: ID_WWN=0x5000cca242c9e627
E: ID_WWN_WITH_EXTENSION=0x5000cca242c9e627
E: ID_ATA_PERIPHERAL_DEVICE_TYPE=0
E: ID_USB_MODEL=Avolusion
E: ID_USB_MODEL_ENC=Avolusion\x20\x20\x20\x20\x20\x20\x20
E: ID_USB_MODEL_ID=55aa
E: ID_USB_SERIAL=PRO_X_Avolusion_000000000001-0:0
E: ID_USB_SERIAL_SHORT=000000000001
E: ID_USB_VENDOR=PRO_X
E: ID_USB_VENDOR_ENC=PRO\x20X\x20\x20\x20
E: ID_USB_VENDOR_ID=174c
E: ID_USB_REVISION=0
E: ID_USB_TYPE=disk
E: ID_USB_INSTANCE=0:0
E: ID_USB_INTERFACES=:080650:080662:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=uas
E: ID_PATH_WITH_USB_REVISION=pci-0000:00:14.0-usbv3-0:4:1.0-scsi-0:0:0:0
E: ID_PATH=pci-0000:00:14.0-usb-0:4:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_4_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=e1294fc1-315a-4b74-a147-c4890c6df48a
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-path/pci-0000:00:14.0-usbv3-0:4:1.0-scsi-0:0:0:0 /dev/disk/by-path/pci-0000:00:14.0-usb-0:4:1.0-scsi-0:0:0:0 /dev>

and it looks like a bunch of ID data that you would expect to see here both for this drive and my nvme drive are missing.  Unfortunately this is where I've run into a dead end, because all my searches for data of this type being missing have come up empty, and I have basically no clue how udev works, how this data should have gotten here in the first place, or how to go about fixing this.  I'm not even 100% sure this is the same problem that's preventing the drive from mounting, but it seems like a significant issue that I need to fix?

I'm generally pretty clueless and I feel like I'm just wandering around in the dark at this point and thought I'd see if anybody could provide more insight.

I've attached the entire contents of my dmesg call just in case it's useful, let me know if any other debugging info would be helpful.

Re: udev missing drive data

Reply #1
Anybody have any thoughts on where I might be able to research this problem?  Dug around on the arch wiki for a while and tried googling more, but still didn't find anything that looked relevant. 

Re: udev missing drive data

Reply #2
Quote
Recently I had to restore my system from a backup which I unwittingly set up not to delete missing files
How did you set up this backup exactly? Did you use plain rsync, Timeshift or something else?

Also, while your backup drive is inserted, post the output of "sudo lsblk -f" (so that the FSTYPE gets shown)


Re: udev missing drive data

Reply #4
I'm proven to be complete idiot once again.  While the mount error was occurring with sudo, I had no idea lsblk required elevated permissions to fetch that data.  Did it with sudo and the output was as expected:
Code: [Select]
NAME        FSTYPE FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                     
└─sda1      ext4         main-backup a4173449-c9ef-4f17-9db9-5fc2f9b53c14               
nvme0n1                                                                                 
├─nvme0n1p1 ext4         BOOT        40a53e4a-22f6-4f45-9420-0b114932c4b4  383.9M    14% /boot
├─nvme0n1p2 vfat         ESP         FF81-73B3                             510.7M     0% /boot/efi
├─nvme0n1p3 ext4         ROOT        8d735371-aafd-417c-bb63-e0a67aa2aa6a  148.7G    19% /
├─nvme0n1p4 ext4         HOME        5f01c650-879e-47f8-8049-73b436ff7c4b  837.1G    43% /home
└─nvme0n1p5 swap         SWAP        c36dbd98-ffed-4129-a763-7d86672310e0                [SWAP]

Then on top of that, the mount call must have just been erroring because of a trailing slash that I kept adding accidentally, because it just worked fine.

I guess while I've got you guys here though, I can run my backup call past you and hopefully avoid doing anything moronic this time.
Previously I was using:

sudo rsync -aAXv / --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} /mnt/mainbackup/system-backup > ~/backuplog.txt

Which I think editing to:

sudo rsync -aAXv / --delete --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} /mnt/mainbackup/system-backup > ~/backuplog.txt

should be all I need to get things functioning correctly?  Anyway, sorry for wasting people's time, I really appreciate the feedback.

Re: udev missing drive data

Reply #5
Quote
Which I think editing to:

sudo rsync -aAXv / --delete --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} /mnt/mainbackup/system-backup > ~/backuplog.txt
This should work, but I'd also add --delete-excluded and instead of sending the output to a file you can use --log-file (and it would be better to use /home/your_user/backuplog.txt so that it doesn't accidentally get written to root's home directory). Also, I think that it's more common to put the destinations after the options. So, try out something like this:
Code: [Select]
sudo rsync -aAXv --delete --delete-excluded --log-file='/home/your_user/backuplog.txt' --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} / /mnt/mainbackup/system-backup 

Edit: or you can place the log file into /tmp so that it's universally accessible. In this case use --log-file='/tmp/backuplog.txt'

Re: udev missing drive data

Reply #6
Awesome, that's all super helpful feedback.  I'll definitely implement all your suggestions. Thanks again!

Re: udev missing drive data

Reply #7
I've found a way to get this output from lsblk without root. I compiled according to the instructions from Linux From Scratch.
https://www.linuxfromscratch.org/lfs/view/development/chapter08/util-linux.html
https://www.linuxfromscratch.org/lfs/view/development/chapter03/packages.html
They download the sources from kernel.org, and in the archive they get is configure.
I tried the PKGBUILD for Artix, but I just couldn't figure out what meson options were needed to make it link to udev.
But when I compiled accourding to LFS's instructions, after configure [...] and make it hadn't compiled lsblk. It got compiled during make install. So it needs to be installed to $pkgdir even if the package should not be used. Here is some output, and the PKGBUILD I used to compile it. But I didn't install the package, of course, I just copied lsblk to ~/bin, and I have it first in my PATH.

Code: [Select]
[lena]:~
└─$ lddtree ~/bin/lsblk
/home/lena/bin/lsblk (interpreter => /lib64/ld-linux-x86-64.so.2)
    libblkid.so.1 => /usr/lib/libblkid.so.1
    libmount.so.1 => /usr/lib/libmount.so.1
    libsmartcols.so.1 => /usr/lib/libsmartcols.so.1
    libncursesw.so.6 => /usr/lib/libncursesw.so.6
    libudev.so.1 => /usr/lib/libudev.so.1
        libcap.so.2 => /usr/lib/libcap.so.2
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1
    libc.so.6 => /usr/lib/libc.so.6

Code: [Select]
[lena]:~
└─$ lddtree /usr/bin/lsblk
/usr/bin/lsblk (interpreter => /lib64/ld-linux-x86-64.so.2)
    libsmartcols.so.1 => /usr/lib/libsmartcols.so.1
    libblkid.so.1 => /usr/lib/libblkid.so.1
    libmount.so.1 => /usr/lib/libmount.so.1
    libncursesw.so.6 => /usr/lib/libncursesw.so.6
    libc.so.6 => /usr/lib/libc.so.6

Code: [Select]
[lena]:~
└─$ lsblk -f
NAME        FSTYPE FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                     
└─sda1      ext4   1.0   Backup  b432c6e1-c4f3-424f-b333-97b2b7b9009e                          
nvme0n1                                                                                 
├─nvme0n1p1 vfat   FAT32             49D4-4D9D                                          
├─nvme0n1p2 ext4   1.0   Artix       855fa6fa-b780-456a-854e-b76a7a68f152   21,1G    33% /
├─nvme0n1p3 ext4   1.0   Netlux-12.2 8a40ca6b-b5ea-46fb-8fa9-f09d6a3d4ba2               
├─nvme0n1p4 ext4   1.0   Netlux-12.1 7c82bd7b-5da9-472c-b56e-187da92caa83               
├─nvme0n1p5 ext4   1.0   Void        bf6543ea-edab-43b7-a94a-52d4745a32eb               
├─nvme0n1p7 ext4   1.0   Data        0c143aa4-2f57-4280-aa1b-2719451e0661  386,4G    43% /home/lena/Data
└─nvme0n1p8 ext4   1.0   Grub        16d06b9f-7977-4ad1-86be-298d21f275b4  

Code: [Select]
pkgname=util-linux
pkgver=2.40.4
pkgrel=1
arch=('x86_64')
source=(https://www.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.4.tar.xz)
md5sums=(f9cbb1c8315d8ccbeb0ec36d10350304)

build() {
cd "$srcdir/$pkgname-$pkgver"

./configure --bindir=/usr/bin     \
            --libdir=/usr/lib     \
            --runstatedir=/run    \
            --sbindir=/usr/sbin   \
            --disable-chfn-chsh   \
            --disable-login       \
            --disable-nologin     \
            --disable-su          \
            --disable-setpriv     \
            --disable-runuser     \
            --disable-pylibmount  \
            --disable-liblastlog2 \
            --disable-static      \
            --without-python      \
            --without-systemd     \
            --without-systemdsystemunitdir        \
            ADJTIME_PATH=/var/lib/hwclock/adjtime \
            --docdir=/usr/share/doc/util-linux-2.40.4

make
}

package(){
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir" install

install -vdm 755 "$pkgdir/var/lib/hwclock"

}