partition info in perl without root access

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Nov 30 16:26:19 UTC 2004


On Tue, Nov 30, 2004 at 11:08:52AM -0500, Madison Kelly wrote:
>   I am trying to find a way in perl as a regular user to get the same 
> type of information as I get when I run 'fdisk -l' as root. Currently I 
> have put 'fdisk' in my '/etc/sudoers' file and use sudo to get the data. 
> This obviously is not ideal though because 'fdisk' has many potentially 
> dangerous uses than simple partition information gathering.
> 
>   Does anyone know of a way that I can get information like which 
> partitions are online but NOT mounted (probably most important), how 
> much space is used and available on a given partition and so forth? Thanks!

cat /proc/partitions any use?

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list