Safely removing a USB flash drive

Some time ago I was experimenting with a bash script to safely remove a USB drive (see: Running a bash script in a program launcher). My plan was to issue a umount command and then provide a message that it was safe to remove the drive.

Update – My experience with the safe-to-remove message in Linux Mint 18.2 (Sonya) was that the message would be displayed even though the red LED on the USB flash drive continued to flash for several seconds. To me, this indicated that there was still disk activity, and it was not safe to remove the drive. As a result, I revisited my plan to develop a bash script to indicate when writing cached data to the USB drive had completed. See: Safely removing a USB drive with a bash script

Because I essentially inserted a pause at the end of the process, this generally worked satisfactorily. However, on occasion, I noticed that the drive’s red light was flashing, indicating that some disk activity was still in progress even though script had completed. So, I abandoned the script and caution remained the watchword.

Safely remove USB drive

Today, I updated Linux Mint to Version 18.2 (Sonya), updated my maintenance log to note the change, and then synchronized my data partition with my backup USB flash drive. Then, when I right-clicked on the USB drive and selected Eject, a message box popped up indicating that the drive could be safely removed. Well done Sonya – that’s perfect!

References:

Running a bash script in a program launcher
https://linuxnorth.wordpress.com/2016/09/22/running-a-bash-script-in-a-program-launcher/

How to upgrade to Linux Mint 18.2
http://blog.linuxmint.com/?p=3306

Advertisements
This entry was posted in Mint and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s