partition info in perl without root access

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Tue Nov 30 16:32:01 UTC 2004


Lennart Sorensen wrote:
> 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?

<head slap>

Yes, quite actually! Thank you!

Madison
--
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