4 ms·
What a great point. I am so paranoid now about removing USB drives after I accidentally removed one while it was still writing to the drive (which I had no ide
by GigabyteCoin 11y ago
What a great point.
I am so paranoid now about removing USB drives after I accidentally removed one while it was still writing to the drive (which I had no idea because there was no LED on the drive) and it bricked the entire device.
I generally wait until my computer has shutdown completely now before removing any important drives, just to be sure.
- ossreality 11y agolol, push eject, wait a few seconds for the notification, remove device. oh right, you're probably using windows.
- derefr 11y agoGenerally if I'm worried about completing a write, I'll just open a Terminal and type `sync` (with a `&& sudo purge` on OSX), and then, as soon as that returns, yank the drive. I don't even bother to unmount it; what would unmounting add, if the OS can recognize that the device is gone and clean up its mount tables? Is there some filesystem that waits until unmount to recalculate indexes or something? (Okay, sure, the OS could tell me the disk is in use because I've got an overlay filesystem mounted on top of it, and would I kindly wait forever for that to stop being the case. But screw you, OS, I need this USB. Just send the FUSE server or SMB daemon or whatever a SIGPIPE.)
- andrewaylett 11y agoFilesystems often have a 'dirty' flag which is cleared as the very last write when unmounting cleanly, to let the OS know whether the filesystem might need to be checked before mounting it next time. Also, unmounting helps you to be confident that nothing's started doing more IO since you ran sync.
- whyagaindavid 11y agoI use this bash script to a umount with a shortcut key. Using KDE. (bad formatting in hn) #!/bin/bash for i in `ls /media/$USER` do cd /media/$USER umount $i done ls /media/$USER |grep -v cdrom0 |grep -v cdrom> /tmp/disk_status file=/tmp/disk_status if [ ! -s $file ]; then kdialog --passivepopup "Nothing Mounted " 1 else kdialog --passivepopup "Mounted devices: `cat /tmp/disk_status`" 2 fi