LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-24-2006, 11:26 AM   #1
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Rep: Reputation: 0
fdisk -l produces no output


I have installed Debian 3.1 Sarge on a multiple boot system, multiple disk system (WinXP on hda1, Sarge on hda3 and FC4 on hda7, plus hdb and hdd with some old stuff), and Debian fdisk produces no output from:

Code:
# fdisk -l
Its version is:

Code:
# fdisk -v
fdisk v2.12p
So here comes instead the output from Fedora Core 4:


Code:
# fdisk -v
fdisk v2.12p

#fdisk -l

Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        3824    30716248+   7  HPFS/NTFS
/dev/hda2            3825       11473    61440592+   5  Extended
/dev/hda3           11474       14946    27896872+  83  Linux
/dev/hda5            3825        7648    30716248+   b  W95 FAT32
/dev/hda6            7649        7903     2048256   82  Linux swap / Solaris
/dev/hda7            7904       11473    28675993+  83  Linux

Disk /dev/hdb: 6481 MB, 6481293312 bytes
255 heads, 63 sectors/track, 787 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1         261     2096451    b  W95 FAT32
/dev/hdb2             262         274      104422+   6  FAT16
/dev/hdb3             415         431      136552+  82  Linux swap / Solaris
/dev/hdb4             432         787     2859570   83  Linux

Disk /dev/hdd: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1               1          13      104391    6  FAT16
/dev/hdd2              14          20       56227+  83  Linux
/dev/hdd3   *          21         785     6144862+   c  W95 FAT32 (LBA)
/dev/hdd4             786        2434    13245592+   f  W95 Ext'd (LBA)
/dev/hdd5             786         913     1028128+   b  W95 FAT32
/dev/hdd6             914        1041     1028128+   b  W95 FAT32
/dev/hdd7   *        1042        1679     5124703+   b  W95 FAT32
/dev/hdd8            1680        1712      265041   82  Linux swap / Solaris
/dev/hdd9            1713        2434     5799433+  83  Linux

Disk /dev/sda: 1026 MB, 1026555904 bytes
16 heads, 32 sectors/track, 3916 cylinders
Units = cylinders of 512 * 512 = 262144 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3916     1002480    e  W95 FAT16 (LBA)
Nevertheless, Debian fdisk does produce the correct output for each drive as in:

Code:
# fdisk -l /dev/hda

Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        3824    30716248+   7  HPFS/NTFS
/dev/hda2            3825       11473    61440592+   5  Extended
/dev/hda3           11474       14946    27896872+  83  Linux
/dev/hda5            3825        7648    30716248+   b  W95 FAT32
/dev/hda6            7649        7903     2048256   82  Linux swap / Solaris
/dev/hda7            7904       11473    28675993+  83  Linux
What could be the cause of this problem? How to solve it?

Regards, Alejandro
 
Old 08-24-2006, 01:13 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
From fdisk manpage:
Quote:
-l List the partition tables for the specified devices and then exit. If no devices are given,
those mentioned in /proc/partitions (if that exists) are used.
So I guess you have no /proc/partitions or the file is empty. Perhaps there was an error mounting /proc or something similar. Check the output of
Code:
dmesg
for errors and also take a look at your system's log files (/var/log/messages, /var/log/syslog etc) to see if you find something.

Regards

Last edited by bathory; 08-24-2006 at 01:26 PM.
 
Old 08-24-2006, 01:21 PM   #3
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Rep: Reputation: 30
Try what bathory said to attempt to locate the problem.

Have you tried "fdisk -l" on a drive. For example, does "fdisk -l /dev/hda" output anything? (It should. If it doesnt, I would suspect an issue with fdisk).
 
Old 08-24-2006, 03:12 PM   #4
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by J_K9
Try what bathory said to attempt to locate the problem.
It seems that /proc/partitions is not empty:
Code:
# cat /proc/partitions
major minor  #blocks  name     rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

  22     0    4579040 hdc 0 0 0 0 0 0 0 0 -10 15058530 21213431
  22    64   19551168 ide/host0/bus1/target1/lun0/disc 7 18 56 110 0 0 0 0 -1 15071830 27877842
  22    65     104391 ide/host0/bus1/target1/lun0/part1 0 0 0 0 0 0 0 0 0 0 0
  22    66      56227 ide/host0/bus1/target1/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
  22    67    6144862 ide/host0/bus1/target1/lun0/part3 0 0 0 0 0 0 0 0 0 0 0
  22    68          1 ide/host0/bus1/target1/lun0/part4 0 0 0 0 0 0 0 0 0 0 0
  22    69    1028128 ide/host0/bus1/target1/lun0/part5 0 0 0 0 0 0 0 0 0 0 0
  22    70    1028128 ide/host0/bus1/target1/lun0/part6 0 0 0 0 0 0 0 0 0 0 0
  22    71    5124703 ide/host0/bus1/target1/lun0/part7 0 0 0 0 0 0 0 0 0 0 0
  22    72     265041 ide/host0/bus1/target1/lun0/part8 1 0 8 20 0 0 0 0 0 20 20
  22    73    5799433 ide/host0/bus1/target1/lun0/part9 0 0 0 0 0 0 0 0 0 0 0
   3     0  120060864 ide/host0/bus0/target0/lun0/disc 18129 36753 435605 84510 13116 19933 264861 300720 -215060590 13191012
   3     1   30716248 ide/host0/bus0/target0/lun0/part1 1183 0 9457 730 0 0 0 0 0 730 730
   3     2          1 ide/host0/bus0/target0/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
   3     3   27896872 ide/host0/bus0/target0/lun0/part3 16686 36634 425698 83440 13114 19931 264856 300710 076240 384150
   3     5   30716248 ide/host0/bus0/target0/lun0/part5 250 64 314 230 2 2 5 10 0 240 240
   3     6    2048256 ide/host0/bus0/target0/lun0/part6 1 0 8 10 0 0 0 0 0 10 10
   3     7   28675993 ide/host0/bus0/target0/lun0/part7 0 0 0 0 0 0 0 0 0 0 0
   3    64    6329388 ide/host0/bus0/target1/lun0/disc 3 6 24 40 0 0 0 0 -1 15071900 27877772
   3    65    2096451 ide/host0/bus0/target1/lun0/part1 0 0 0 0 0 0 0 0 0 0 0
   3    66     104422 ide/host0/bus0/target1/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
   3    67     136552 ide/host0/bus0/target1/lun0/part3 1 0 8 10 0 0 0 0 0 10 10
   3    68    2859570 ide/host0/bus0/target1/lun0/part4 0 0 0 0 0 0 0 0 0 0 0
Quote:
Have you tried "fdisk -l" on a drive. For example, does "fdisk -l /dev/hda" output anything? (It should. If it doesnt, I would suspect an issue with fdisk).
The output is in my first message.

Regards, Alejandro
 
Old 08-24-2006, 04:01 PM   #5
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Original Poster
Rep: Reputation: 0
Regarding boot log files, I do not see any error message regarding mounting /proc. What I do see are these error messages:

1. /var/log/user.log

Code:
Aug 24 17:20:40 localhost hal.hotplug[3014]: could not get mountpoint for sysfs
2. /var/log/boot (or executing /etc/init.d/hotplug restart)

Code:
 Starting hotplug subsystem:
   ...
   input    [failed]
Apparently, it implies a problem with /etc/hotplug/input.rc. I do not know whether these error messages could have any relationship with this fdisk problem.



Regards, Alejandro
 
Old 08-25-2006, 11:19 AM   #6
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Original Poster
Rep: Reputation: 0
So, is this a known issue? Should I report it as a bug?

Regards, Alejandro
 
Old 08-26-2006, 10:42 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
So, is this a known issue? Should I report it as a bug?
Dunno but the contents of /proc/partitions are strange. Only hdc has a "normal" name. The other disks/partitions are named like: ide/host0/bus1/target1/lun0/disc etc and there are also the columns (rio rmerge rsect ruse wio wmerge wsect wuse running use aveq) which are not present at least in my 3 linux boxes:
Quote:
major minor #blocks name

3 0 78150744 hda
3 1 78140128 hda1
3 64 195360984 hdb
3 65 48243163 hdb1
3 66 498015 hdb2
3 67 10241437 hdb3
3 68 136375785 hdb4
Perhaps this is due to the sysfs and/or hotplug prob. About sysfs check if /sys exists and if it's mounted:
Code:
mount
cat /etc/fstab
and try to correct that error.
 
Old 08-26-2006, 07:18 PM   #8
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Original Poster
Rep: Reputation: 0
An empty directory /sys was created at Sarge default installation for kernel 2.4.27, and no entry for sysfs was added in /etc/fstab. My understanding was that it is related to the workings of the kernel 2.6, as in Fedora Core 4, whose /etc/fstab has the line:
Code:
/dev/sys        /sys            sysfs   defaults        0       0
Anyway, I have added that line to Sarge /etc/fstab, and got instead the error message in /var/log/boot:
Code:
Sat Aug 26 17:59:15 2006: mount: unknown filesystem type 'sysfs'
So, I wonder whether this line should remain there.

Indeed, Fedora Core 4 /proc/partitions looks quite different to the Debian one and much more like yours:
Code:
# cat /proc/partitions
major minor  #blocks  name

   3     0  120060864 hda
   3     1   30716248 hda1
   3     2          1 hda2
   3     3   27896872 hda3
   3     5   30716248 hda5
   3     6    2048256 hda6
   3     7   28675993 hda7
   3    64    6329388 hdb
   3    65    2096451 hdb1
   3    66     104422 hdb2
   3    67     136552 hdb3
   3    68    2859570 hdb4
  22    64   19551168 hdd
  22    65     104391 hdd1
  22    66      56227 hdd2
  22    67    6144862 hdd3
  22    68          1 hdd4
  22    69    1028128 hdd5
  22    70    1028128 hdd6
  22    71    5124703 hdd7
  22    72     265041 hdd8
  22    73    5799433 hdd9
   8     0    1002496 sda
   8     1    1002480 sda1
In particular, hdc (the CD/DVD drive) does not appear here. I am not familiar with the syntax of /proc/partitions and how it is generated (pointers?). If I understand correctly, there is a problem with the generation of /proc/partitions.

Indeed I have found another thread

http://www.linuxquestions.org/questi...d.php?t=134566

where a similarly looking /proc/partitions file seems to be correlated with fdisk -l producing no output.

There is a statement at the end of that thread:
Quote:
It's the devfs kernel option that kills fdisk. i had had this problem a year ago and found no answer and saw this thread also. devfs completely changes the format of the info in /proc/partitions and fdisk (nor 'probe') can't parse it.
Recompile kernel without devfs support to fix fdisk.
that I do not fully understand (an explanation/pointer on devfs would be welcomed, if relevant here). And I am not sure either whether it applies to my case as I am using the stock kernel 2.4.27-3-686-smp (I have never compiled a kernel, nor I have any intentions to do it).

Anyway, I have identified yet another error message in /var/log/boot that might be related with this fdisk issue:
Code:
Sat Aug 26 17:59:43 2006: Starting automounter: loading autofs4 kernel module, no automount maps defined.
but I do not know yet which is the problem in this case.

Regards, Alejandro

Last edited by jakubi; 08-26-2006 at 08:54 PM.
 
Old 08-28-2006, 08:45 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Sat Aug 26 17:59:15 2006: mount: unknown filesystem type 'sysfs'
sysfs is for the 2.6 kernels which I thought your are using.
Since I don't know much about Debian, I did a little search and it seems that the usage or not of devfs is done through the config of your boot loader. So, since you don't want to recompile your kernel remove the devfs part (devfs=mount) of it to see if it works.
 
Old 08-28-2006, 12:58 PM   #10
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory
remove the devfs part (devfs=mount) of it to see if it works.
As I did not know what devfs is, hence what do you mean by devfs part I have googled "devfs=mount" and found a link to the devfs man page which is absent in this system. So I have looked with aptitude and realized that there is a package named devfsd that is not loaded, and shows this info:

Code:
Daemon for the device file system
This daemon sets up the devfs file system for use. It sets
permissions of devices, and creates compatibility symlinks to the old
names when devices are created by drivers....
Perhaps I should load it. What do you think?

Indeed, there is no "devfs=mount" in the Debian section of /boot/grub/menu.lst (or elsewhere in this file).

Regards, Alejandro

Last edited by jakubi; 08-28-2006 at 01:09 PM.
 
Old 08-29-2006, 03:46 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Try to pass the
Code:
devfs-nomount
in grub to see if that fixes it.
Else install devfsd, but I think it's better to go for a 2.6.x kernel that uses udev and not devfs which is deprecated.

Regards
 
Old 08-31-2006, 01:29 PM   #12
jakubi
LQ Newbie
 
Registered: Jan 2006
Posts: 19

Original Poster
Rep: Reputation: 0
It turns out that this is a known bug reported for the package util-linux over a year ago:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=308975

Quote:
This bug is caused by the combination with fdisk and kernel-2.4.x.
The reason of it is the output format of /proc/partitions....
And it has been also reported elsewhere, eg:

http://lists.debian.org/debian-user-.../msg01444.html


The most important consequence for me is that this issue is not the manifestation of a serious problem, but just a minor inconvenience that, in practical terms, I can solve using the fdisk -l output from Fedora Core 4.

The util-linux package accumulates many bug reports, but I assume that this issue will be addressed.

In any case, it does not justify experimentation with devfs, etc, until at least I have studied this subject and I can understand what is implied by making these changes.

And less it makes sense to to move to kernel 2.6 for a system that works fine.
Indeed, I have already FC4 in case that I need a system with kernel 2.6, but I prefer Debian Sarge with kernel 2.4 (installed by default) where applications run in a much more reliable way. Besides, it may occur that some applications do not run with kernel 2.6, so I need options.

Regards, Alejandro
 
Old 08-06-2010, 01:54 AM   #13
heavenflying
LQ Newbie
 
Registered: Aug 2010
Posts: 1

Rep: Reputation: 1
make sure you have the permission to open the device file.
try sudo fdisk -l
maybe you can use strace to check the system calls relevant with the fdisk -l command
 
1 members found this post helpful.
Old 03-02-2011, 09:50 AM   #14
Airidh
LQ Newbie
 
Registered: Sep 2006
Location: Western Isles of Scotland
Distribution: Fedora 12, Mint
Posts: 10

Rep: Reputation: 0
Thank you. I was reading this thread as I too had no output from fdisk -l, with Ubuntu 10.04.1.

Using sudo gave me the expected output with no problem.

So simple!
 
  


Reply



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
c thread program produces no output kpachopoulos Programming 7 10-14-2005 09:11 PM
less produces no output tvynr Linux - Software 14 06-09-2005 11:06 PM
lirc's mode2 produces no output under Mandrake 10 foxostro Linux - Software 0 10-12-2004 08:20 PM
fdisk -l has stopped giving output Bruce Hill Slackware 59 09-06-2004 08:14 AM
fdisk -l output? hank43 Linux - General 3 03-07-2004 01:59 PM

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

All times are GMT -5. The time now is 06:47 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