fdisk -l

Olt, Joseph jolt at ti.com
Thu Jul 15 14:06:34 UTC 2010


Nitin,

Sudo is the best answer.  If you really want fdisk to run for any user you can change the permissions:

Default permissions:
-bash-3.00$ /sbin/fdisk -l
-bash-3.00$ sudo /sbin/fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17        1974    15727635   83  Linux
/dev/sda3            1975        2235     2096482+  82  Linux swap
/dev/sda4            2236        3263     8257410    5  Extended
/dev/sda5            2236        3263     8257378+  83  Linux

Alter permissions:
-bash-3.00$ sudo chmod 4755 /sbin/fdisk
-bash-3.00$ /sbin/fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17        1974    15727635   83  Linux
/dev/sda3            1975        2235     2096482+  82  Linux swap
/dev/sda4            2236        3263     8257410    5  Extended
/dev/sda5            2236        3263     8257378+  83  Linux

Regards,

Joseph

From: redhat-sysadmin-list-bounces at redhat.com [mailto:redhat-sysadmin-list-bounces at redhat.com] On Behalf Of nitin.gizare at wipro.com
Sent: Thursday, July 15, 2010 5:13 AM
To: redhat-sysadmin-list at redhat.com
Subject: fdisk -l

Hello

I have requirement of using fdisk -l command w/o root.
Please advice how we can do it ?.


Rgds

Nitin



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/redhat-sysadmin-list/attachments/20100715/f48a7f99/attachment.htm>


More information about the redhat-sysadmin-list mailing list