Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev try harder to map to original disk number
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 283

PostPosted: Thu Sep 09, 2021 7:09 am    Post subject: udev try harder to map to original disk number Reply with quote

I have a scsi controller where a ssd drive from time to time disappears (probably due to power settings). performing a bus rescan fixes it.
Unfortunately, udev often decides to give it another device number (eg: /dev/sde instead of /dev/sdd). And while there is a UUID in /etc/fstab, the kernel internally still works with device names.
Any idea to make udev try harder to map it to /dev/sdd?
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3310
Location: Rasi, Finland

PostPosted: Thu Sep 09, 2021 11:03 am    Post subject: Reply with quote

I'm not sure this works on SCSI, but I've done something similar but with hotswappable SATA drives on this topic. The rules there match the sata-port on the mb rather than the real drive.
If you want to match the actual drive no matter to which port it is currently attached, you'd probably need to match the serial number of the drive instead.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 283

PostPosted: Thu Sep 09, 2021 2:44 pm    Post subject: Reply with quote

the problem here is: once mounted, linux kernel doesn't care about virtual paths any longer:
/etc/fstab:
Quote:

#log filesystem (logs)
UUID=b87bcfc8-82ef-4d54-a4da-332d46f92139 /var/log f2fs noatime 0 2
#home filesystem
UUID=87c9ed63-c488-4b95-ae57-d42aa96ecca6 /home f2fs noatime 0 2

/proc/mounts:
Quote:

/dev/sdl7 /home f2fs rw,lazytime,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,checkpoint_merge,fsync_mode=posix 0 0
/dev/sdl6 /var/log f2fs rw,lazytime,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix 0 0

so a virtual link (like you tried - nice trick btw!) won't work (I guess)
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3310
Location: Rasi, Finland

PostPosted: Fri Sep 10, 2021 5:51 am    Post subject: Reply with quote

You can force the device name with NAME="sdd" in udev rules. Problem is if some other drive already has that same name. Solution would be to use some name which is certainly free at any moment like NAME="scsi_disk_1"

I refer to this page usually if I have problems with udev.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum