Gentoo Archives: gentoo-user

From: Grant Edwards <grant.b.edwards@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] OT: cleanup after USB backup drive unplugged?
Date: Thu, 11 Jan 2018 16:42:49
Message-Id: p3841j$tfr$
[This has nothing to do specifically with Gentoo.]

What cleanup actions would you have put in a script to be triggered by
udev when a USB or Firewire backup drive has been unplugged?

The external Firewire drive I used for nightly backups died yesterday.

I replaced it with a USB3 drive, so I needed to update the udev rules
that automatically mount it and then "umount" it when it's removed.
Both rules are firing when they should:

 RUN+="/bin/mount -text4 -o atime /dev/%k /extbackup"

 RUN+="/usr/local/bin/myumount /extbackup"

Here's the embarassing part: The /usr/local/bin/myumount script went
missing (backup drive is dead), and I can't recall exactly what it
did.  Obviously, one should never unplug the drive while it's mounted,
but if that _does_ happen, what would one put in myumount to mitigate
the situation.

The only think I can think of is to do a "umount -l".

Grant Edwards               grant.b.edwards        Yow! How many retured
                                  at               bricklayers from FLORIDA
                                are out purchasing PENCIL
                                                   SHARPENERS right NOW??


Subject Author
Re: [gentoo-user] OT: cleanup after USB backup drive unplugged? Adam Carter <adamcarter3@×××××.com>