You are not logged in.

#1 2025-07-10 12:26:51

pepper
Member
Registered: 2017-12-09
Posts: 127

Problems to keep external luks hdd mounted after boot

My external disks are correctly decrypted and mounted after boot, but a couple of them unmount approximately 2-3 minutes later. The disks are healthy (S.M.A.R.T. tests pass and they work on other operating systems), so the issue seems to occur only after booting on this machine. Every new reboot the problem is in a different drive.
I did the last update in 2025-05-30 and now in 2025-07-05, around 1 month.
I use xfce, xorg and 6.12.36-1-lts kernel, the following setup has worked for years.. until the last update:

cat /etc/mkinitcpio.conf

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt lvm2 filesystems fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

Errors after boot: sudo journalctl -b -p err

lug 09 23:08:27 mulo kernel: x86/cpu: SGX disabled or unsupported by BIOS.
lug 09 23:08:27 mulo kernel: scsi 2:0:0:1: Failed to get diagnostic page 0x1
lug 09 23:08:27 mulo kernel: scsi 2:0:0:1: Failed to bind enclosure -19
lug 09 23:08:38 mulo systemd[1]: Failed to start Refresh Pacman mirrorlist with Reflector..
lug 09 23:09:06 mulo kernel: Buffer I/O error on dev dm-4, logical block 30965760, lost sync page write
lug 09 23:09:06 mulo kernel: JBD2: I/O error when updating journal superblock for dm-4-8.
lug 09 23:09:06 mulo kernel: Aborting journal on device dm-4-8.
lug 09 23:09:06 mulo kernel: Buffer I/O error on dev dm-4, logical block 30965760, lost sync page write
lug 09 23:09:06 mulo kernel: JBD2: I/O error when updating journal superblock for dm-4-8.
lug 09 23:09:06 mulo kernel: EXT4-fs error (device dm-4): ext4_put_super:1318: comm umount: Couldn't clean up the journal
lug 09 23:09:06 mulo kernel: Buffer I/O error on dev dm-4, logical block 0, lost sync page write
lug 09 23:09:06 mulo kernel: EXT4-fs (dm-4): I/O error while writing superblock
lug 09 23:09:06 mulo kernel: EXT4-fs (dm-4): Remounting filesystem read-only
lug 09 23:09:06 mulo kernel: Buffer I/O error on dev dm-4, logical block 0, lost sync page write
lug 09 23:09:06 mulo kernel: EXT4-fs (dm-4): I/O error while writing superblock
lug 09 23:09:06 mulo systemd-cryptsetup[1760]: device-mapper: remove ioctl on luks-00d46560-89a9-4027-93d5-71fa2c8e247e  failed: Device or resource busy
lug 09 23:09:57 mulo systemd[1]: Timed out waiting for device /dev/disk/by-uuid/6401ad98-a5cf-4ccd-bc97-90d098f9368f.
lug 09 23:09:57 mulo systemd[1]: Timed out waiting for device /dev/disk/by-uuid/a7818834-7865-407a-b44f-53fcb81be83d.
lug 09 23:10:43 mulo systemd-cryptsetup[2012]: device-mapper: remove ioctl on luks-daa95dca-bdba-4e23-ac42-5e9cc33053bc  failed: Device or resource busy
lug 09 23:10:43 mulo kernel: Buffer I/O error on dev dm-3, logical block 0, lost sync page write
lug 09 23:10:43 mulo kernel: EXT4-fs (dm-3): I/O error while writing superblock

Disks: lsblk -o NAME,SIZE,FSTYPE,UUID,MOUNTPOINT
sdb1 and sdc1 are the unmounted disks

NAME                                            SIZE FSTYPE      UUID                                   MOUNTPOINT
sda                                           232,9G                                                    
├─sda1                                          488M vfat        BD2A-C15F                              /boot
└─sda2                                        232,4G crypto_LUKS 0f527340-6ad3-4f76-a081-a398e7c937f1   
  └─encrypted_lvm                             232,4G LVM2_member MagB7d-58iZ-lkDB-S7M8-GS1G-T8t2-8a8mHD 
    └─volgroup_0-lv_root                      232,4G ext4        16b7b8e3-6fac-49d4-9b3c-3c03e2dc3e12   /
sdb                                           238,5G                                                    
└─sdb1                                        238,5G crypto_LUKS 00d46560-89a9-4027-93d5-71fa2c8e247e   
sdc                                           931,5G                                                    
└─sdc1                                        931,5G crypto_LUKS daa95dca-bdba-4e23-ac42-5e9cc33053bc   
sdd                                           931,5G                                                    
└─sdd1                                        931,5G crypto_LUKS c561c919-b617-492a-830c-74ababade132   
  └─luks-c561c919-b617-492a-830c-74ababade132 931,5G ext4        e10ab897-b1af-45c8-bb93-9a85d0561900   /media/main/temp 1TB
sde                                             3,6T                                                    
└─sde1                                          3,6T crypto_LUKS dad2d9f0-d032-4959-a92a-b15945b9867b   
  └─luks-dad2d9f0-d032-4959-a92a-b15945b9867b   3,6T ext4        d405b74f-f22e-4973-86de-a17460f2b1af   /media/main/HD

Mounting: cat /etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/volgroup_0-lv_root
UUID=16b7b8e3-6fac-49d4-9b3c-3c03e2dc3e12	/         	ext4      	rw,relatime	0 1

# /dev/sda1
UUID=BD2A-C15F      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

UUID=e10ab897-b1af-45c8-bb93-9a85d0561900 /media/main/temp\0401TB auto defaults,nosuid,nodev,nofail,x-gvfs-show 0 0
UUID=245c388e-dec5-4ba7-adf9-c4da95835a16 /media/main/musica1TB auto defaults,nosuid,nodev,nofail,x-gvfs-show 0 0
UUID=d405b74f-f22e-4973-86de-a17460f2b1af /media/main/HD auto defaults,nosuid,nodev,nofail,x-gvfs-show 0 0
UUID=a7818834-7865-407a-b44f-53fcb81be83d /media/main/BackupMulo auto defaults,nosuid,nodev,nofail,x-gvfs-show 0 0
UUID=9f40d3cb-e5ce-4877-bf27-e57d966cd4a4 /media/main/Backups auto defaults,nosuid,nodev,nofail,x-gvfs-show 0 0

Luks: cat /etc/crypttab

luks-dad2d9f0-d032-4959-a92a-b15945b9867b UUID=dad2d9f0-d032-4959-a92a-b15945b9867b /etc/luks-keys/luks-dad2d9f0-d032-4959-a92a-b15945b9867b nofail,x-udisks-auth
luks-daa95dca-bdba-4e23-ac42-5e9cc33053bc UUID=daa95dca-bdba-4e23-ac42-5e9cc33053bc /etc/luks-keys/luks-daa95dca-bdba-4e23-ac42-5e9cc33053bc nofail,x-udisks-auth
luks-c561c919-b617-492a-830c-74ababade132 UUID=c561c919-b617-492a-830c-74ababade132 /etc/luks-keys/luks-c561c919-b617-492a-830c-74ababade132 nofail,x-udisks-auth
luks-6401ad98-a5cf-4ccd-bc97-90d098f9368f UUID=6401ad98-a5cf-4ccd-bc97-90d098f9368f /etc/luks-keys/luks-6401ad98-a5cf-4ccd-bc97-90d098f9368f nofail,x-udisks-auth
luks-00d46560-89a9-4027-93d5-71fa2c8e247e UUID=00d46560-89a9-4027-93d5-71fa2c8e247e /etc/luks-keys/luks-00d46560-89a9-4027-93d5-71fa2c8e247e nofail,x-udisks-auth

I waited 10 minutes after boot, I manually mounted them, they worked for some minutes, then the problem comes back and disk are auto-unmounted

The following log is about:
1) I manually mounted the disk because after reboot it was unmounted
2) I successfully read/write to the disk (using file manager), then after 2-3min the disk unmounts, maybe the problem is about the UAS driver?

journalctl -k -b | grep -iE 'sd[b-c]|dm-[34]'

lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] 4096-byte physical blocks
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] Write Protect is off
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] Mode Sense: 43 00 00 00
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] 500118192 512-byte logical blocks: (256 GB/238 GiB)
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] 4096-byte physical blocks
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] Write Protect is off
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] Mode Sense: 53 00 00 08
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] Preferred minimum I/O size 4096 bytes
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
lug 10 13:54:00 mulo kernel:  sdb: sdb1
lug 10 13:54:00 mulo kernel: sd 3:0:0:0: [sdb] Attached SCSI disk
lug 10 13:54:00 mulo kernel:  sdc: sdc1
lug 10 13:54:00 mulo kernel: sd 4:0:0:0: [sdc] Attached SCSI disk
lug 10 13:54:14 mulo kernel: EXT4-fs (dm-4): mounted filesystem e10ab897-b1af-45c8-bb93-9a85d0561900 r/w with ordered data mode. Quota mode: none.
lug 10 13:54:16 mulo kernel: EXT4-fs (dm-3): recovery complete
lug 10 13:54:16 mulo kernel: EXT4-fs (dm-3): mounted filesystem 245c388e-dec5-4ba7-adf9-c4da95835a16 r/w with ordered data mode. Quota mode: none.
lug 10 14:01:00 mulo kernel: sd 3:0:0:0: [sdb] tag#11 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD IN 
lug 10 14:01:00 mulo kernel: sd 3:0:0:0: [sdb] tag#11 CDB: Read(10) 28 00 18 40 dd 08 00 00 08 00
lug 10 14:01:00 mulo kernel: sd 3:0:0:0: [sdb] tag#10 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN 
lug 10 14:01:00 mulo kernel: sd 3:0:0:0: [sdb] tag#10 CDB: Read(10) 28 00 18 40 dd 10 00 00 f8 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#29 uas_eh_abort_handler 0 uas-tag 25 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#29 CDB: Write(10) 2a 00 0e d4 39 28 00 00 38 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#28 uas_eh_abort_handler 0 uas-tag 26 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#28 CDB: Write(10) 2a 00 0e d4 39 60 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#27 uas_eh_abort_handler 0 uas-tag 24 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#27 CDB: Write(10) 2a 00 0e d4 38 f8 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 23 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#26 CDB: Write(10) 2a 00 0e d4 38 c0 00 00 38 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#25 uas_eh_abort_handler 0 uas-tag 22 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#25 CDB: Write(10) 2a 00 0e d4 38 90 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#24 uas_eh_abort_handler 0 uas-tag 21 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#24 CDB: Write(10) 2a 00 0e d4 38 60 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#23 uas_eh_abort_handler 0 uas-tag 20 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#23 CDB: Write(10) 2a 00 0e d4 38 30 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#22 uas_eh_abort_handler 0 uas-tag 19 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#22 CDB: Write(10) 2a 00 0e d4 37 f8 00 00 38 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#21 uas_eh_abort_handler 0 uas-tag 18 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#21 CDB: Write(10) 2a 00 0e d4 37 c8 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#20 uas_eh_abort_handler 0 uas-tag 17 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#20 CDB: Write(10) 2a 00 0e d4 37 a0 00 00 28 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#19 uas_eh_abort_handler 0 uas-tag 16 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#19 CDB: Write(10) 2a 00 0e d4 37 80 00 00 20 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#18 uas_eh_abort_handler 0 uas-tag 15 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#18 CDB: Write(10) 2a 00 0e d4 37 68 00 00 18 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#17 uas_eh_abort_handler 0 uas-tag 14 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#17 CDB: Write(10) 2a 00 0e d4 37 48 00 00 20 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#16 uas_eh_abort_handler 0 uas-tag 13 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#16 CDB: Write(10) 2a 00 0e d4 37 30 00 00 18 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#15 uas_eh_abort_handler 0 uas-tag 12 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#15 CDB: Write(10) 2a 00 0e d4 37 18 00 00 18 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#14 uas_eh_abort_handler 0 uas-tag 11 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#14 CDB: Write(10) 2a 00 0e d4 37 00 00 00 18 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#13 uas_eh_abort_handler 0 uas-tag 10 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#13 CDB: Write(10) 2a 00 0e d4 36 e8 00 00 18 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#12 uas_eh_abort_handler 0 uas-tag 9 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#12 CDB: Write(10) 2a 00 0e d4 36 c8 00 00 20 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#9 uas_eh_abort_handler 0 uas-tag 8 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#9 CDB: Write(10) 2a 00 0e d4 36 a0 00 00 28 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#8 uas_eh_abort_handler 0 uas-tag 7 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#8 CDB: Write(10) 2a 00 0e d4 36 60 00 00 40 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#7 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#7 CDB: Write(10) 2a 00 0e d4 32 00 00 03 f0 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#6 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#6 CDB: Write(10) 2a 00 0e d4 2e 00 00 04 00 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#5 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#5 CDB: Write(10) 2a 00 0e d4 36 18 00 00 48 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#4 uas_eh_abort_handler 0 uas-tag 5 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#4 CDB: Write(10) 2a 00 0e d4 35 f0 00 00 28 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#3 uas_eh_abort_handler 0 uas-tag 27 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#3 CDB: Write(10) 2a 00 0e d4 39 90 00 00 28 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#2 uas_eh_abort_handler 0 uas-tag 30 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#2 CDB: Write(10) 2a 00 0e d4 3a 10 00 00 40 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#1 uas_eh_abort_handler 0 uas-tag 29 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#1 CDB: Write(10) 2a 00 0e d4 39 e0 00 00 30 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#0 uas_eh_abort_handler 0 uas-tag 28 inflight: CMD OUT 
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#0 CDB: Write(10) 2a 00 0e d4 39 b8 00 00 28 00
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#10 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=32s
lug 10 14:01:01 mulo kernel: sd 3:0:0:0: [sdb] tag#10 CDB: Read(10) 28 00 18 40 dd 10 00 00 f8 00
lug 10 14:01:01 mulo kernel: I/O error, dev sdb, sector 406904080 op 0x0:(READ) flags 0x80700 phys_seg 31 prio class 0

Last edited by pepper (2025-07-10 12:30:23)

Offline

Board footer

Powered by FluxBB