public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] OT: cleanup after USB backup drive unplugged?
@ 2018-01-11 16:40 Grant Edwards
  2018-01-12  9:58 ` Adam Carter
  0 siblings, 1 reply; 10+ messages in thread
From: Grant Edwards @ 2018-01-11 16:40 UTC (permalink / raw
  To: gentoo-user

[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:

KERNEL=="sd?1",\
 SUBSYSTEMS=="scsi",\
 ENV{ID_SERIAL}=="WD_My_Passport_259F_57584A314143353435594B54-0:0",\
 ACTION=="add",\
 SYMLINK+="passport",\
 RUN+="/bin/mount -text4 -o atime /dev/%k /extbackup"

KERNEL=="sd?1",\
 ACTION=="remove",\
 ENV{ID_SERIAL}=="WD_My_Passport_259F_57584A314143353435594B54-0:0",\
 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
                              gmail.com            are out purchasing PENCIL
                                                   SHARPENERS right NOW??



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-01-12 21:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-11 16:40 [gentoo-user] OT: cleanup after USB backup drive unplugged? Grant Edwards
2018-01-12  9:58 ` Adam Carter
2018-01-12 11:39   ` Mick
2018-01-12 13:28     ` Rich Freeman
2018-01-12 15:39       ` [gentoo-user] " Grant Edwards
2018-01-12 16:42         ` Wols Lists
2018-01-12 16:54           ` Grant Edwards
2018-01-12 21:06           ` Neil Bothwick
2018-01-12 15:59       ` [gentoo-user] " Peter Humphrey
2018-01-12 15:16   ` Anders Thomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox