TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: D.M. PROCIDA
from: ELI THE BEARDED
date: 2018-07-20 06:44:00
subject: Re: More robust drive set

74ffd34e
PID: SoupGate-Win32 v1.05
In comp.sys.raspberry-pi,
D.M. Procida  wrote:
> I have a volume listed in fstab, an external USB hard disk drive:
>
>         /dev/sda2 /media/tm hfsplus force,rw,user,auto 0 0
>
> If the drive is not connected, the Pi won't even boot up.

Two previous posters have mentioned changing "auto" to "noauto". That is
the correct solution. I have two to four volumes mounted at any one
time, but many disks mentioned in my /etc/fstab. All of the ones I don't
want automatically mounted at startup have the "noauto" option.

But no one has mentioned the other issue there for a "robust" fstab:
don't use the drive path. Use a disk label or a UUID. I'm partial
to UUIDs myself:

# misc old harddrives
UUID=53958d65-ca0a-46d7-8964-956b39e026de /5395 ext4 noauto 0 0
UUID=53946765-20ae-4693-bfe0-a546242379d7 /5394 ext4 noauto 0 0
UUID=10afd738-11f1-4707-bc0d-172e7e940fc2 /10af ext4 noauto 0 0
UUID=2bd5733b-93a9-4c65-b282-44cf8cf8fb73 /2bd5 ext4 noauto 0 0
UUID=cc54c725-dd22-4165-9e0c-1baf8f1f4896 /cc54 ext3 noauto 0 0

But the first example in the fstab manpage (at least in my distro) uses
a "LABEL=t-home2" entry. Either way, it specifies a disk in a way that
is independent of the sequentially issued /dev/sd[abcdef...] devices. So
if you plug in a USB thumb drive before your /media/tm (Mac time machine
disk, I'm guessing), you can still mount it.

For me, the easy way to find a UUID is this sequence:

 ls /dev/disk/by-uuid

(Attach new device and wait a few seconds for it to be recognized)

 ls /dev/disk/by-uuid

(Look for what's changed.)

The entries in /dev/disk/by-uuid are symlinks to the ordinary device
files, so if you need to figure out what's a /dev/sda2 versus a
/dev/sda3 you can use "ls -l" instead. Other people use the blkid
program, but that requires root.

Every filesystem has a different style of UUID. The examples above are
all ext2/3/4 style. FAT looks like "UUID=3736-BD70" and NTFS looks like
"UUID=C8F681D7F681C662". Off the top of my head, I don't know what HFS
/ HFSPlus ones look like.

Elijah
------
has a bunch of more memorably named directories for thumbdrives

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.