libparted-2.1 ro funcs writing empty hybrid mbr on gpt disks

Bug #529904 reported by Ralph Ulrich
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
parted (Debian)
Fix Released
Unknown
parted (Ubuntu)
Fix Released
High
Colin Watson
Lucid
Fix Released
High
Colin Watson

Bug Description

Binary package hint: parted

libparted-2.1 ro writes empty hybrid mbr on gpt disk

This is the known upstream bug of libparted-2.1
Readonly operations emptying hybrid MBR on a gpt-disk / mac mini
My observation using fdisk which I know uses libparted-2.1:

#### See that fdisk -l does not show mbr-list but gpt and changes types of partitions
#### this should output: Gerät boot. Anfang Ende Blöcke Id System
#### this should output: /dev/sda1 1 26 204819+ ee GPT
#### this should output: Partition 1 endet nicht an einer Zylindergrenze.
#### this should output: /dev/sda2 * 26 6512 52095204 af HFS / HFS+
#### this should output: /dev/sda3 6528 13013 52095204 83 Linux
#### this should output: /dev/sda4 13045 25876 103073040 83 Linux
root@maci:/sbin# fdisk -l /dev/sda
GNU Fdisk 1.2.4
Copyright (C) 1998 - 2006 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

Disk /dev/sda: 320 GB, 320070320640 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 208813 83 Linux
Warning: Partition 1 does not end on cylinder boundary.
/dev/sda2 26 6512 52098795 83 Linux
Warning: Partition 2 does not end on cylinder boundary.
/dev/sda3 6528 13013 52090762 83 Linux
Warning: Partition 3 does not end on cylinder boundary.
/dev/sda4 13045 25876 103065007 83 Linux
/dev/sda5 25898 26447 4409842 82 Linux Swap / Solaris
/dev/sda6 26469 35227 70348635 83 Linux
/dev/sda7 35261 38799 28418985 83 Linux

#### Now using gptfdisk from sourceforge.net - there is a rescue menu - h
root@maci:/sbin# ./gptdisk /dev/sda
GPT fdisk (gdisk) version 0.6.4

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with corrupt MBR; using GPT and will write new
protective MBR on save.
....

#### Now using the opensuse11.2 fdisk just to show results:
root@maci:/sbin# mychroot suse

root@maci:/etc# fdisk -l /dev/sda

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Platte /dev/sda: 320.1 GByte, 320072933376 Byte
255 Köpfe, 63 Sektoren/Spuren, 38913 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Disk identifier: 0x3afccd5b

   Gerät boot. Anfang Ende Blöcke Id System
/dev/sda1 1 26 204819+ ee GPT
Partition 1 endet nicht an einer Zylindergrenze.
/dev/sda2 * 26 6512 52095204 af HFS / HFS+
/dev/sda3 6528 13013 52095204 83 Linux
/dev/sda4 13045 25876 103073040 83 Linux

Related branches

Revision history for this message
Ralph Ulrich (eulenreich) wrote :

From the Changelog:
" parted (2.1-4ubuntu1) lucid; urgency=low

  * Resynchronise with Debian experimental. Remaining changes:
    - gptsync.dpatch: On Intel Mac systems, write a synced MBR rather than a
      protective MBR.
"

So, I guess this my problem using a mac mini will be handled ?

Revision history for this message
Colin Watson (cjwatson) wrote :

No, that's an old carried-over patch from ages back. This sounds like an entry in parted 2.2's NEWS file; I've prepared an update to parted 2.2 in Debian experimental, which is just waiting for review from one of the other maintainers, and then I'll upload it to Debian and merge it into Ubuntu.

Sorry for the inconvenience.

Changed in parted (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Colin Watson (cjwatson)
Changed in parted (Ubuntu Lucid):
milestone: none → ubuntu-10.04-beta-1
Changed in parted (Debian):
status: Unknown → Fix Released
Revision history for this message
SeedOfOnan (seedofonan) wrote :

Last night I tried installing lucid-alternate-amd64.iso built 05-Mar-2010 07:35 on my mac mini circa March 2009. I manually configure the disk partitions (I changed nothing because I already had the partitions that I needed from Ubuntu 9.10 release) simply marking the existing Ubuntu ext3 partition as "/". Saving that change results in my mini EFI loader no longer able to find any bootable systems (There used to be an OS X Leopard and an OS X snowleopard, now gone, horrors! *pants crapped*). Booting the OS X install CD and running the disk utility doesn't help -- it presents the disk as being totally unpartitioned.

The GParted live CD 0.5.1-3 saved my ass. Not the lovely graphical partition utility, mind you -- that presented everything looking great with no problems noted (gah!). But rather starting the terminal window in there and running TestDisk then choosing EFI GPT -> analyse -> Quick Search -> Write (that put things right again for booting my OS X partitions, hallelujah! *pants creamed*). I also ran rEFIt to correct the MBR because it was still misising 2 of the 5 partitions.

It looks like this bug fix maybe the root of my problem, too.

What build will include the "Fix Released" and that I could try next (will it be included in build 2010-03-07 or what)?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package parted - 2.2-1ubuntu1

---------------
parted (2.2-1ubuntu1) lucid; urgency=low

  * Resynchronise with Debian experimental (albeit from the NEW queue).
    Relevant upstream changes:
    - gpt: read-only operation could clobber MBR part of hybrid GPT+MBR
      table (LP: #529904).
  * Remaining changes:
    - gptsync.dpatch: On Intel Mac systems, write a synced MBR rather than a
      protective MBR.
    - Add -fno-stack-protector on sparc.
    - sparc-new-label.dpatch: Fix sparc disk label generation. This is
      required for LDOM and parallel installations with Solaris 10.
    - loop-partitions.dpatch: Loop devices can only have one partition, so
      don't generate device names such as "/dev/loop0p1".
    - udevadm-settle.dpatch: Run 'udevadm settle' either side of rereading
      the partition table, to avoid a variety of races.
    - dmraid.dpatch: Ensure that device-mapper devices for dmraid arrays do
      not have extra nodes created needlessly, as well as making sure that
      partition nodes for dmraid devices are not probed.

parted (2.2-1) experimental; urgency=low

  * New upstream release.

  [ Colin Watson ]
  * Upstream now uses libtool's versioning system, so the SONAME has changed
    from "libparted-2.1.so.0" to "libparted.so.0". Change library package
    names to libparted0 etc. to match. This actually returns to a SONAME
    that was used for a few months in 2000, but it seems unlikely that that
    will cause any problems and I'd rather keep in sync with upstream.
 -- Colin Watson <email address hidden> Mon, 08 Mar 2010 16:04:33 +0000

Changed in parted (Ubuntu Lucid):
status: In Progress → Fix Released
Revision history for this message
SeedOfOnan (seedofonan) wrote :

I just installed ubuntu-10.04-beta1-dvd-amd64.iso same as I did above but without seeing this problem again (yay!). And on my mac mini, I might add, lucid is a noticeable improvement over karmic (sweet!).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.