LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-03-2010, 03:48 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
error running "cfdisk" vs. "fdisk"


I can run fdisk without any troubles
Code:
prompt$ sudo fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe11595f6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       15298   122881153+   7  HPFS/NTFS
/dev/sda2           15299       16700    11261565   12  Compaq diagnostics
/dev/sda3           16701       60801   354241282+   5  Extended
/dev/sda5           52516       60801    66557295    7  HPFS/NTFS
/dev/sda6           16701       24602    63472752   83  Linux
/dev/sda7           24603       24845     1951866   83  Linux
/dev/sda8           24846       26061     9767488+  83  Linux
/dev/sda9           44613       52514    63472783+  83  Linux
/dev/sda10          26062       38809   102398278+  83  Linux
/dev/sda11          38810       39307     4000153+  82  Linux swap / Solaris

Partition table entries are not in disk order
prompt$ 
However, I get a fatal error when I try "cfdisk".
Code:
prompt$  sudo cfdisk /dev/sda
FATAL ERROR: Bad logical partition 6: enlarged logical partitions overlap
Press any key to exit cfdisk
prompt$ 
An alternate way of looking at the fdisk report might be:
(I edited the report by hand)
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       15298   122881153+   7  HPFS/NTFS
/dev/sda2           15299       16700    11261565   12  Compaq diagnostics
/dev/sda3           16701       60801   354241282+   5  Extended
/dev/sda6           16701       24602    63472752   83  Linux
/dev/sda7           24603       24845     1951866   83  Linux
/dev/sda8           24846       26061     9767488+  83  Linux

/dev/sda10          26062       38809   102398278+  83  Linux
/dev/sda11          38810       39307     4000153+  82  Linux swap  
 39308 -- 44612 not listed 

/dev/sda9           44613       52514    63472783+  83  Linux Solaris

/dev/sda5           52516       60801    66557295    7  HPFS/NTFS

prompt$ 
The various colors highlight groups of cylinders that were created together, out of order with their respective partitions numbers.
I don't see the problem that cfdisk complains about.

Help, please,
~~~ 0;-Dan

Last edited by SaintDanBert; 10-03-2010 at 03:51 PM.
 
Old 10-04-2010, 07:19 PM   #2
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673

Rep: Reputation: 487Reputation: 487Reputation: 487Reputation: 487Reputation: 487
Code:
/dev/sda3           16701       60801   354241282+   5  Extended
/dev/sda6           16701       24602    63472752   83  Linux
sda3 and sda6 have start cylinders which are the same, in fact, sda6 is within sda3 which, er... you could say is the overlap seen by cfdisk. Maybe fdisk doesn't care as much?

However... I notice that sda9 is tagged as Linux/Solaris. A clue perhaps? Has this disk been partitioned on a Sun box? For reasons best known to Sun, disks partitioned and formatted on their systems have this strange third partition which is effectively "the whole disk" OK, so you've got a Compaq diagnostic partition hidden on the front which infers it belongs in a Compaq box and is not part of "The whole disk"...

Just a thought

Play Bonny!
 
Old 10-04-2010, 07:47 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Soadyheid View Post
Code:
/dev/sda3           16701       60801   354241282+   5  Extended
/dev/sda6           16701       24602    63472752   83  Linux
sda3 and sda6 have start cylinders which are the same, in fact, sda6 is within sda3 which, er... you could say is the overlap seen by cfdisk.
Of course they overlap, because they have to! sda3 is an extended partition which contains of course other logical partitions, in this case all partitions from sda5 to sda11. This is not an error.
Quote:
However... I notice that sda9 is tagged as Linux/Solaris. A clue perhaps? Has this disk been partitioned on a Sun box?
First, it is sda11 that is tagged as Linux swap/Solaris. Second, I think this is normal.

In fact, I don't see any error in this partition table.
Have you tried other partitioning tools like GParted?
 
Old 10-05-2010, 06:50 PM   #4
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673

Rep: Reputation: 487Reputation: 487Reputation: 487Reputation: 487Reputation: 487
Rats! I read SaintDanBert's hand sorted partition list:

Quote:
/dev/sda9 44613 52514 63472783+ 83 Linux Solaris
which may have caused the confusion, I should have noted the partition ID; 83 = Linux, bf = Solaris.

So, is the extended partition normal on X86 systems? I've just checked my system and I don't have one. My Sun Ultra 2 DOES with the disk formatted under Solaris. Could it be that cfdisk doesn't like extended partitions?

Extract from "man cfdisk"
Quote:
cfdisk tries to read the current partition table from the disk
drive. If it is unable to figure out the partition table, an error is
displayed and the program will exit. This might also be caused by
incorrect geometry information, and can be overridden on the command
line. Another way around this problem is with the -z option. This
will ignore the partition table on the disk.
Nope. I couldn't find any references to extended partitions. Any Ideas?

Play Bonny!
 
Old 10-06-2010, 01:09 AM   #5
mothergoose729
Member
 
Registered: Aug 2008
Distribution: Ubuntu x64
Posts: 118

Rep: Reputation: 19
This probably won't be all the helpful, but I used to get a similar error when I tried to use Cfdisk in a gentoo install as well. I ended up being forced to use fdisk instead. If the option is available, using a gparted live CD to cut up your drives instead is much easier.

cheers
 
Old 10-06-2010, 03:52 AM   #6
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
Yes, extended partitions are normal on PC's. It's the only way to get more than 4 partitions on a disk.
There can only be 4 primary partitions on a disk (sdx1-4). One of these primary partitions can be flagged as extended partition.
There can be only 1 partition flagged as extended. The extended partition then can be divided in logical partitions (sdx5-sdx..).
Logical partitions will always start at sdx5 no matter how many primary partitions there are.

For the problems with cfdisk. I suspect that the strange order of logical partitions confuses cfdisk enough, so it will quit rather then hose the disk.
Quote:
If it is unable to figure out the partition table, an error is
displayed and the program will exit.
The only other possible problem I see is with the extended partition flag
5 Extended
instead of the more modern use of
f W95 Ext'd (LBA)

You could try parted to see if that also gives errors.

_________________________
Gerrard
 
1 members found this post helpful.
Old 10-07-2010, 04:17 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by Soadyheid View Post
...
sda3 and sda6 have start cylinders which are the same, in fact, sda6 is within sda3 which, er... you could say is the overlap seen by cfdisk. Maybe fdisk doesn't care as much?
SDA6 is a "logical partition". they must exist inside an "extended partition". SDA3 provides that extended partition. Does this mean that cfdisk cannot display drives with "extended" partitions or is it expecting some other partition type that what is going on here?

Quote:
Originally Posted by Soadyheid View Post
However... I notice that sda9 is tagged as Linux/Solaris. A clue perhaps? Has this disk been partitioned on a Sun box?
That is how "swap space" gets reported. I don't know why.

Quote:
Originally Posted by Soadyheid View Post
...
OK, so you've got a Compaq diagnostic partition hidden on the front which infers it belongs in a Compaq box and is not part of "The whole disk"...
Actually, the partition is loaded by Lenovo rather than Compaq. Yes it is their diags and recovery utils. It must be the second partition on the first drive or else it will not boot. It must be fat32 and is very VERY win-doze oriented.

~~~ 0;-Dan
 
Old 10-07-2010, 04:25 PM   #8
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
CAUTION Olde dog trying new tricks!!

I completely forgot (continuously forget) about parted and gparted in this brave wonderful world of linux.

Code:
prompt$ sudo parted /dev/sda

(parted) print                                                            
Model: ATA ST9320325AS (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  62.9GB  62.9GB  primary   ntfs            boot
 2      62.9GB  69.0GB  6108MB  primary   fat32
 4      69.0GB  257GB   188GB   extended                  lba
 5      69.0GB  132GB   62.9GB  logical   ntfs
 6      132GB   163GB   31.5GB  logical   ext3
 8      163GB   253GB   89.4GB  logical   ext3
 7      253GB   257GB   4296MB  logical   linux-swap(v1)
 3      257GB   320GB   62.9GB  primary   ext4

(parted)
Notice how the partitions are ordered? I suspect it is that situation that confuses cfdisk.

Thanks to all,
~~~ 0;-Dan
 
  


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
Facing error while running "g++ 3.4.4" code in "g++ 4.3.3" Suranjit Ubuntu 2 10-08-2009 11:22 PM
lilo says, "L 01 01 01" and fdisk says, "Unable to seek on /dev/hda1" clausawits Linux - General 3 12-31-2007 09:33 PM
fdisk reports odd "Start "and "End" sectors on single partition eponymous Linux - Software 3 10-01-2007 03:41 PM
error running "make" and "arkollonrc"... Toro Linux - Software 1 04-19-2004 12:24 AM
fdisk returns "unable to find /dev/hda" cfdisk crashes. cirofren Linux - Newbie 2 11-06-2003 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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