Kernel names (sd[xy]) are assigned at boot, in the order the devices are detected. They are not guaranteed to be static and shouldn't be used in static configuration (any more, things are more parallelized than they once were).What on earth would have caused /dev/sdb and /dev/adc to be switched like that?
If you need to refer to the same device, path, port, or filesystem across reboots, use UUIDs or the symlinks in /dev/disk/by-[id,label,partuuid,path,uuid].
For systems with a small number of disks, I like to use filesystem labels in fstab, e.g.
Code:
LABEL=boot /boot vfat defaults 0 2LABEL=root / ext4 noatime 0 1LABEL=swap1 none swap sw 0 0LABEL=swap2 none swap sw 0 0LABEL=rust /mnt/rust ext4 noatime 0 2
For quick reference as to what is where and with which name, I use:
Code:
alias diskids='lsblk --tree -o HCTL,MODEL,SERIAL,NAME,LABEL,UUID -x HCTL'
Your system already includes all the relevant manuals. Start with 'man mount' and 'man fstab'. The fstab manual for example quite clearly explains why /dev/sd[xy] names are not reliable and what to do about it.I have had to piece together info from multiple web sites including this forum just to get here and I am a bit frustrated.
Bonus pro-tip: The 'apropos' utility allows you to search available manuals for keywords, use is explained in... you guessed it... 'man apropos'.
RTFM may be a meme at this point, but I really do not understand why everybody seems to go straight to "piecing together" information from random (and often out of date) websites these days, when the canonical documentation is already installed locally.
Statistics: Posted by steve_v — 2024-10-22 04:33 — Replies 7 — Views 254