This came up with the Lexar Jumpdrive that I was attempting to re-partition. According to sources round the net, the partition tables might have been overlapping.
Here is the error in its full context (if you didn’t catch the title):
FATAL ERROR: Bad primary partition 1: Partition ends in the final partial cylinder
The solution is to first blow away all the partitions, write, (reboot is advised if you’re asked to reboot to see changes to the table), then create your new partitions over it.
Update: Just to add some more detail to this process.. This was done entirely in Linux. Since cfdisk (curses fdisk program) bombs out without allowing you to edit your partitions, you’ll need to edit the usb drive’s partitions by using ol’ fdisk.
Its not that bad once you get used to it. Start it as you would with cfdisk (`fdisk /dev/usb_drive`), hit the help menu, get a printout of all the partitions, delete the partitions (using the help menu again), and then write the partition table to the usb drive.
Reboot if it asks. You should be able to re-partition normally after this.
hey pal , thanks really .
i was searching for this .
but my problem is different .
Its in my harddisk .
actually im having a 40gb ide hdd .
i use cfdisk to install slackware , and when i took out cfdisk , it showed an empty 4mb partition in my primary partition , where my windows c drv is avail .
if i make the 4mb into a fat partition , then i get this bad partition error .
though i can install slackware , i couldnt get lilo or grub to work .
so , cant boot into slackware .
lilo returns some #1 error .
Just hit this problem on a usb drive that had been formated as hfs, when i needed to go back to ext3 i had the problem. Thanks for the solution.
Thanks a lot mate, I ran into this today when trying to create a removable drive bootable for my Asus Eee PC. Cheers!
I’m working on my asus eee as well, and this definitely helped. trying to put zeee on it!
You can do the partition killing with cfdisk too, just add -z argument:
% cfdisk -z /dev/…
Hi, just use gparted. It works better than cfdisk. If you need a boot disk/USB with it, just use the Systemrescuecd (Google it, it’s free).
Excuse my response, maybe I am incorrect, however this solution is not a solution if you did not back up all data to begin with. Also if cfdisk did not run because of this you could have easily launchedc fdisk ‘device’ and it would have read the partitions. Also, as stated by one of the replies gparted would have most likely work if a gui interface was needed. Also I believe on modern disks it is perfectly ok to end in one partition and start on another – if my ‘readings’ (articles I have read).
Yes, it is perfectly OK to have partitions in this form, but this post applies to people who encountered a fatal error in their (in my case, cfdisk) partitioner while attempting to re-partition their drive.
There are several other alternatives, like plain `parted`, but if you look again, plain ‘fdisk’ was explained at the top in an addendum, which is not all that much different from the curses-based cfdisk. It is also easy to find, due to it being a part of many installation packages.
With gparted, you will find that some people do not, or cannot install gparted. It is fairly heavyweight, and there are many scenarios where it is not a viable alternative (serial connection, KVM, bad/slow ILO connections, etc).
In any case, all of this is generally ‘overkill’, as someone above usefully commented that the -z flag could be passed to cfdisk to accomplish the zeroing out of partitions.