Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] External hard drive and idle activity
Date: Thu, 02 Jan 2020 14:44:18
Message-Id: CAGfcS_mS69ZgRx_-VFCGw3aUX5XSya_uNkgjdjN1tFu45QecBw@mail.gmail.com
In Reply to: Re: [gentoo-user] External hard drive and idle activity by Dale
1 On Thu, Jan 2, 2020 at 5:49 AM Dale <rdalek1967@×××××.com> wrote:
2 >
3 > lol I didn't think of that and I don't recall anyone else thinking of
4 > it either.
5
6 That is because syncing before unmounting doesn't do anything. Unless
7 you use --lazy umount blocks until all writes are complete to a
8 device. The instant it returns as far as the kernel is concerned the
9 device should be safe to power off.
10
11 If you do a sync first then of course the umount will complete more
12 quickly, since all writes should already be flushed.
13
14 I have no idea what your device is doing after it is unmounted, but it
15 doesn't have anything to do with the linux kernel unless some process
16 is directly accessing the raw device (very unlikely). Maybe the drive
17 firmware is doing some kind of housekeeping, or maybe the drive has
18 some kind of vibration in it that just makes it feel like it is doing
19 something. Or maybe the NSA or Red Army has hacked your firmware and
20 it is doing who knows what (yes, the NSA bit at least is a thing). In
21 any case, chances are the drive manufacturer has accounted for sudden
22 power loss in the design because if they didn't there would be a ton
23 of complaints, since there is nothing you can do about this sort of
24 thing assuming the firmware is up to something.
25
26 Out of curiosity, what model drive is it? Is it by chance an SMR /
27 archive drive? Due to the limitations on how those write data out I
28 could see them implementing an internal filesystem that journals
29 incoming data and then writes it back out after the fact. If so then
30 that might happen even after the kernel thinks it is unmounted.
31 However, such a drive firmware would probably use a journal that
32 ensures data is safe even if power is cut mid-operation. The drive
33 isn't supposed to report that a write is completed until it is
34 durable.
35
36 --
37 Rich

Replies

Subject Author
Re: [gentoo-user] External hard drive and idle activity Mick <michaelkintzios@×××××.com>
Re: [gentoo-user] External hard drive and idle activity Dale <rdalek1967@×××××.com>