GRUB recognizes defunct LDM headers

Bug #1061255 reported by Joe Sweeney on 2012-10-03
110
This bug affects 20 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Critical
Phillip Susi
Quantal
Critical
Phillip Susi

Bug Description

[Impact]
Grub can no longer boot Windows

[Test Case]
Use Windows to format a dynamic disk. Use fdisk to repartition the disk as a regular MBR disk. os-prober still recognizes the defunct ldm partition table with the Windows partition in it.

[Regression Potential]
Previously grub had no support for ldm, so the worst case is that it goes back to not recognizing ldm, as opposed to the goal of this patch of only recognizing *valid* ldm.
.

GRUB recognizes stale LDM headers left on the disk after reformatting without LDM. This causes grub to complain either that embedding is not possible, and/or to incorrectly use the ldm partition module instead of msdos.

- This bug affect GRUB2.00 (default bootloader of Ubuntu12.10).
- This bug completely breaks access to any operating system, either when installing a fresh 12.10, or when upgrading from 12.04 to 12.10.

********************
WORKAROUND1 (when GRUB appears, but the Windows entry fails and shows a "A disk Error Occurred" error):
see Comment #44 below ( https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1061255/comments/44 )

WORKAROUND2:
see Comment #26 below ( https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1061255/comments/26 )

WORKAROUND3:
Use Boot-Repair ( https://help.ubuntu.com/community/Boot-Repair ) from liveCD to replace GRUB2 by GRUB Legacy: run Boot-Repair --> Advanced options --> GRUB options tab --> tick "GRUB Legacy" --> Apply

********************

Related branches

Phillip Susi (psusi) wrote :

Please include your grub.cfg and the output of parted print.

Changed in grub2 (Ubuntu):
status: New → Incomplete
Joe Sweeney (joesweeney413) wrote :
Download full text (17.6 KiB)

#
# 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
  set have_grubenv=true
  load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 ec0d1ef0-b000-4957-85fd-0488176623f5
else
  search --no-floppy --fs-uuid --set=root ec0d1ef0-b000-4957-85fd-0488176623f5
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
 set gfxpayload="${1}"
 if [ "${1}" = "keep" ]; then
  set vt_handoff=vt.handoff=7
 else
  set vt_handoff=
 fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ec0d1ef0-b000-4957-85fd-0488176623f5' {
recordfail
 gfxmode $linux_gfx_mode
 insmod gzio
 insmod part_msdos
 insmod ext2
 set root='hd0,msdos3'
 if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3 ec0d1ef0-b000-4957-85fd-0488176623f5
 else
   search --no-floppy --fs-uuid --set=root ec0d1ef0-b000-4957-85fd-0488176623f5
 fi
 linux /boot/vmli...

Joe Sweeney (joesweeney413) wrote :

(parted) print
Model: ATA WDC WD2500BEVT-0 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 1049kB 106MB 105MB primary ntfs boot
 2 106MB 64.5GB 64.4GB primary ntfs
 3 64.5GB 218GB 154GB primary ext4
 4 218GB 250GB 32.0GB primary ext4

Phillip Susi (psusi) wrote :

Please run sudo grub-probe -t partmap -d /dev/sda1

Joe Sweeney (joesweeney413) wrote :

sudo grub-probe -t partmap -d /dev/sda1 returns a blank line. sda2 is seen as msdos.

Phillip Susi (psusi) wrote :

Can you try adding a -v switch?

Joe Sweeney (joesweeney413) wrote :
Download full text (13.5 KiB)

 sudo grub-probe -t partmap -d /dev/sda1 -vgrub-probe: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-probe: info: Looking for /dev/sda1.
grub-probe: info: /dev/sda is a parent of /dev/sda1.
grub-probe: info: /dev/sda1 starts from 2048.
grub-probe: info: opening the device hostdisk//dev/sda.
grub-probe: info: the size of hostdisk//dev/sda is 488397168.
grub-probe: info: the size of hostdisk//dev/sda is 488397168.
grub-probe: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-probe: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-probe: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-probe: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-probe: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-probe: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-probe: info: scanning hostdisk//dev/sda for LDM.
grub-probe: info: Found array JOE-LAPTOP-Dg0.
grub-probe: info: Inserting hostdisk//dev/sda into JOE-LAPTOP-Dg0 (ldm)
.
grub-probe: info: the size of hostdisk//dev/sda is 488397168.
grub-probe: info: Scanning for DISKFILTER devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: Scanning for mdraid1x devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: Scanning for mdraid09 devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: Scanning for mdraid09_be devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: Scanning for dmraid_nv devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: Scanning for ldm devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: scanning ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4 for LDM.
grub-probe: info: no LDM signature found.
grub-probe: info: Scanning for lvm devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume4.
grub-probe: info: no LVM signature found.
grub-probe: info: Scanning for DISKFILTER devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: Scanning for mdraid1x devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: Scanning for mdraid09 devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: Scanning for mdraid09_be devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: Scanning for dmraid_nv devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: Scanning for ldm devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: scanning ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3 for LDM.
grub-probe: info: no LDM signature found.
grub-probe: info: Scanning for lvm devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume3.
grub-probe: info: no LVM signature found.
grub-probe: info: Scanning for DISKFILTER devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume2.
grub-probe: info: Scanning for mdraid1x devices on disk ldm/078b489e-bcd2-11e1-b877-bb2ca557b6a9/Volume2.
grub-probe: info: Scanning for mdraid09 ...

Joe Sweeney (joesweeney413) wrote :

also just want to mention, in the past few days, there have been several grub package updates i have installed all of them and everytime it overights and readds ldm to the paths.

Phillip Susi (psusi) wrote :

It IS recognizing LDM on the disk. My guess is that the LDM headers are still present from when they were used before, so grub is recognizing them. The fact that the dos partition table does not show an LDM partition however, should bar the detection of LDM I think.

summary: - GRUB thinks Windows 7 is on LDM
+ GRUB recognizes defunct LDM headers
Changed in grub2 (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → Medium
Joe Sweeney (joesweeney413) wrote :

certainly is weird. ive NEVER had windows on ldm, and furthermore, nothing in the system has changed in over a year. all the sudden after a grub update a few weeks ago, this started happened, i only noticed cuz i went to boot into win7 and i got a diskread error, which made me check grub.cfg. i dont understand why all the sudden it would probe anything different.

Joe Sweeney (joesweeney413) wrote :

it IS a PITA that i have to manually edit grub.cfg everytime theres an update. this system has been running perfectly for months. they changed SOMETHING in one of the last 5-10 updates that is making it see an ldm. i think it was the update that chaged the layout of the grub menu. IE my menu used to say "Ubuntu 12.10 on <kernel>" now it just says "Ubuntu" thinking back, im almost positive this was the same time that it started adding ldm.

Phillip Susi (psusi) wrote :

LDM support is a recently added feature in grub, so that would explain why it didn't do this before. You probably did use LDM on the drive at some point in the past, but have long ago reformatted. I'm looking into the LDM format now.

Dimitri John Ledkov (xnox) wrote :

LDM is default installation type since I believe windows xp pro, it's just probably headers were not cleared when deactivating it leading to interesting behaviour.

Joe Sweeney (joesweeney413) wrote :

its just weird. i got this pc brand new, in march, installed 7,ubuntu and backtrack, neither logical, and havent messed with partitions since.

Joe Sweeney (joesweeney413) wrote :

is there a way to disable grub rescanning after every package update? its getting really annoying editing grub.cfg all the time with grub having daily updates being pushed out....

Phillip Susi (psusi) on 2012-10-16
description: updated
Changed in grub2 (Ubuntu):
importance: Medium → Critical
Midnight-Man (o1882197) wrote :

Got exactly the same bug here, attached grub.cfg

Results of parted print

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

Number Start End Size Type File system Flags
 1 32,3kB 107GB 107GB primary ntfs boot
 2 107GB 1000GB 893GB extended lba
 5 107GB 215GB 107GB logical ntfs
 6 215GB 322GB 107GB logical ntfs
 7 322GB 893GB 571GB logical ntfs
 8 893GB 945GB 52,7GB logical ext4
 9 945GB 998GB 52,7GB logical ext4
10 998GB 1000GB 2049MB logical linux-swap(v1)

Midnight-Man (o1882197) wrote :

Attached: results of sudo grub-probe -t partmap -d /dev/sda1 -v (without -v switch I got just empty line)

GreatKir (deminkirill) wrote :

This bug affects me too:
/usr/sbin/grub-bios-setup: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/usr/sbin/grub-bios-setup: error: embedding is not possible, but this is required for RAID and LVM install.
In the past this drive was formatted as LDM.
In attachment are first 3 MB from the disk.

YannUbuntu (yannubuntu) wrote :

Another user: http://paste.ubuntu.com/1301238
GRUB2.00 can't install into the MBR because of this bug. Is there any workaround? (like adding --force , --disk-module=... , --module=... , or else?)

ZoLToR (zoltor) wrote :

Critical? Damn, this is Blocker! I almost lost all my data on hard drive (but with "testdisk" restored it) when tried to solving problem with GRUB before I let to know that is bug! :(((((

p.s. Sorry for my English.

YannUbuntu (yannubuntu) wrote :
description: updated
description: updated

How safe would it be to save the partition layout (eg sfdisk), zero the start of the disk, reapply the partition layout, and grub-install?
At least for simple cases, where no additional volume management is being used?

Phillip Susi (psusi) wrote :

It is actually the backup copy at the end of the disk that appears to be the problem. Zeroing out the last sector of the disk should fix it. To do this, you want to follow steps similar to this:

sudo fdisk -lu /dev/sda

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors

Note the sector count. Subtract one and that leaves 488397167, which you can then use with dd to dump that sector:

sudo dd if=/dev/sda bs=512 count=1 skip=488397167 | hd

At this point you should see somewhere on the screen the string "PRIVHEAD". If you do, that is the LDM label sector. You can then zero it out with:

sudo dd if=/dev/zero of=/dev/sda bs=512 seek=488397167 count=1

It is vital that the command be executed correctly or you can trash your whole disk, so triple check your typing and math before hitting enter.

Phillip Susi (psusi) on 2012-10-31
Changed in grub2 (Ubuntu):
milestone: none → ubuntu-12.04.2

I have exactly the same problem and solution proposed by Phillip works for me, so thanks you Phillip.

Phillip Susi (psusi) wrote :

Seeing as how parted does not support LDM so we can't properly partition such disks anyhow, I suggest that we disable the ldm support in grub for now.

Changed in grub2 (Ubuntu):
milestone: ubuntu-12.04.2 → quantal-updates
tags: added: regression-release
Midnight-Man (o1882197) wrote :

Filling last sector of HDD with zeros did not help me. There was a "PRIVHEAD" string at beginning of sector, it is now deleted, checked few times, to be sure, but after sudo update-grub I still got "insmod ldm". Hope that this did not trashed my disk :P

Until this will be fixed I also suggest to disable ldm support in grub.

YannUbuntu (yannubuntu) wrote :

Can 'grub-install --force /dev/sdX...' be used as a workaround? has anyone tried?

Phillip Susi (psusi) wrote :

No, since grub also uses the wrong partition module and references the wrong partition when trying to locate windows, if it even sees it at all to add an entry to the menu.

solax (solax76) wrote :

I had the same problem and after having searched for a while I have solved with solution proposed by Phillip!
Thank you Phillip!

Modano (modano) wrote :

Hi all,
same here :

http://paste.ubuntu.com/1356497/

Worked with Philip's zeroing of last sector. Many thanks.

João Rossa (joao-rossa) wrote :

Here's my boot-repair url :

http://paste.ubuntu.com/1390468/

I keep having trouble launching Windows 7 from the grub. I get the "A disk Error Occurred. Press ctrl alt del to restart".
The ubuntu team said it was this bug, Can anyone confirm? Do i need to recover windows 7 boot first before using the workarounds?

regards,

João Rossa (joao-rossa) wrote :

Should i use the workaround with boot-repair?

WORKAROUND:
Use Boot-Repair ( https://help.ubuntu.com/community/Boot-Repair ) from liveCD to replace GRUB2 by GRUB Legacy: run Boot-Repair --> Advanced options --> GRUB options tab --> tick "GRUB Legacy" --> Apply

Phillip Susi (psusi) wrote :

Yes, this bug is affecting you. You can zap the last sector of the disk and run update-grub and that should fix it.

João Rossa (joao-rossa) wrote :

Sorry Phillip can you elaborate a bit more, i'm a bit newbie on ubuntu, so how do i zap the last sector of the disk?And do i do it on a liveCD run?

regards,

João Rossa (joao-rossa) wrote :

Do i need to recover the windows 7 boot first and then run liveCD ?Do i do what you said here:

"It is actually the backup copy at the end of the disk that appears to be the problem. Zeroing out the last sector of the disk should fix it. To do this, you want to follow steps similar to this:

sudo fdisk -lu /dev/sda

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors

Note the sector count. Subtract one and that leaves 488397167, which you can then use with dd to dump that sector:

sudo dd if=/dev/sda bs=512 count=1 skip=488397167 | hd

At this point you should see somewhere on the screen the string "PRIVHEAD". If you do, that is the LDM label sector. You can then zero it out with:

sudo dd if=/dev/zero of=/dev/sda bs=512 seek=488397167 count=1

It is vital that the command be executed correctly or you can trash your whole disk, so triple check your typing and math before hitting enter."

After doing all this i should use the "update-grub" command?

regards,

Phillip Susi (psusi) wrote :

You don't have to do it from a livecd, and yes, after that you can just run sudo update-grub and it should work properly.

João Rossa (joao-rossa) wrote :

Here's the initial command:

maxrunner@RossaPc:~$ sudo fdisk -lu /dev/sda
[sudo] password for maxrunner:

Disk /dev/sda: 1000.2 GB, 1000203804160 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953523055 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6a835856

   Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 252862463 126327808 7 HPFS/NTFS/exFAT
/dev/sda3 253841406 1953519615 849839105 f W95 Ext'd (LBA)
/dev/sda4 252862464 253839026 488281+ 83 Linux
/dev/sda5 488382464 976760831 244189184 7 HPFS/NTFS/exFAT
/dev/sda6 976760896 1953519615 488379360 7 HPFS/NTFS/exFAT
/dev/sda7 253841408 265558015 5858304 82 Linux swap / Solaris
/dev/sda8 265560064 324151295 29295616 83 Linux
/dev/sda9 324153344 488376319 82111488 83 Linux

So i just need to subtract 1 to 1953523055->1953523054 and use this value in the remaining commands?i'm using ubuntu 12.10 installed. this will make the windows 7 os work again when selected?

João Rossa (joao-rossa) wrote :

So making these two commands:

sudo dd if=/dev/sda bs=512 count=1 skip=1953523054 | hd

and

sudo dd if=/dev/zero of=/dev/sda bs=512 seek=1953523054 count=1

Will not trash my disk? im a little hesitant lol.

Phillip Susi (psusi) wrote :

As I said before, make sure you see the PRIVHEADER before doing the second dd command, and if you do then this should fix the problem.

oldfred (oldfred) wrote :

I do not like suggesting dd to new users.

In this thread just adding a Windows 7 boot stanza to 40_custom worked. Grub legacy almost never found Windows 7 either and we almost always had to add the boot stanza for Windows 7 to menu.lst.

http://ubuntuforums.org/showthread.php?t=2088596
See post #12, user said it worked in #13

#Add menu entry to 40_custom, first find correct UUID
sudo blkid

Adjust boot stanza entry for UUID and example partition sda1 and (hd0,1) to which evey partition Windows boots from.

gksudo gedit /etc/grub.d/40_custom

#update grub menu
sudo update-grub

menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 908A5B7D8A5B5F32
chainloader +1
}

Phillip Susi (psusi) wrote :

If you haven't zapped the last sector yet, I am building a patched version that should fix the bug and could use testing. Please add my ppa and update:

sudo apt-add-repository ppa:psusi/ppa
sudo apt-get update
sudo apt-get upgrade

Changed in grub2 (Ubuntu):
assignee: nobody → Phillip Susi (psusi)
status: Triaged → In Progress
YannUbuntu (yannubuntu) on 2012-11-28
description: updated
Changed in grub2 (Ubuntu Quantal):
milestone: none → quantal-updates
Changed in grub2 (Ubuntu):
milestone: quantal-updates → none
Ronni (ronni-jensen) wrote :

I guess this is the same bug preventing me from booting into Windows, even if it is on a seperate disk.

I upgraded Grub from Phillip's PPA, without much luck.

Ronni (ronni-jensen) wrote :

I finally got it booting into Windows, but I had to edit grub.cfg to get it booting.

I tried zeroing the last sector (it did indeed have an LDM header) but no luck.

Edited grub.cfg http://paste.ubuntu.com/1404094/

Parted print http://paste.ubuntu.com/1404097/

Phillip Susi (psusi) on 2012-12-03
description: updated
Changed in grub2 (Ubuntu Quantal):
status: New → In Progress
assignee: nobody → Phillip Susi (psusi)
importance: Undecided → Critical
Midnight-Man (o1882197) wrote :

I zapped last sector, but anyway tried patch. I ran:
sudo apt-add-repository ppa:psusi/ppa
sudo apt-get update
sudo apt-get upgrade
sudo update-grub

Not fixed here - I got ldm again in grub.cfg :( Manually fixed this to msdos in Kate.

Phillip Susi (psusi) wrote :

Can you post the output of sudo fdisk -lu and apt-cache policy grub-pc?

Phillip Susi (psusi) wrote :

Ahh, unless you are running raring, then you didn't get the update. I have copied it to the quantal pocket so try the update && upgrade again.

Ronni (ronni-jensen) wrote :

I got the update by fidgeting with the sources, so 2.00-7-ubuntu14 was installed when I posted above.

fdisk -lu output http://paste.ubuntu.com/1417526/

apt-cache output (I changed the repository back , just to see if it made a difference. It didn't) http://paste.ubuntu.com/1417528/

Phillip Susi (psusi) wrote :

Is your windows on the 750 gb drive or the 16gb drive?

Ronni (ronni-jensen) wrote :

It's on the 750gb (/dev/sdb) - the 16gig is a cf-card

Phillip Susi (psusi) wrote :

Then it is *supposed* to be using ldm since that is a dynamic disk.

Midnight-Man (o1882197) wrote :

Thanks Phillip - looks like I did not get update. Now it is fixed for me :D

Everytime I run sudo update-grub I got msdos now and everything works flawlessly :D

You are the best! Thanks! :D

Just for confirmation fdisk -lu & apt-cache results (after successful update): http://paste.ubuntu.com/1417852/

Ronni (ronni-jensen) wrote :

Then the ldm-loader is broken, because this is the configuration that boots into win7 on the second disk, with the part generated by grub commented out http://paste.ubuntu.com/1404094/.

I'll downgrade to 12.04 and see what grub.cfg looks like.

Ronni (ronni-jensen) wrote :

I've reinstalled 12.04, out of curiosity.
Grub:
sudo apt-cache policy grub-pc
grub-pc:
  Installed: 1.99-21ubuntu3
  Candidate: 1.99-21ubuntu3
  Version table:
 *** 1.99-21ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

And the grub.cfg - booting perfectly into Win7 on the secondary disk.

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sdb1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd1,msdos2)'
        search --no-floppy --fs-uuid --set=root 085AFE3C5AFE265A
        chainloader +1
}

Phillip Susi (psusi) wrote :

12.04 did not support ldm and your disk is a hybrid, still having a regular msdos partition with the SFS type mapping to your windows partition, thus msdos also works. If the unmodified ldm configuration does not work, please file a new bug report.

YannUbuntu (yannubuntu) wrote :

@Phillip: here is a case where the last sector does not contain "PRIVHEAD" : http://paste.ubuntu.com/1420216

YannUbuntu (yannubuntu) wrote :

@phillip: here is a case where zeroing the last sector does not fix the bug: http://paste.ubuntu.com/1452326

YannUbuntu (yannubuntu) wrote :

Another case where zeroing the last sector didn't help: http://paste.ubuntu.com/1456865/

Ronni (ronni-jensen) wrote :

The last three may be related to this instead: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1088796.

YannUbuntu (yannubuntu) wrote :

Here is another one where zeroing the last sector didn't help: http://paste.ubuntu.com/1461860

(I don't know LDM much, so I don't know if you need more examples like this or not, just tell me)

Phillip Susi (psusi) wrote :

It looks like the main copy of the LDM label is in sector 6, so perhaps they also have that one.

Peter (pepe66) wrote :

I can confirm that in my case sector 6 also contained the stray PRIVHEAD stuff.
Zeroing this sector (only the first byte of it, in fact) in addition to zeroing the last sector fixed the problem for me.
Now grub2 no longer treats the disk as LDM.

YannUbuntu (yannubuntu) wrote :

Just to be sure: when you say "sector 6", do you mean the 6th sector, eg "dd if=/dev/zero of=/dev/sda bs=512 seek=5 count=1" ?

YannUbuntu (yannubuntu) wrote :

@Phillip: here is an example where
1) zeroing the last sector didn't workaround this bug (lines 658 / 659)
2) sector 6 does not contain PRIVHEAD (see line 624)

http://paste.ubuntu.com/1472348/

Phillip Susi (psusi) wrote :

According to the MBR that actually IS a dynamic disk, and and the seek argument should be 6, not 5.

YannUbuntu (yannubuntu) wrote :

> that actually IS a dynamic disk
ok, so let's forget my post #67

>the seek argument should be 6, not 5.
ok, thanks. i'll come back to you when i get new results.

I had the same problem in Debian with the following package version:

Package: grub2
Version: 2.00-14

and WORKAROUND2 did work.

Felipe Alcacibar (falcacibar) wrote :

same here

dd if=/dev/zero of=/dev/sda bs=512 seek=6 count=1

You can screw up all your disk or primary partition, check lot of times if you are right.

Timothy Gu (timothy-gu) wrote :

Has this bug been fixed? It has been on critical for ~1.5 years and nobody seems to care about it anymore.

Phillip Susi (psusi) wrote :

It appears that this was fixed in trusty, and quantal is now end of life.

Changed in grub2 (Ubuntu Quantal):
status: In Progress → Won't Fix
Changed in grub2 (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers