<div dir="ltr">autofs or udev rules would be your best bet. if you have an removable device in fstab, i'd recommend setting it to noauto and having something else mount it.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 9, 2020 at 1:59 PM AZ Pete via PLUG-discuss <<a href="mailto:plug-discuss@lists.phxlinux.org">plug-discuss@lists.phxlinux.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<font face="Calibri">Hi all,<br>
<br>
I was finally able to do away with an aging Windows machine and
replace it with a Raspberry Pi 4 running Buster. The only purpose
for this server is to backup selected folders and files from other
servers onto two external USB drives for offsite storage. I've
automated the backup process using rsync and a cron job. All is
working well and the backups are happening on schedule.<br>
However, currently I have to manually mount each of the external
drives. This isn't a terribly big issue since the drives are
rotated to offsite storage only once per month. But, if the Pi
gets rebooted, the drives are not being auto-mounted and the
backups will then fail. I've tried putting an entry in /etc/fstab
to auto-mount them at boot, but if they drives are not connected
at boot time, I've found the the Pi doesn't boot (it just seems to
hang). <br>
</font><br>
<font face="Calibri"><font face="Calibri">Here is how I mount the
drives.<br>
mount -t ntfs PARTUUID=c6040663-9321-4d28-91f0-2f3eb35f72b7
/mnt/Ext3TB_Data1/<br>
mount -t ntfs PARTUUID=f88c9c86-e44d-4846-9fbe-305074347e97
/mnt/Ext3TB_Video1/<br>
<br>
</font>How can I "conditionally" mount an external drive based on
if the drive is currently connected? I could write a script that
checks if the particular partition (PARTUUID) is currently
connected but not mounted and put this script in the rc.local
folder to be executed at boot. <br>
Is this the best way? I'm sure that others have encountered this
issue and wanted to know what the "best practices" are on how to
achieve this?<br>
<br>
Any thoughts would be appreciated.<br>
<br>
Thanks,<br>
Peter<br>
<br>
<br>
<br>
<br>
</font>
</div>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="https://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">https://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">James McPhee<br><a href="mailto:jmcphe@gmail.com" target="_blank">jmcphe@gmail.com</a></div>