[SOLVED] cfdisk doesn't like the partition layout of my disk
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
cfdisk doesn't like the partition layout of my disk
I have put in a new 500gb disk as my second IDE disk. The partitions were created by Gparted, though to get the disk initially formatted, I connected the disk as an external drive to my netbook and only Win7 would do the honours of recognising it and creating the initial "disk wide" partition.
This seems to be an issue with the external drive adapters I am using, which are of various brands, but basically seem pretty cheap in the worst sense of the word. But that is probably a distraction from the issue.
The disk is now installed in my PC - an old Fujitsu-Siemens Scenic-L with a P4 processor.
The drive works. But I now want to install another 500gb disk as my primary disk. Hence I have a brand new disk which means, using it as a external drive, I can fix the secondary disk so that cfdisk can read it, and then after that is fixed, format the external disk again correctly and install it as my primary disk.
Both disks are IDE, but since Slackware 13.1 are "seen" as scsii disks. I.e in Slackware 13.0 they were "seen" as /dev/hda and /dev/hdb, but now they are "seen" as /dev/sda and /dev/sdb.
The current primary disk is seen ok by cfdisk. Its partions were created by the Ranish Partition Manager and I made sure that all partitions started at the beginning of a cylinder and finished at the end of a cylinder - good old Ranish, which, unfortunately is now no longer maintained and is hence obsolete.
All of the above is probably just a distraction - i.e. just background info, so here goes..
cfdisk says that there is something wrong with my secondary IDE disk, /dev/sdb:
Quote:
cfdisk /dev/sdb
FATAL ERROR: Bad primary partition 1: Partition ends in the final partial cylinder
parted, using:
Code:
sudo /usr/sbin/parted /dev/sdb unit chs print
shows:
Quote:
Model: ATA WDC WD5000AAKB-0 (scsi)
Disk /dev/sdb: 60801,80,62
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 60801,255,63. Each cylinder is 8225kB.
Partition Table: msdos
Number Start End Type File system Flags
1 0,32,32 6374,59,20 primary ext2
2 6374,59,21 60801,80,14 extended
5 6374,91,53 12868,11,6 logical ext2
6 12868,43,39 19242,70,27 logical ext2
7 19242,102,60 25616,129,48 logical ext2
8 25616,162,18 31990,189,6 logical ext2
Question: what is wrong and how can I fix it and avoid it in the future?
I am not sure if this will work but try deleting all the partitions with fdisk. Then create one primary partition for default size with fdisk then go to cfdisk if you wish.
Thanks, Larry. That is indeed the common-sense, practical approach.
All the same, I would still like to know why cfdisk brings that error, when the end of the first partition is, obviously, just before the second, extended partition.
In the man page, it says quite clearly that cfdisk accepts partitions which are not aligned on cylinder boundaries - it even flags them with an asterisk to show that.
I have forgotten one, it appears to me now, important piece of information: I left "space" at the end of the disk. In other words, I have not allocated all of the disk into partitions.
But, surely, it should recognise that for what it is - unallocated space?
I started using cfdisk to format the new disk, then realised that it doesn't give any options for cylinder alignment nor for labelling the partions - which with my set-up I need to avoid confusion.
So, I used gparted, disciplining it to align partitions to cylinders. Ran cfdisk - it's happy now, and parted showed that indeed the partitions are aligned to cylinders.
Quote:
Model: WDC WD50 00AAKB-00H8A0 (scsi)
Disk /dev/sdc: 60801,80,62
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 60801,255,63. Each cylinder is 8225kB.
Partition Table: msdos
Number Start End Type File system Flags
1 0,1,0 6373,254,62 primary ext2
2 6374,0,0 60800,254,62 extended
5 6374,1,0 12747,254,62 logical ext2
6 12748,1,0 19121,254,62 logical ext2
7 19122,1,0 25495,254,62 logical ext2
8 25496,1,0 31869,254,62 logical ext2
Note the end address of the extended partition (2) and compare with previous in the earlier post. It now does not end in the last and only partial cylinder of the disk. I think it was that which cfdisk was complaining about - saying that it was Partition 1 that was in error is a bug - I believe but, of course, I don't know.
Last edited by harryhaller; 03-25-2011 at 02:47 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.