Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] OT: cleanup after USB backup drive unplugged?
Date: Fri, 12 Jan 2018 11:39:18
Message-Id: 2816840.ivPOrxIB2h@dell_xps
In Reply to: Re: [gentoo-user] OT: cleanup after USB backup drive unplugged? by Adam Carter
1 On Friday, 12 January 2018 09:58:17 GMT Adam Carter wrote:
2 > > I replaced it with a USB3 drive, so I needed to update the udev rules
3 > > that automatically mount it and then "umount" it when it's removed.
4 >
5 > Pretty sure you'd risk filesystem corruption by not umounting before you
6 > remove the device. Did it used for force an fsck on each mount because the
7 > filesystem was "dirty"? If not, i have a fundamental misunderstanding of
8 > how this stuff works.
9
10 Yes, the sequence ought to be:
11
12 sync && umount /dev/<device> || eject /dev/<device>
13
14 I don't recall if eject includes the previous steps and therefore it is
15 superfluous.
16
17 I find some applications are reluctant to let go of filesystems on pluggable
18 devices and umount can fail. In this case --lazy option of umount should
19 work:
20
21 umount -l /dev/<device>
22
23 --
24 Regards,
25 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] OT: cleanup after USB backup drive unplugged? Rich Freeman <rich0@g.o>