multi-boot cfdisk warning: is it broke? How do I fix?

July 20th, 2011 - 02:10 pm ET by Charles Blair | Report spam
I tried to set up a dual boot of windows and linux from
the installer. The linux part works, but windows 7 starts to boot
and then takes me back to grub.

I am sufficiently happy with linux that I was planning to get
rid of windows. I would like to use the space to give openBSD a
try.

As a first step, I tried using cfdisk -Ps /dev/sda, and got the
ominous warning:

FATAL ERROR: Bad primary partition 2: Partition ends in the final partial cylinder

Since linux is working, I'm worried that trying to fix whatever this
problem is might wreck my system.

fdisk -l /dev/sda gives:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbb0c5abb

Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 192 12349 97656250 7 HPFS/NTFS
/dev/sda3 37264 38914 13248512 17 Hidden HPFS/NTFS
/dev/sda4 12350 37264 200128513 5 Extended
/dev/sda5 * 12350 12392 340992 83 Linux
/dev/sda6 12392 13486 8787968 83 Linux
/dev/sda7 13486 13851 2928640 83 Linux
/dev/sda8 13851 14826 7827456 82 Linux swap / Solaris
/dev/sda9 14826 14874 389120 83 Linux
/dev/sda10 14874 37264 179849216 83 Linux

Partition table entries are not in disk order

************** copy of my grub.cfg file *******************

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set a5ae78d6-949a-4462-bc98-6c53a846c401
if loadfont /share/grub/unicode.pf2 ; then
set gfxmoded0x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set d487742e-ad50-4347-8d9a-b8d0f1908c13
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set a5ae78d6-949a-4462-bc98-6c53a846c401
insmod png
if background_image /share/images/desktop-base/spacefun-grub.png; then
set color_normal=light-gray/black
set color_highlight=white/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set d487742e-ad50-4347-8d9a-b8d0f1908c13
echo 'Loading Linux 2.6.32-5-amd64 ...'
linux /boot/vmlinuz-2.6.32-5-amd64 root=UUID=d487742e-ad50-4347-8d9a-b8d0f1908c13 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set d487742e-ad50-4347-8d9a-b8d0f1908c13
echo 'Loading Linux 2.6.32-5-amd64 ...'
linux /boot/vmlinuz-2.6.32-5-amd64 root=UUID=d487742e-ad50-4347-8d9a-b8d0f1908c13 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-amd64
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 6eb0817ab0814a13
chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda2)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set b8f4a8c3f4a884ea
chainloader +1
}
menuentry "Windows Recovery Environment (loader) (on /dev/sda3)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set 7816d0b116d0721c
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20110720124559.25a7ae1d@Charlie.hsd1.il.comcast.net.
email Follow the discussionReplies 2 repliesReplies Make a reply

Similar topics

Replies

#1 Joe
July 20th, 2011 - 03:10 pm ET | Report spam
On Wed, 20 Jul 2011 12:45:59 -0500
Charles Blair wrote:

I tried to set up a dual boot of windows and linux from
the installer. The linux part works, but windows 7 starts to boot
and then takes me back to grub.

I am sufficiently happy with linux that I was planning to get
rid of windows. I would like to use the space to give openBSD a
try.

As a first step, I tried using cfdisk -Ps /dev/sda, and got the
ominous warning:

FATAL ERROR: Bad primary partition 2: Partition ends in the final
partial cylinder

Since linux is working, I'm worried that trying to fix whatever
this problem is might wreck my system.



Possibly. Windows is extremely fussy, even as far back as NT4 it could
not be moved on a hard drive once installed. What did you use to shrink
the original Windows partition, which I assume ran all the way up to
sda3? It would appear that this software was to blame for the issue.

fdisk -l /dev/sda gives:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbb0c5abb

Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 192 12349 97656250 7 HPFS/NTFS
/dev/sda3 37264 38914 13248512 17 Hidden
HPFS/NTFS /dev/sda4 12350 37264 200128513 5
Extended /dev/sda5 * 12350 12392 340992 83 Linux



This one might be the issue. Before Vista, Windows absolutely required
its boot partition to be marked bootable. I don't know if that is true
now, as I haven't done any multi-boot work since XP. But Linux does not
use the bootable flag, so there's no harm in moving it to sda2 to try.

There's a (I hope) minor point that sda3 and sda4 share a block, which
may not cause trouble, but may prevent the hidden partition (presumably
a recovery image for Windows) from working. I would hope you made an
image backup of that partition first, as there aren't many W7
installation discs around.

/dev/sda6 12392 13486 8787968 83 Linux
/dev/sda7 13486 13851 2928640 83 Linux
/dev/sda8 13851 14826 7827456 82 Linux swap /
Solaris /dev/sda9 14826 14874 389120 83 Linux
/dev/sda10 14874 37264 179849216 83 Linux

Partition table entries are not in disk order



This never used to be an issue, except for at least one early Windows
partition utility. I've no idea what software now might have problems
with it.

Joe


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Archive: http://lists.debian.org/
Replies Reply to this message
#2 lee
July 21st, 2011 - 02:10 am ET | Report spam
Charles Blair writes:

FATAL ERROR: Bad primary partition 2: Partition ends in the final partial cylinder

fdisk -l /dev/sda gives:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbb0c5abb

Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 192 12349 97656250 7 HPFS/NTFS
/dev/sda3 37264 38914 13248512 17 Hidden HPFS/NTFS
/dev/sda4 12350 37264 200128513 5 Extended
/dev/sda5 * 12350 12392 340992 83 Linux
/dev/sda6 12392 13486 8787968 83 Linux
/dev/sda7 13486 13851 2928640 83 Linux
/dev/sda8 13851 14826 7827456 82 Linux swap / Solaris
/dev/sda9 14826 14874 389120 83 Linux
/dev/sda10 14874 37264 179849216 83 Linux

Partition table entries are not in disk order



When the partitions are not listed in disk order, how does one know
which of them is the "bad" one?


BTW, try fdisk -luc instead of fdisk -l. There's also other fdisk
programs like parted and cfdisk, perhaps they can give more detailed
information.

If you plan to re-partition sda1--3 and to leave the rest untouched and
if the "bad" partition is one of sda1--3, you should be able to get away
without damaging the other partitions. In any case, make backups before
you do anything.


html messages are obsolete


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Archive: http://lists.debian.org/
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search