formating a filesystem with python

Florian Diesch diesch at spamfence.net
Thu Sep 11 08:14:12 EDT 2008


"Ricardo Tiago" <rtiago at gmail.com> wrote:

> is there a package in python that allows to mount/umount and format
> (to ext3) a filesystem? I know that this is possible by just calling
> the os commands 'mount/umount and mkfs' but this would imply to have
> to change sudoers to run the script as non-root.

On Linux (I guess that"s the target OS as you mentioned ext3) mounting
could be done as non-root using FUSE or HAL (maybe using a frontend
like gio or kio) if the system supports that, or with an appropriate
fstab entry. 

Maybe HAL can configured to do mkfs but that has to be done very
carefully to avoid security problems.

Maybe you could use something like AppArmor, too.

Most likely you get better answers by first asking in a Linux group
how to do this things without root privileges and then come back to
ask how to do it with Python.



   Florian
-- 
<http://www.florian-diesch.de/>
-----------------------------------------------------------------------
**  Hi! I'm a signature virus! Copy me into your signature, please!  **
-----------------------------------------------------------------------



More information about the Python-list mailing list