- 0
Unmount a Device Without Knowing Where It's Mounted
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Linux 6.16-rc1 is out: What's new and what does it mean for your system?
By zikalify,
- linux
- linux 6.16
- (and 3 more)
- 0 replies
- 0 views
-
Linux Mint is finally getting native fingerprint login support
By David Uzondu,
- linux
- linux mint
- (and 5 more)
- 2 replies
- 0 views
-
New Steam Client Beta for Linux fixes sluggish update installations
By David Uzondu,
- 0 replies
- 0 views
-
As Windows 10 support winds down, KDE welcomes "Windows 10 exiles" to Linux 1 2 3
By David Uzondu,
- 68 replies
- 0 views
-
Refined dock and bug fixes land in latest Elementary OS 8 updates
By David Uzondu,
- linux
- linux distros
- (and 2 more)
- 3 replies
- 0 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
https://www.neowin.net/forum/topic/1031843-unmount-a-device-without-knowing-where-its-mounted/Share on other sites
2 answers to this question
Recommended Posts