LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-14-2003, 07:33 PM   #1
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Rep: Reputation: 137Reputation: 137
fdisk -l has stopped working


Please tell me I'm not loosing my mind, that fdisk -l (lower case L) should list all the partitions of my hard drives, without me having to add the devices.

I've read man fdisk, searched LQ and Google/Linux, and can't find anyone else having this problem. Something seems to have changed, and I don't know what or how I've done this.

Code:
root@paul:/home/mingdao# fdisk -l
root@paul:/home/mingdao# /sbin/fdisk -l
root@paul:/home/mingdao# fdisk -l /dev/hda /dev/hdb

Disk /dev/hda: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         383     3076416    b  W95 FAT32
/dev/hda2             384        7476    56974522+   f  W95 Ext'd (LBA)
/dev/hda5             384        3571    25607578+   b  W95 FAT32
/dev/hda6            3572        3583       96358+  83  Linux
/dev/hda7            3584        3826     1951866   82  Linux swap
/dev/hda8            3827        3948      979933+  83  Linux
/dev/hda9            3949        6744    22458838+  83  Linux
/dev/hda10           6745        7352     4883728+  83  Linux
/dev/hda11           7353        7476      995998+  83  Linux

Disk /dev/hdb: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1         765     6144831    b  W95 FAT32
/dev/hdb2             766        6353    44885610    f  W95 Ext'd (LBA)
/dev/hdb5             766        2528    14161266   83  Linux
/dev/hdb6            2529        6353    30724281    b  W95 FAT32
root@paul:/home/mingdao#
As you can see, the only return I get is listing the drives. Just to be certain I tried it on my wife and daughter's comp, and it works fine there.
 
Old 12-14-2003, 08:17 PM   #2
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
If you have "cfdisk" installed try:
cfdisk -P s
That should return about the same thing.
 
Old 12-14-2003, 08:23 PM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally posted by 2damncommon
If you have "cfdisk" installed try:
cfdisk -P s
That should return about the same thing.
Thanks, 2damncommon, I do get this ->
Code:
root@paul:/home/mingdao# cfdisk -P s
Partition Table for /dev/hda

               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary           0     6152894     63     6152895 W95 FAT32 (0B)       Boot
 2 Primary     6152895   120101939      0   113949045 W95 Ext'd (LBA) (0F) None
 5 Logical     6152895    57368114     63    51215220 W95 FAT32 (0B)       None
 6 Logical    57368115    57560894     63      192780 Linux (83)           None
 7 Logical    57560895    61464689     63     3903795 Linux swap (82)      None
 8 Logical    61464690    63424619     63     1959930 Linux (83)           None
 9 Logical    63424620   108342359     63    44917740 Linux (83)           None
10 Logical   108342360   118109879     63     9767520 Linux (83)           None
11 Logical   118109880   120101939     63     1992060 Linux (83)           None
root@paul:/home/mingdao#
but it's not the same output (doesn't list device, etc.) as fdisk -l, and I still want fdisk -l to work properly

I'm just getting Slack configured to work and use all the software I need so that I can format c:/q Billy's software off my comps. So, I'd really like to fix whatever I somehow broke.
 
Old 12-15-2003, 08:32 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Original Poster
Rep: Reputation: 137Reputation: 137
bump

surely someone knows why fdisk -l has stopped working, or what I may do to fix it
 
Old 12-15-2003, 08:50 PM   #5
miaviator278
Member
 
Registered: Dec 2003
Location: Al-Diwania, Iraq (deployed)
Distribution: Slackware ONLY
Posts: 237

Rep: Reputation: 30
why exactly is it so needed? and can you simply find a better program with proper arguments to produce the same output? ie "man cfdisk"?

Just Curious


_____________
Slackware - enough said.
 
Old 12-15-2003, 09:04 PM   #6
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally posted by miaviator278
why exactly is it so needed? and can you simply find a better program with proper arguments to produce the same output? ie "man cfdisk"?

Just Curious


_____________
Slackware - enough said.
If a program as basic as fdisk stopped working properly, would you want to know why? Suppose you logged into your user account as miaviator and tomorrow you couldn't. Why not just adduser johndoe and continue? Wouldn't that work just as well?

And there is no other program which works the same as fdisk. I'd like it to work properly. And I don't like reinstalling in *nix, for that's the Windoze mentality. In *nix you should be able to fix things that break, not just get a new one.

 
Old 12-15-2003, 09:25 PM   #7
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
I agree with you there Chinaman.

Also, it is odd that fdisk is doing that to you.

Only thing I can think of is maybe you got some weird alias thing going.
Or, fdisk got modified somehow.

Have you logged out and back in? Or tried rebooting?
Or, something...

Edit: This from the man page:
Code:
  -l     List the partition tables for the  specified  devices  and  then
         exit.   If no devices are given, those mentioned in /proc/parti-
         tions (if that exists) are used.
Maybe your /proc/partitions is hosed, eh?

Last edited by itsjustme; 12-15-2003 at 09:29 PM.
 
Old 12-15-2003, 09:39 PM   #8
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally posted by itsjustme
I agree with you there Chinaman.

Also, it is odd that fdisk is doing that to you.

Only thing I can think of is maybe you got some weird alias thing going.
Or, fdisk got modified somehow.

Have you logged out and back in? Or tried rebooting?
Or, something...

Edit: This from the man page:
Code:
       -l     List the partition tables for the  specified  devices  and  then
              exit.   If no devices are given, those mentioned in /proc/parti-
              tions (if that exists) are used.
Yes, I've had to go into Windoze to finish a newsletter in PageMaker and capture some cassette onto my hard drive. I've been in and out several times. I don't exactly know when it happened, but noticed when I was posting some help to someone and wanted to be certain that fdisk -l produced what I expected. I got your edit in the Preview Reply, so here's that output ->
Code:
mingdao@paul:/proc$ cat partitions
major minor  #blocks  name     rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

   3     0   60051600 ide/host0/bus0/target0/lun0/disc 69070 53665 629657 310520 84260 67387 1150591 229010 -2 23459007 39502611
   3     1    3076416 ide/host0/bus0/target0/lun0/part1 0 0 0 0 0 0 0 0 0 0 0
   3     2          1 ide/host0/bus0/target0/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
   3     5   25607578 ide/host0/bus0/target0/lun0/part5 41318 8873 50191 14670 188 9330 9527 3480 0 13750 18150
   3     6      96358 ide/host0/bus0/target0/lun0/part6 9 0 60 40 29 12 328 50 0 90 90
   3     7    1951866 ide/host0/bus0/target0/lun0/part7 1 0 8 20 0 0 0 0 0 20 20
   3     8     979933 ide/host0/bus0/target0/lun0/part8 19254 11217 243122 92150 66483 33607 801240 195740 0 54030 287890
   3     9   22458838 ide/host0/bus0/target0/lun0/part9 7959 33384 330732 193900 12064 18425 247424 23380 0 43970 217280
   3    10    4883728 ide/host0/bus0/target0/lun0/part10 477 0 3804 8680 1633 1703 26688 2720 0 3320 11400
   3    11     995998 ide/host0/bus0/target0/lun0/part11 44 167 1676 930 3863 4310 65384 3640 0 1910 4570
   3    64   60051600 ide/host0/bus0/target1/lun0/disc 82895 267648 772902 4900950 8327 20775 140069 395850 -2 21114157 1310248
   3    65    6144831 ide/host0/bus0/target1/lun0/part1 8517 0 8517 8000 0 0 0 0 0 8000 8000
   3    66          1 ide/host0/bus0/target1/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
   3    69   14161266 ide/host0/bus0/target1/lun0/part5 39807 20530 482684 171010 7929 7801 126696 392020 0 119160 563030
   3    70   30724281 ide/host0/bus0/target1/lun0/part6 34568 247109 281677 4721910 398 12974 13373 3830 0 2368940 4725740
mingdao@paul:/proc$
I'll have to read that some more. I have 2 identical Maxtor hard drives.

I've been installing quite a bit of stuff, so it could have happened just about anytime.

I did change inittab to runlevel 4 to login and change wm to Flux, but when I did that there were no settings like I'd used, no sound, etc. so I logged off and back into KDE. Back in KDE I checked mail in KMail, and when I selected a message it changed the sender to Unknown and everything else in the message just disappeared! All the body text, receiver, everything! Gone! And before I knew it, I had 9 messages that were from Unknown and that's all. So, I changed inittab back to run level 3 and forgot about that method of trying Flux. I'll do the wmconfig route and work there.

Thanks for your help. I didn't mean to sound rude to the other guy, but I want to fix it instead of replacing it. That way I'll learn and can also help the next guy. Fdisk in Windoze will stop all your Windoze problems, but it's not the best solution, now is it?
 
Old 12-15-2003, 09:53 PM   #9
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
That's a weird /proc/partitions. Well, to my limited experience.

This is from my freshly installed Slackware 9.1 machine:
Code:
root@bslack:~# fdisk -l
 
Disk /dev/hda: 30.7 GB, 30750031872 bytes
255 heads, 63 sectors/track, 3738 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          88      706828+  82  Linux swap
/dev/hda2   *          89         337     2000092+  83  Linux
/dev/hda3             338         586     2000092+  83  Linux
/dev/hda4             587        3738    25318440    5  Extended
/dev/hda5             587        2410    14651248+  83  Linux
/dev/hda6            2411        3738    10667128+  83  Linux

root@bslack:~# cat /proc/partitions
major minor  #blocks  name
 
   3     0   30029328 hda
   3     1     706828 hda1
   3     2    2000092 hda2
   3     3    2000092 hda3
   3     4          1 hda4
   3     5   14651248 hda5
   3     6   10667128 hda6
But, this is from my red hat 8 machine:
Code:
[root@bsl1 root]# cat /proc/partitions
major minor  #blocks  name     rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

   3     0   39088896 hda 31964 34930 533514 342291 25808 34538 486710 3329949 -2 7300261 5806247
   3     1     104391 hda1 31 80 222 255 12 7 38 2392 0 1810 2648
   3     2    6225187 hda2 23 97 306 222 8 4 72 992 0 1212 1214
   3     3   30716280 hda3 31896 34697 532810 341712 25788 34527 486600 3326564 0 285685 3668291
   3     4          1 hda4 0 0 0 0 0 0 0 0 0 0 0
   3     5    2040223 hda5 9 25 104 48 0 0 0 0 0 48 48

Last edited by itsjustme; 12-15-2003 at 09:56 PM.
 
Old 12-15-2003, 10:30 PM   #10
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Original Poster
Rep: Reputation: 137Reputation: 137
I'd read man fdisk and man cfdisk before I posted, so I'd also already looked at cat /proc/partitions. I just looked on the girls' Debian comp and it looks the same as your Slack output.

This is what's so strange to me. Check this out ->
Code:
root@paul:/home/mingdao# fdisk -l
root@paul:/home/mingdao# /sbin/fdisk -l
root@paul:/home/mingdao# fdisk -l /dev/hda

Disk /dev/hda: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         383     3076416    b  W95 FAT32
/dev/hda2             384        7476    56974522+   f  W95 Ext'd (LBA)
/dev/hda5             384        3571    25607578+   b  W95 FAT32
/dev/hda6            3572        3583       96358+  83  Linux
/dev/hda7            3584        3826     1951866   82  Linux swap
/dev/hda8            3827        3948      979933+  83  Linux
/dev/hda9            3949        6744    22458838+  83  Linux
/dev/hda10           6745        7352     4883728+  83  Linux
/dev/hda11           7353        7476      995998+  83  Linux
root@paul:/home/mingdao#
It shouldn't ought to be this way There's no output until you give it the device.

Have you tried fdisk -l on your Red Hat box that has the same cat /proc/partitions output?

Thanks!
 
Old 12-15-2003, 10:40 PM   #11
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
Oh, yeah, sorry... here's the fdisk -l from red hat 8 that goes with that:
Code:
[root@bsl1 root]# fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 4866 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        13    104391   83  Linux
/dev/hda2          4092      4866   6225187+  83  Linux
/dev/hda3            14      3837  30716280   83  Linux
/dev/hda4          3838      4091   2040255    f  Win95 Ext'd (LBA)
/dev/hda5          3838      4091   2040223+  82  Linux swap

Partition table entries are not in disk order
That's a weird last line of the fdisk -l output...

So, anyway, your fdisk is hosed!!

Edit: It must have something to do with this stuff: 'ide/host0/bus0/target0/lun0/disc' in your /proc/partitions.
Maybe somebody else more knowledgable will jump in here and comment.

Last edited by itsjustme; 12-15-2003 at 10:43 PM.
 
Old 12-15-2003, 11:03 PM   #12
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally posted by itsjustme
Edit: It must have something to do with this stuff: 'ide/host0/bus0/target0/lun0/disc' in your /proc/partitions.
Maybe somebody else more knowledgable will jump in here and comment.
Isn't that the same as this line in yours? ->
Code:
   3     0   39088896 hda 31964 34930 533514 342291 25808 34538 486710 3329949 -2 7300261 5806247
Not that the similarities mean my isn't messed up, you understand. Just asking a question. And why does mine output ide/host0/bus0/target0/lun0/disc where yours outputs hda?

Inquiring minds want to know
 
Old 12-16-2003, 06:44 AM   #13
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I only got that out of order message once and did 'fdisk' hit 'x' and then 'f' to 'fix partition order. It seemed to work. ymm definitely v.

As far as the weird host/bus/blah, I think you must be using 'devfs'? At least my /dev directory in Gentoo is all weird. I'm still figuring it out. But I think that's how devfs describes disks and partitions and so on. When I specify 'fdisk -l /dev/hdX' I get the proper 'hda' stuff but when I do 'fdisk -l' I get the devfs descriptions. Sounds like your fdisk just isn't reading the 'devfs' stuff properly. Maybe it doesn't know how to read that /proc/partitions for some reason. No clue whether this is right or not or how to fix it, but it might help narrow down the mystery.
 
Old 12-17-2003, 12:40 AM   #14
Glock Shooter
Member
 
Registered: Jan 2002
Location: Riverside, CA
Distribution: Slackware Convert!!
Posts: 210

Rep: Reputation: 30
why don't you just create an alias?
alias fdisk -l=fdisk -l /dev/hda /dev/hdb
 
Old 12-17-2003, 02:01 AM   #15
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by Chinaman
And why does mine output ide/host0/bus0/target0/lun0/disc where yours outputs hda?
That's because you're using devfs ...


But fdisk -l should still work as described in man,
does work here...

Code:
Disk /dev/ide/host0/bus1/target0/lun0/disc: 255 heads, 63 sectors, 3720 cylinders
Units = cylinders of 16065 * 512 bytes

                                Device Boot    Start       End    Blocks   Id  System
/dev/ide/host0/bus1/target0/lun0/part1             1      3720  29880868+   5  Extended
/dev/ide/host0/bus1/target0/lun0/part5             1        33    265009+  82  Linux swap
/dev/ide/host0/bus1/target0/lun0/part6            34      1308  10241406   83  Linux
/dev/ide/host0/bus1/target0/lun0/part7          1309      3720  19374358+  83  Linux

Disk /dev/ide/host0/bus0/target0/lun0/disc: 255 heads, 63 sectors, 9729 cylinders
Units = cylinders of 16065 * 512 bytes

                                Device Boot    Start       End    Blocks   Id  System
/dev/ide/host0/bus0/target0/lun0/part1   *         8       868   6915951    b  Win95 FAT32
/dev/ide/host0/bus0/target0/lun0/part2             1         7     56196   83  Linux
/dev/ide/host0/bus0/target0/lun0/part3           869      9729  71175982+   5  Extended
/dev/ide/host0/bus0/target0/lun0/part5           869       899    248976   82  Linux swap
/dev/ide/host0/bus0/target0/lun0/part6           900      9729  70926943+  83  Linux

Did you compare the binaries sizes (your machine vs wifes)?


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk is not working LinuxPadawan Linux - Software 3 04-06-2005 06:21 PM
su stopped working bulldogzerofive Linux - Software 5 01-17-2005 02:05 AM
X stopped working sueno Fedora 15 10-02-2004 12:23 PM
fdisk -l has stopped giving output Bruce Hill Slackware 59 09-06-2004 08:14 AM
My X just stopped working??? freeindy Linux - Newbie 4 11-30-2002 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration