- 0
Unmount a Device Without Knowing Where It's Mounted
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 2 replies
- 0 views
-
Linus Torvalds releases a pretty ordinary Linux 6.16-rc3
By zikalify,
- linux 6.16-rc3
- linux
- (and 2 more)
- 3 replies
- 0 views
-
- 7 replies
- 0 views
-
KDE Plasma 6.4 launches, bringing better window management, improved KRunner, and more
By David Uzondu,
- kde
- kde plasma 6.4
- (and 3 more)
- 6 replies
- 0 views
-
Download Natural Language Processing with Python (worth $39.99) for free
By Steven P.,
- ebook offer
- sponsored
- (and 2 more)
- 0 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