TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: NY
date: 2018-09-25 12:16:00
subject: How to auto-mount a USB d

I have a hard drive (either spinning or pen drive) which gets auto-mounted
to /media/pi/ (where the PID varies from one drive to another but is
fixed for any given drive). However the /dev/sd1 raw device changes from
sda1 to sdb1 to sdc1 etc if the device gets disconnected and reconnected,
which precludes auto-mounting /dev/sda1 to the path where I want it.

I tried making a symbolic link from the /media/pi/ location to the
mount point that I wanted (doesn't have to be below /mnt), but unfortunately
the software that will be writing to this location (TVheadend PVR software)
doesn't want to write if I specify the symbolic link or even the
/media/pi/ location, even though ownership and chmods are correct. The
same thing happened with bind-mounting. For some bizarre reason, only a
proper mount (mount /dev/sda -t exfat /mnt/recordings) allows the software
to write.

Any suggestions. On Windows, you can be pretty damn certain that once a
device has been plugged in and the relevant "always use this drive letter"
box (or however it is stated) has been ticked, you will always get the drive
on that letter, and so you can refer to it as "D:\" in pathnames. With UNIX
it seems that the /dev/sd1 (the equivalent of the drive letter) is not
fixed.

This is for a Pi that has no other disk-like devices - only keyboard, mouse
and DVB-T TV decoders - so it's not a case of two different disks jockeying
for first position /dev/sda1.

I suppose I *could* write to the SD card instead of an external drive, and
hope that I don't record too much to it before I have chance to move
recordings to the computer where they will live permanently. I'm reluctant
to specify a network share in case the network happens to go down: my
experience with //server/sharename Samba paths is that they are not quite
100% reliable. And the whole point of using the Pi as the recording device
is that is will be the only device that is powered on 24/7, removing the
need to leave another computer on to be the receiving point for
network-shared files.

--- 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™.