Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3567

Beginners Questions • Trouble accessing all of my disk space.

$
0
0
What on earth would have caused /dev/sdb and /dev/adc to be switched like that?
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).
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
Where 'LABEL=foo' is functionally equivalent to '/dev/disk/by-label/foo'. This of course implies having set filesystem labels, which for ext[2,3,4] would be achieved with 'e2label [device] [label]'.

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'
That's sorted by physical port (mainly because I have boxes with 16+ drives), season to taste with -x... Whatever you do, always check you're targeting the right device before doing anything potentially destructive.


I have had to piece together info from multiple web sites including this forum just to get here and I am a bit frustrated.
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.

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



Viewing all articles
Browse latest Browse all 3567

Trending Articles