Operating System - Linux
1831670 Members
2064 Online
110029 Solutions
New Discussion

Re: RHEL4.2 redhat fdisk -l shows no output

 
Raj Patel_1
Occasional Advisor

RHEL4.2 redhat fdisk -l shows no output

Hi there, i'm having trouble getting any output from fdisk -l. anyone got any ideas ?

/proc/partitions file exists also

details below :

fdisk version : fdisk v2.12a

[root@freddy ~]# uname -a
Linux freddy 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005 i686 i686 i386 GNU/Linux

[root@freddy~]# cat /proc/partitions
major minor #blocks name

104 0 71126640 cciss/c0d0
104 1 1534176 cciss/c0d0p1
104 2 13309852 cciss/c0d0p2
104 3 49496265 cciss/c0d0p3
104 4 1 cciss/c0d0p4
104 5 2618563 cciss/c0d0p5
104 6 2618563 cciss/c0d0p6
104 7 1534176 cciss/c0d0p7
104 16 71126640 cciss/c0d1
104 17 35840983 cciss/c0d1p1

we have other identical servers with same OS version and same fdisk ver, which work fine.

any help appreciated
6 REPLIES 6
Ivan Ferreira
Honored Contributor

Re: RHEL4.2 redhat fdisk -l shows no output

What is the problem with fdisk? Have you tried parted? Sometimes, if the partition type is GPT, fdisk is unable to read the partition.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: RHEL4.2 redhat fdisk -l shows no output

Shalom,

Does sfdisk -l show correct?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Raj Patel_1
Occasional Advisor

Re: RHEL4.2 redhat fdisk -l shows no output

Hi ivan and Steven,

sfdisk -l and parted do work, however the information i'm trying to retrive is the Disk capacity, which in my script does fdisk -l |grep Disk, see below:

[root@scooby~]# fdisk -l |grep Disk
Disk /dev/cciss/c0d0: 72.8 GB, 72833679360 bytes
Disk /dev/cciss/c0d1: 145.6 GB, 145667358720 bytes

Is there any other way to retrieve the Hard Disk capacities ?
Steven E. Protter
Exalted Contributor

Re: RHEL4.2 redhat fdisk -l shows no output

Shalom,

We've shown you the best way.

Other suggestions:
1) Makes sure the bios on the system is up to date.
2) upd2date the system to update 4 or update 5, this looks like an fdisk bug.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stin
Occasional Contributor

Re: RHEL4.2 redhat fdisk -l shows no output

I have a similar problem.
I get no output from fdisk -l

However, if I do:

# fdisk /dev/ida/c0d0

Then 'm' for help (just to be sure)
Then 'p' for print, the output is exactly as I would expect to see from fdisk -l
Then I think it's 'q' to quit without saving changes.

I hope it helps as a workaround but take care using fdisk. Particularly if it is in a production environment.
Steven E. Protter
Exalted Contributor

Re: RHEL4.2 redhat fdisk -l shows no output

Shalom,


whereis fdisk
rpm -ql # to get the parent rpm
rpm -qa | grep fdisk #get the rpm name

rpm -qf fdisk-

See the files and sizes and compare them to a working system
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com