Other Drive activity following umount(8)

Where there's visible drive activity – for example, the flashing light of a USB flash drive or mobile hard disk drive – for some time after completion of a umount ⋯ command:
  • what are likely explanations for the activity?


Originally, I wondered whether post-umount activity is sometimes completion of pending disk writes (a flush).

Where VFS_UNMOUNT(9) <https://www.freebsd.org/cgi/man.cgi?query=VFS_UNMOUNT&sektion=9&manpath=FreeBSD+13.0-RELEASE> lacks detail, <https://cgit.freebsd.org/src/commit/?id=bbb1e07d65242f6aaab7941c1e61a676eaec37b4> (2020-01-15) is helpful:

… Unlike VFS_SYNC(), the VFS_UNMOUNT() routine can suspend all processes when they request to do a write thus having a finite number of dirty buffers to write that cannot be expanded. There is no need to call VFS_SYNC() before calling VFS_UNMOUNT(), because VFS_UNMOUNT() needs to flush everything again anyway after suspending writes, to catch anything that was dirtied between the VFS_SYNC() and writes being suspended. …

So, if I understand correctly, flushing can not be the explanation.
 
I've seen USB drives flashing even before mounting, have always seen it after mounting.
The answer could be "who is doing the flashing"? Is it FreeBSD saying "flash on, flash off" or is the controller on the physical device in charge of it?
I'm leaning more towards the controller on the device and it being indicative of last activity through that controller, out of control of the device driver.
 
… Is it FreeBSD saying "flash on, flash off" or is the controller on the physical device in charge of it?

I reckon, the physical device in control.

I'm leaning more towards the controller on the device …

I have the same leaning, but I wonder why things flash.

I err on the side of caution (not touching until after flashing ceases), but it would be nice to know what's happening.

With a USB flash drive, maybe a device-controlled trim and if so, is it harmless to pull the plug (of the device) during the trim? And so on.
 
I have not had any issues with pulling USB devices while they were still flashing. Most of the ones I have are FAT-something formatted, I typically mount them by hand, copy stuff to/from them, umount them by hand, get distracted doing work, then "oh I forgot to take that out" minutes later.

The same flashing behavior is seen on Linux and Windows, so it may actually be:
I'm done with the last thing you told me to do, so I'll just sit here blinking my leds at a slow rate to make sure you don't forget about be.
Kind of like the device is Rick-rolling you.
 
… then "oh I forgot to take that out" minutes later. … sit here blinking my leds at a slow rate to make sure you don't forget …

Do you mean, a blinking/flashing light minutes after completion of a umount ⋯ command?
 
Sometimes, yes. That's why I believe it's the on board device controller and really doesn't mean much.

As a test, I just plugged a USB thumb drive in. Have not mounted it (i mount them by hand, no automount) and the LED is slowly flashing.
About a 3-4 sec interval.
 
Back
Top