# sfdisk -l no worky [SOLVED - ALMOST]

## todw1fd

was trying to dump my partition tables using sfdisk -d /dev/sdX sdX.out and got an error:

```

sniffer root # sfdisk -d /dev/sda sda.out

sfdisk: seek error: wanted 0x0000000000000000, got 0x0000000000000000

 /dev/sda: unrecognized partition table type

No partitions found
```

So tried to list partitions using sfdisk -l and got this collection of errors:

```
login as: root

Password:

Last login: Thu May 19 09:45:43 2005 from is-02.cherrydale.local

sniffer root # sfdisk -l

Disk /dev/hda: 79408 cylinders, 16 heads, 63 sectors/track

sfdisk: seek error: wanted 0x0000000000000000, got 0x0000000000000000

 /dev/hda: unrecognized partition table type

No partitions found

Disk /dev/sda: 17849 cylinders, 255 heads, 63 sectors/track

sfdisk: seek error: wanted 0x0000000000000000, got 0x0000000000000000

 /dev/sda: unrecognized partition table type

No partitions found

Disk /dev/sdb: 2213 cylinders, 255 heads, 63 sectors/track

sfdisk: seek error: wanted 0x0000000000000000, got 0x0000000000000000

 /dev/sdb: unrecognized partition table type

No partitions found

sniffer root #

```

fdisk and cfdisk work fine :

```

sniffer root # cfdisk -P s

Partition Table for /dev/hda

               First       Last

 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag

-- ------- ----------- ----------- ------ ----------- -------------------- ----

   Pri/Log           0       16064      0#      16065 Free Space           None

 2 Primary       16065    80035829      0    80019765 W95 Ext'd (LBA) (0F) None

 5 Logical       16065    80035829     63    80019765 W95 FAT32 (0B)       None

sniffer root # cfdisk -P s /dev/sda

Partition Table for /dev/sda

               First       Last

 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag

-- ------- ----------- ----------- ------ ----------- -------------------- ----

 1 Primary           0      417689     63      417690 Linux (83)           Boot

 2 Primary      417690    75939254      0    75521565 Extended (05)        None

 5 Logical      417690     2522204     63     2104515 Linux swap / So (82) None

 6 Logical     2522205    65448809     63    62926605 Linux (83)           None

 7 Logical    65448810    75939254     63    10490445 Linux (83)           None

   Pri/Log    75939255   286744184      0   210804930 Free Space           None

sniffer root # fdisk -l

Disk /dev/hda: 40.9 GB, 40982151168 bytes

255 heads, 63 sectors/track, 4982 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hda2               2        4982    40009882+   f  W95 Ext'd (LBA)

/dev/hda5               2        4982    40009851    b  W95 FAT32

Disk /dev/sda: 146.8 GB, 146815733760 bytes

255 heads, 63 sectors/track, 17849 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      208813+  83  Linux

/dev/sda2              27        4727    37760782+   5  Extended

/dev/sda5              27         157     1052226   82  Linux swap / Solaris

/dev/sda6             158        4074    31463271   83  Linux

/dev/sda7            4075        4727     5245191   83  Linux

Disk /dev/sdb: 18.2 GB, 18210036736 bytes

255 heads, 63 sectors/track, 2213 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb2   *           2        2213    17767890    5  Extended

/dev/sdb5               2        2213    17767858+  83  Linux

sniffer root #

```

Anyone else having the same problem?  Was using sys-apps/util-linux-2.12i-r1.  Upgraded the package to 2.12p and 2.12q with same errors present.  sfdisk -g works fine

```
sniffer util-linux # sfdisk -g

/dev/hda: 79408 cylinders, 16 heads, 63 sectors/track

/dev/sda: 17849 cylinders, 255 heads, 63 sectors/track

/dev/sdb: 2213 cylinders, 255 heads, 63 sectors/track

sniffer util-linux #

```

Last edited by todw1fd on Sat May 21, 2005 2:30 am; edited 1 time in total

----------

## todw1fd

AFter some searching, appears to be related to gcc 3.4.  Should affect all Jackass project users.  

 *Quote:*   

> Submitted By: Jeremy Utley (jeremy@linuxfromscratch.org)
> 
> Date: 2004-09-13
> 
> Initial Package Version: 2.12b
> ...

 

Any chance of fixing this in the util-linux packages?

----------

## Bob P

can you provide a link to your bug report in bugzilla?

----------

## todw1fd

Here's the link to the Bugzilla post 

https://bugs.gentoo.org/show_bug.cgi?id=79454

Short version...

After many recompiles to test.  It's the -O3 optimization that seems to cause the problem with sfdisk mentioned above.  Backing off to -O2 with all other Jackass optimizations solves the problem.  Sorry, don't know how to get that into the ebuild for just sfdisk as the rest of the util-linux package doesn't seem to care.  This bug affects util-linux 2.12i 2.12p and 2.12q the same way.

----------

