syg00: Okay, so you're saying the easiest way is to use a shell script to iterate through all partitions and unmount those which are mounted?
pan64: I have a headless system, so there's no pressing "eject" or "safely remove". Additionally, those options will also spindown and unlink the device. This is not desired in my situation, as I'm trying to dismount any partitions and then format the hard disk.
EDIT: I found the one-liner I was looking for:
# umount /dev/sdb?*
I have another question. What is the recommended way to handle disk formatting, filesystem creation and un/mounting partitions in python on a linux system? Shall I simply call the shell scripts, or are there any packages for this purpose. I found python-parted bindings package, which seems to handle part of the stuff, but the documnetation is practically nonexistent.
~dis
Last edited by displace; 09-03-2013 at 11:07 AM.
|