Rich Freeman wrote: > On Thu, Jan 2, 2020 at 5:49 AM Dale <[email protected]> wrote: >> lol I didn't think of that and I don't recall anyone else thinking of >> it either. > That is because syncing before unmounting doesn't do anything. Unless > you use --lazy umount blocks until all writes are complete to a > device. The instant it returns as far as the kernel is concerned the > device should be safe to power off. > > If you do a sync first then of course the umount will complete more > quickly, since all writes should already be flushed. > > I have no idea what your device is doing after it is unmounted, but it > doesn't have anything to do with the linux kernel unless some process > is directly accessing the raw device (very unlikely). Maybe the drive > firmware is doing some kind of housekeeping, or maybe the drive has > some kind of vibration in it that just makes it feel like it is doing > something. Or maybe the NSA or Red Army has hacked your firmware and > it is doing who knows what (yes, the NSA bit at least is a thing). In > any case, chances are the drive manufacturer has accounted for sudden > power loss in the design because if they didn't there would be a ton > of complaints, since there is nothing you can do about this sort of > thing assuming the firmware is up to something. > > Out of curiosity, what model drive is it? Is it by chance an SMR / > archive drive? Due to the limitations on how those write data out I > could see them implementing an internal filesystem that journals > incoming data and then writes it back out after the fact. If so then > that might happen even after the kernel thinks it is unmounted. > However, such a drive firmware would probably use a journal that > ensures data is safe even if power is cut mid-operation. The drive > isn't supposed to report that a write is completed until it is > durable. >
This is the drive info: root@fireball / # smartctl -i /dev/sdj smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.19.40-gentoo] (local build) Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Device Model: ST8000AS0003-2HH188 Serial Number: WCT0BQ2Y LU WWN Device Id: 5 000c50 0ac7d172a Firmware Version: 0003 User Capacity: 8,001,563,222,016 bytes [8.00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 5425 rpm Form Factor: 3.5 inches Device is: Not in smartctl database [for details use: -P showall] ATA Version is: ACS-3 T13/2161-D revision 5 SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Thu Jan 2 12:27:14 2020 CST SMART support is: Available - device has SMART capability. SMART support is: Enabled root@fireball / # I recall reading about SMR but can't recall the details of what it is. As far as I know, this is just a basic 8TB drive. I didn't get to fancy since I knew I wouldn't be running it to much. Honestly, for this task most any drive would do. I added the sync command to my little script just as a added measure. It may not matter but at least I know it should be in sync according to the kernel. What the drive does when it gets to it, only the drive knows. I might add, it doesn't always have the same feel. There are times when I unmount the drive and it just sits there. I can tell it is spinning but the heads aren't moving. Most of the time tho, it has this little bumpy feel. It sort of seems random. It's a lot like it feels when I'm doing a backup just not nearly as much. When doing a backup it has that bumpy feel a lot. I can feel it on my keyboard even. Once unmounted, it still does it but a lot less frequent. The drive finished a run of the script while typing the last paragraph. I've typed this paragraph and I have not felt a single bump. It's still mounted even but still no bumpy feel. I just unmounted it and I felt a few bumps but then it went back to idle. Still no bumpy feel and I'm a bit of a slow typer. My biggest confusion, was the files safe? I just felt a small set of bumps. Felt like three or four but back to nothing again. The lights on the enclosure didn't change either. A couple more bumps. It's weird because I can never predict when it will do it. Things get weird sometimes. lol It seems I always run into these weird things too. :/ Dale :-) :-)

