A Klingon working at a computer is leaning forward with his right hand lightly grasping his chin to view the screen as if in deep thought or curiosity.

Quick Tip for umount

1

Image by David Both via ChatGPT.

Sometimes learning a new thing can be the result of my innate curiosity.

If you’re a frequent reader on Both.org, you probably already know that I’m rather obsessive about backups. I make two backups of every computer on my network each day, one on an internal hard drive and one on an external USB HDD. I just recently added an external USB HDD for a monthly backup.

Early this morning, as I write this, I was checking to verify that all three backups were created and could be properly accessed in case I needed to restore a file, a directory, or an entire filesystem. Verifying that backups can be accessed is a critical part of any backup plan. You do test that, don’t you?

After performing my tests, I needed to unmount the three devices. Being the lazy SysAdmin, I decided I would try unmounting all three with a single command using file globbing, A.K.A, the wildcards * and ?. The umount man pages don’t state whether wildcards will work, but most Linux commands can use wildcards. So I tried it.

# umount /media/*

This worked perfectly and unmounted all three hard drives.

Note that I also tried the mount command, but that does not work with file globbing.

Leave a Reply