[parted-devel] [PATCH] [RFC] Do not automatically update GPT label in interactive mode

Petr Uzel petr.uzel at suse.cz
Mon Feb 16 15:32:30 UTC 2009


On Fri, Feb 13, 2009 at 04:01:02PM -0200, Otavio Salvador wrote:
> Petr Uzel <petr.uzel at suse.cz> writes:
> 
> > Hi,
> >
> > On Fri, Feb 13, 2009 at 08:15:54AM -0500, Joel Granados wrote:
> >> Hi Peter.
> >> 
> >> I agree with you on this.  This patch is part of the set of patches I will propose for parted for version 1.8.9.
> >
> > Nice to hear that. But please note that I have not tested the patch
> > much as I do not have access to the affected fakeraid controller.
> > However, synthetic tests with linear DM seemed to work fine.
> 
> In this case could you try to cook a test case for it?

Here is a simple shell script that illustrates the incorrect behavior.
The patch I've sent before fixes the issue (at least for me ;) ).

==========================

#!/bin/bash

dev=/dev/sdb
vgname=data
lvname=test
lvsize=2G

# Prepare lv
pvcreate $dev
vgcreate $vgname $dev
lvcreate --name $lvname --size $lvsize $vgname

# Create GPT on the lv
parted -s /dev/$vgname/$lvname mklabel gpt

# Save primary GPT table (2nd) sector
dd if=/dev/$vgname/$lvname of=prim_gpt_before bs=512 count=1 skip=1

# Extend lv
lvextend -L +10 /dev/$vgname/$lvname

# Print partitions on lv (shouldn't change anything)
parted -s /dev/$vgname/$lvname print

# Save primary GPT table again
dd if=/dev/$vgname/$lvname of=prim_gpt_after bs=512 count=1 skip=1

# Compare primary GPTs - they shouldn't differ
cmp prim_gpt_before prim_gpt_after || echo "Error: primary GPT table has changed"

============================

I'd like to transform it to the form of parted-testsuite, but it will
take me some time as I'm not familiar much with it - any hints would
be highly appreciated ;)




-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o.                          e-mail: puzel at suse.cz
Lihovarská 1060/12                          tel: +420 284 028 964
190 00 Prague 9                             fax: +420 284 028 951
Czech Republic                              http://www.suse.cz



More information about the parted-devel mailing list