[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in parted with GPT partition table from Lenovo Ideapad A1

From: Rod Smith
Subject: Re: Bug in parted with GPT partition table from Lenovo Ideapad A1
Date: Fri, 30 Dec 2011 13:03:59 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111206 Thunderbird/8.0

On 12/30/2011 12:00 PM, Graham Markall wrote:
> I'm trying to use gparted to examine what I believe is a partition table from 
> the Lenovo Ideapad A1. I've uploded a file containing the partition table to 
> http://www.doc.ic.ac.uk/~grm08/ideapad/mbr16GB.img (md5: 
> 0b236b16e98de53393f6539c40ba1201).
> When I use the command "print all", there are a couple of errors that I have 
> to ignore, and then a failed assertion. The output is as follows:
> $ parted mbr16GB.img
> GNU Parted 3.0
> Using /home/graham/android/ideapad_ota/ROW/mbr16GB.img
> Welcome to GNU Parted! Type 'help' to view a list of commands.
> (parted) print all
> Error: end of file while reading No medium found
> Retry/Ignore/Cancel? i
> Error: The backup GPT table is corrupt, but the primary appears OK, so that 
> will be used.
> OK/Cancel? OK

First, I'd like to state that I'm not a major parted developer, although
I have submitted one patch to the project. Please don't take my comments
as being an official response from the parted developers. Instead, my
goal is to discover if there's a practical workaround or solution to
your immediate problem....

The use you've presented is invalid, for two related reasons. The first
problem is that GPT places partition data at both the start AND THE END
of the disk, and without BOTH sets of data, the GPT as a whole is
broken. Since you're feeding a small (128 KiB) part of the disk to
parted, the best that parted can do is to treat the disk image as if it
were a damaged disk. A second problem is that you're feeding parted an
image file rather than a whole disk. Although parted can work on disk
image files, the one you're using is essentially truncated, so the
partitions defined in the main GPT data structures are too big for the
"disk" (the file).

As a practical matter, what are you trying to accomplish? If you need to
examine or modify the partition table on the Lenovo, you should do so on
that machine, or by transferring its whole disk to another computer; you
should NOT be trying to modify a partition table (particularly a GPT) by
transferring a few sectors to another computer. That just creates a lot
of ways for things to go wrong. If some problem is preventing you from
working on the Lenovo, please describe it.

As to the fact that parted crashed on you, the situation could have been
handled better; however, it IS a case of "garbage-in/garbage-out." The
best you could hope for would be for the program to show you the
partitions defined in the main partition table and then to refuse to
make any actual changes.

Rod Smith

reply via email to

[Prev in Thread] Current Thread [Next in Thread]