[Solved] Drive busy error, unable to unmount

Ubuntu 21.04. External USB connected spinning hard drive, 2TB.

See pic. How can I find out why this drive is busy for a long time? (drive light quickly flashing for a long time). What does udisks-error-quark 14 mean? How to find out which app is using the drive?
.

From some quick net searching, the two main suggestions I’m seeing are the terminal commands:

  • iotop - which requires sudo
  • lsof - which returns so much that it will require filtering.

So a suggestion might be the following:
lsof | grep -e “/dev/sda2” -e “shvara2TB”

Note: lsof is listing open files rather than actual activity so this is presuming those two things are coincident.

Btw, Gnome System Monitor does give you the option of sorting its Process view by current disk reads or writes - you may have to right click to select those values for display.

1 Like

Using lsblk you can identify the dev.

Then, you can probably:
sudo sg_start --stop /dev/(fill in this spot)
udisksctl power-off -b /dev/(fill in this spot)

1 Like

@geraldew

iotop command not found. Know the correct spelling?

Wow. lsof spits up a lot of lines. :slight_smile:

lsof | grep -e “/dev/sda2” -e “Ishvara2TB” gives nothing.

“Btw, Gnome System Monitor does give you the option of sorting its Process view by current disk reads or writes - you may have to right click to select those values for display.” IMUIC this gives info on the system drive. I was looking for processes running on the external USB connected drive. Let me know if I missed something.

@madthumbs What is “dev”?

iotop might or might not need to be installed depending on your Linux distro, I’d expect it is in most standard repositories.

lsof was a new one to me but seemed worth suggesting.

As far as I know Gnome System Monitor sums the disk reads/write across all drives. I mainly run my systems from USB drives and it certainly shows those. So my idea for this is for you to see which process is busy reading or writing.

FWIW from some other experiences I can attest that drives can spend amounts of time looking active (light flashing) even though the computer thinks nothing is happening. I found I had acquired a couple of SMR technology drives and they will routinely spend up to 30 seconds rearranging data internally - and put the computer I/O into a halt state for the duration. Maddeningly, every performance test I ran just ignored these delays in their metrics and gave the drives a good score. Lookup SMR vs CMR at your peril.

1 Like

Ahhh. Got it. Thanks. I’ll look for an app that can show process activity on individual drives.

SMR drives are slow for write. Took 42hrs for me to backup 1TB to an external SMR drive. Had to switch to nvme drive.

As it happened, this morning I had cause to edit a large video file, which gave me a chance to observe what Gnome System Monitor was showing for “Disk read” and"Disk write". In this case Linux was run from an internal drive and when the only activity was writing from memory to the external USB drive, the “Disk write” column showed nothing at all. Meanwhile the USB drive’s light indicated activity and Double Commander was showing an increasing file size in the target directory. Clearly, Gnome System Monitor is useless for this kind of inspection. Not really any surprise but a useful reality check nonetheless.

A while ago when looking into “iotop” I did see commentary that monitoring of disk activity is seen as a security risk, which is why it requires sudo for use. It’s possible something related to that might explain the Gnome System Monitor behaviour.

1 Like

Cool. Thanks for the info. I’m a newbie and this info helps me understand the finer points of drive behavior.

It took a bit of time to figure things out but you should be able to edit titles now.

It’s working. Thanks! Cheers,

1 Like