[parted-devel] Possible GPT r/w error

David Cantrell dcantrell at redhat.com
Tue Apr 25 20:59:09 UTC 2006


leslie.polzer at gmx.net wrote:
> On Tue, Apr 25, 2006 at 11:26:05AM -0400, David Cantrell wrote:
> 
> > I have not been able to reproduce this on any of my hardware here. The
> > problem described to me seems reasonable. The GPT area is the first
> > 17KB of the disk. Parted 1.6.x reads in 8KB blocks,
> Where did you find this information?

More like given.  This information was handed to me by the bug reporter,
who is a large and well known storage company.  I am no GPT expert, so I
was trying to recreate the scenario they described.  I was unsuccessful.

In their case, they were seeing parted grab the first 24KB of the disk,
so they assumed 8KB read blocks.

> > The only difference I've been able to notice between me trying to
> > reproduce this error and the reporter is different sector sizes on our
> > disks. All of my disks are 512 or 1024 and his are 4096 (very large
> > 2TB+ disk array).
> The read buffer size indeed varies with logical sector size, and is thus
> not fixed.

Right, otherwise there would be many problems on many systems.

I know the sector size on this array is 4096.  Something is happening to
them in this scenario:

           ---  +----------------------------+ ---------
            ^   |                            |         ^
            |   |                            |         |
 GPT table  |   |                            |         |
      17KB  |   +----------------------------+         |
            |   |                            |         |
            |   |                            |         |
            |   |                            |         | 24KB
            v   +----------------------------+         | (bdev cache
                                                       |  for parted)
start point --> |----------------------------| ---     |
     of         |////////////////////////////|  ^      |
FAT (/dev/sda1) |////////////////////////////|  |      v
                +----------------------------+  |     ---
                |                            |  | FAT cache

               /// is the destroyed data area

Steps given to me to reproduce the problem:

1) Create GPT table on the disk and reboot
      # /sbin/parted /dev/sda
      ...
      (parted) mklabel gpt
      (parted) q

      # reboot

2) Create a FAT16 partition
      # /sbin/parted /dev/sda
      (parted) mkpart primary 0 100
      (parted) mkfs 1 fat16
      (parted) q

3) Mount
      # mount -t vfat /dev/sda1 /mnt

4) Execute 'p' in parted.  Do not exit yet.
      # /sbin/parted /dev/sda
      ...
      (parted) p
      Disk geometry for /dev/sda: 0.000-34858.554 megabytes
      Disk label type: gpt
      Minor    Start       End     Filesystem  Name                  Flags
      1          0.017    100.000  fat16

5) On another terminal, create a new directory.
      # mkdir /mnt/testdir
      # sync

6) Go back to running parted and create a new partition.
      (parted) mkpart primary 100 200
      (parted) q

7) Unmount the FAT16 partition and mount it again.
      # umount /mnt
      # mount -t vfat /dev/sda1 /mnt

8) Look at the output of 'ls' on the mount point.
      # ls -l /mnt
      total 0 
      ?---------  ? ? ? ?           ? testdir <= Destroyed!!!

> > The change for this in 1.6.x seems pointless now, but also pretty
> > invasive. I have just downloaded 1.7.0rc5 and haven't begun to look at
> > it, so I'm not sure what's changed with regard to GPT r/w.
> Nothing that should affect this problem in any way...
> 
>   After our discussion let us include this issue in the bug tracker.

Sounds good to me.

-- 
David Cantrell
Red Hat / Westford, MA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20060425/c89c8aff/attachment.pgp


More information about the parted-devel mailing list