Symlink to main disk/partition changed, breaking the system

Hi there I’ve come across this weird issue with my system that I noticed in the past few days but has really reared it’s head today.

I noticed a bunch of weird issues like

  • A locked db when running yay when I had not run it previously (just removed lock file, which fixed it)
  • greeter’s not being able to appear due to write protection / can’t find the file
  • other issues similar to the above one where I would get a write protection warning
  • Firefox addons would disable themselves on session close
  • Firefox addons sometimes won’t install

After discovering this I went through a bunch of checks and noticed that the disk with EOS installed on seems to have the wrong address in dolphin (from /dev/dm-0). I confirmed this by seeing that in /dev/mapper I have a symlink to this directory

lrwxrwxrwx  1 root root       7 Aug 23 13:10 luks-14612474-369a-499c-bc93-170257043949 -> ../dm-0

Checking both gparted and kde partition manager I assume it should be pointed at /dev/nvme0n1p2 a BTRFs encrypted partition or the overall disk /dev/nvme0n1. Partition manager reports that the partition is not properly aligned which may be the issue?

Neither program can see dm-0.

Further checks reveal with udisksctl info -b for both directories this info:

/org/freedesktop/UDisks2/block_devices/nvme0n1p2:
  org.freedesktop.UDisks2.Block:
    Configuration:              [('crypttab', {'name': <b'luks-14612474-369a-499c-bc93-170257043949'>, 'device': <b'UUID=14612474-369a-499c-bc93-170257043949'>, 'passphrase-path': <b'/crypto_keyfile.bin'>, 'options': <b'luks'>})]
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1p2
    DeviceNumber:               66306
    Drive:                      '/org/freedesktop/UDisks2/drives/WDS100T1X0E_00AFY0_204540800976'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-WDS100T1X0E-00AFY0_204540800976-part2
    IdLabel:                    
    IdType:                     crypto_LUKS
    IdUUID:                     14612474-369a-499c-bc93-170257043949
    IdUsage:                    crypto
    IdVersion:                  1
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1p2
    ReadOnly:                   false
    Size:                       999151600128
    Symlinks:                   /dev/disk/by-diskseq/4-part2
                                /dev/disk/by-id/nvme-WDS100T1X0E-00AFY0_204540800976-part2
                                /dev/disk/by-id/nvme-WDS100T1X0E-00AFY0_204540800976_1-part2
                                /dev/disk/by-id/nvme-eui.e8238fa6bf530001001b448b49df52b3-part2
                                /dev/disk/by-partlabel/endeavouros
                                /dev/disk/by-partuuid/ab500dce-717b-4cc4-a76b-938d8986c16b
                                /dev/disk/by-path/pci-0000:01:00.0-nvme-1-part/by-partlabel/endeavouros
                                /dev/disk/by-path/pci-0000:01:00.0-nvme-1-part/by-partnum/2
                                /dev/disk/by-path/pci-0000:01:00.0-nvme-1-part/by-partuuid/ab500dce-717b-4cc4-a76b-938d8986c16b
                                /dev/disk/by-path/pci-0000:01:00.0-nvme-1-part/by-uuid/14612474-369a-499c-bc93-170257043949
                                /dev/disk/by-path/pci-0000:01:00.0-nvme-1-part2
                                /dev/disk/by-uuid/14612474-369a-499c-bc93-170257043949
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Encrypted:
    ChildConfiguration:         []
    CleartextDevice:            '/org/freedesktop/UDisks2/block_devices/dm_2d0'
    HintEncryptionType:         
    MetadataSize:               2097152
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               endeavouros
    Number:             2
    Offset:             1050673152
    Size:               999151600128
    Table:              '/org/freedesktop/UDisks2/block_devices/nvme0n1'
    Type:               0fc63daf-8483-4772-8e79-3d69d8477de4
    UUID:               ab500dce-717b-4cc4-a76b-938d8986c16b

org.freedesktop.UDisks2.Block:
    Configuration:              [('fstab', {'fsname': <b'/dev/mapper/luks-14612474-369a-499c-bc93-170257043949'>, 'dir': <b'/'>, 'type': <b'btrfs'>, 'opts': <b'subvol=/@,noatime,compress=zstd'>, 'freq': <0>, 'passno': <0>}), ('fstab', {'fsname': <b'/dev/mapper/luks-14612474-369a-499c-bc93-170257043949'>, 'dir': <b'/home'>, 'type': <b'btrfs'>, 'opts': <b'subvol=/@home,noatime,compress=zstd'>, 'freq': <0>, 'passno': <0>}), ('fstab', {'fsname': <b'/dev/mapper/luks-14612474-369a-499c-bc93-170257043949'>, 'dir': <b'/var/cache'>, 'type': <b'btrfs'>, 'opts': <b'subvol=/@cache,noatime,compress=zstd'>, 'freq': <0>, 'passno': <0>}), ('fstab', {'fsname': <b'/dev/mapper/luks-14612474-369a-499c-bc93-170257043949'>, 'dir': <b'/var/log'>, 'type': <b'btrfs'>, 'opts': <b'subvol=/@log,noatime,compress=zstd'>, 'freq': <0>, 'passno': <0>}), ('fstab', {'fsname': <b'/dev/mapper/luks-14612474-369a-499c-bc93-170257043949'>, 'dir': <b'/swap'>, 'type': <b'btrfs'>, 'opts': <b'subvol=/@swap,noatime'>, 'freq': <0>, 'passno': <0>})]
    CryptoBackingDevice:        '/org/freedesktop/UDisks2/block_devices/nvme0n1p2'
    Device:                     /dev/dm-0
    DeviceNumber:               65024
    Drive:                      '/'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          false
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-dm-name-luks-14612474-369a-499c-bc93-170257043949
    IdLabel:                    endeavouros
    IdType:                     btrfs
    IdUUID:                     475cce52-61f0-42bf-b314-8b1eea602724
    IdUsage:                    filesystem
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mapper/luks-14612474-369a-499c-bc93-170257043949
    ReadOnly:                   false
    Size:                       999149502976
    Symlinks:                   /dev/disk/by-id/dm-name-luks-14612474-369a-499c-bc93-170257043949
                                /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-14612474369a499cbc93170257043949-luks-14612474-369a-499c-bc93-170257043949
                                /dev/disk/by-label/endeavouros
                                /dev/disk/by-uuid/475cce52-61f0-42bf-b314-8b1eea602724
                                /dev/mapper/luks-14612474-369a-499c-bc93-170257043949
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        /
                        /home
                        /swap
                        /var/cache
                        /var/log
    Size:               999149502464

and finally of the last bit of checking I did this block of info:

journalctl -xb | grep nvme
Aug 23 13:04:33 matt-pc kernel: Command line: initrd=\4b06b50af225462680866d6b202fd3b3\6.10.6-arch1-1\initrd nvme_load=YES nowatchdog rw rootflags=subvol=/@ rd.luks.uuid=14612474-369a-499c-bc93-170257043949 root=/dev/mapper/luks-14612474-369a-499c-bc93-170257043949 nvidia-drm.modeset=1 nvidia-drm.fbdev=1 systemd.machine_id=4b06b50af225462680866d6b202fd3b3
Aug 23 13:04:33 matt-pc kernel: Kernel command line: initrd=\4b06b50af225462680866d6b202fd3b3\6.10.6-arch1-1\initrd nvme_load=YES nowatchdog rw rootflags=subvol=/@ rd.luks.uuid=14612474-369a-499c-bc93-170257043949 root=/dev/mapper/luks-14612474-369a-499c-bc93-170257043949 nvidia-drm.modeset=1 nvidia-drm.fbdev=1 systemd.machine_id=4b06b50af225462680866d6b202fd3b3
Aug 23 13:04:33 matt-pc kernel: Unknown kernel command line parameters "nvme_load=YES", will be passed to user space.
Aug 23 13:04:33 matt-pc kernel:     nvme_load=YES
Aug 23 13:04:33 matt-pc dracut-cmdline[260]: Using kernel command line parameters:  rd.driver.pre=btrfs   initrd=\4b06b50af225462680866d6b202fd3b3\6.10.6-arch1-1\initrd nvme_load=YES nowatchdog rw rootflags=subvol=/@ rd.luks.uuid=14612474-369a-499c-bc93-170257043949 root=/dev/mapper/luks-14612474-369a-499c-bc93-170257043949 nvidia-drm.modeset=1 nvidia-drm.fbdev=1 systemd.machine_id=4b06b50af225462680866d6b202fd3b3
Aug 23 13:04:33 matt-pc kernel: nvme nvme0: pci function 0000:01:00.0
Aug 23 13:04:33 matt-pc kernel: nvme nvme0: 16/0/0 default/read/poll queues
Aug 23 13:04:33 matt-pc kernel:  nvme0n1: p1 p2
Aug 23 13:10:03 matt-pc systemd-fsck[6794]: /dev/nvme0n1p1: 18 files, 64165/255496 clusters
Aug 23 13:10:14 matt-pc kernel: block nvme0n1: No UUID available providing old NGUID
Aug 23 13:11:06 matt-pc partitionmanager[9522]: getting temp failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 13:11:06 matt-pc partitionmanager[9522]: getting powered on time failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 13:11:06 matt-pc partitionmanager[9522]: getting power cycles failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 13:11:06 matt-pc partitionmanager[9522]: "Partition ‘/dev/nvme0n1p2’ is not properly aligned (last sector: 1,953,520,064, modulo: 449)."
Aug 23 13:16:18 matt-pc partitionmanager[9522]: getting temp failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 13:16:18 matt-pc partitionmanager[9522]: getting powered on time failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 13:16:18 matt-pc partitionmanager[9522]: getting power cycles failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 13:16:18 matt-pc partitionmanager[9522]: "Partition ‘/dev/nvme0n1p2’ is not properly aligned (last sector: 1,953,520,064, modulo: 449)."
Aug 23 13:18:36 matt-pc sudo[12291]:     root : TTY=pts/2 ; PWD=/home/matt/Programming_Projects/cSharp/GhostMode/Bin/Windows/Debug ; USER=root ; COMMAND=/usr/bin/smartctl -l error /dev/nvme0n1p2
Aug 23 14:16:08 matt-pc sudo[14122]:     root : TTY=pts/2 ; PWD=/home/matt/Programming_Projects/cSharp/GhostMode/Bin/Windows/Debug ; USER=root ; COMMAND=/usr/bin/smartctl -l /dev/nvme0n1p2
Aug 23 14:19:50 matt-pc partitionmanager[14242]: getting temp failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 14:19:50 matt-pc partitionmanager[14242]: getting powered on time failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 14:19:50 matt-pc partitionmanager[14242]: getting power cycles failed for  "/dev/nvme0n1" :  No such file or directory
Aug 23 14:19:50 matt-pc partitionmanager[14242]: "Partition ‘/dev/nvme0n1p2’ is not properly aligned (last sector: 1,953,520,064, modulo: 449)."

I assume I have to fix the misaligned partition and then let the system fix the symlink but I’m not quite sure and don’t want to brick something. I am setting up a live usb and checking my backups are up-to-date just in case but just thought I’d ask here as my google fu failed me regarding finding an answer or even what happened to my system.

Programs for the most part seem to be running ok (steam and one game I tried, spotify which I’m listening to while I type this, firefox mostly see above) still but this is obviously an issue so want to get this fixed.

Many thanks!

Two things:

  • I don’t think that which device is listed in dolphin has any bearing on anything else or indicates a problem. When a device is available in multiple places, dolphin picks one.
  • The device mounted by the system should be the /dev/mapper/* device or something equivalent to it. The raw device /dev/nvme* is your encrypted device and nothing would be able to read that.

I think the issues you are seeing have nothing to do with this.

Thank you for the bit of knowledge. I have had my pc turned off for a bit and came back to it and have not experienced any of the issues I stated above.

So from my understanding of looking at some stackexchange posts and what you’ve said my /dev/dm-0 which /dev/mapper/* is pointing to is just part of what the device mapper does to point to disks. I think I just have to fix the misaligned partitions and I should be fine. Thank you so much for your help!