partition info in perl without root access

Sergey Kuznetsov tlug-9a/WvBvX2Qpg9hUCZPvPmw at public.gmane.org
Tue Nov 30 19:32:10 UTC 2004


Hi Madison,

Check if you can reach /proc/partitions. All needed info is there.

All the Best!
Sergey.

Madison Kelly wrote:

> Hi all,
>
>   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!
>
> 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


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