- 0
Unmount a Device Without Knowing Where It's Mounted
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Ubuntu 24.04 launched from Canonical with frame pointers set up by default and more
By John Callaham,
- 9 replies
- 2 views
-
Fedora 40 released, main Workstation edition includes GNOME 46
By zikalify,
- fedora
- fedora linux
- (and 4 more)
- 4 replies
- 1 view
-
Forget Ubuntu 24.04 LTS, what you really want to download this month is Fedora Silverblue 40 1 2
By zikalify,
- fedora
- fedora silverblue
- (and 7 more)
- 35 replies
- 5 views
-
- 1 reply
- 4 views
-
Statcounter: Linux increases desktop market share to 4.05% 1 2
By zikalify,
- statcounter
- windows 10
- (and 7 more)
- 34 replies
- 3 views
-
Question
Gerowen
I've written a python script to fill a need at work. We have to wipe hard drives using specific methods and requirements (wiping it multiple times over), and it was easier for me to script it, but I happened upon a question, more for myself. In order for the device to get wiped, it cannot be mounted. So let's say that I tell the script to wipe /dev/sdc , which should kill the whole drive. However, let's say /dev/sdc1 is a partition that is mounted, but there's no way I can predict what it is mounted as. Is it possible to detect where the device is mounted to, if it is, or a way to force unmount it without knowing where it's mounted?
It's too easy for me to just unmount it, but I'm going for modularity here. I want the rest of my guys in the shop to be able to double click the icon, enter the device ID, and let it go, without having to worry about unmounting things manually.
Edit: Here is the source code.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts