[parted-devel] Bug: Removal of BLKPG causes regression of ability to manipulate disks with other partitions in use

Curtis Gedak gedakc at gmail.com
Wed Apr 14 17:31:10 UTC 2010


Phillip Susi wrote:
> On Tue, 13 Apr 2010 13:01:42 -0600
> Curtis Gedak <gedakc at gmail.com> wrote:
>
>   
>> The problem occurs when partition and file system changes are made to
>> a partition lower (e.g., sda1) than a mounted partition (e.g.,
>> sda2). When this occurs parted does not recognize the file system on
>> the lower partition.
>>     
>
> What exactly do you mean by "not recognize"?
>   

I apologize for the lack of clarity Phillip.  By "not recognize" I mean 
that "parted ... print" does not show the file system on /dev/sda1 as 
"ext2", as shown in the following terminal session sample:


ubuntu at ubuntu:~$ sudo parted /dev/sda unit s print
Model: ATA VMware Virtual I (scsi)
Disk /dev/sda: 2097152s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start     End       Size      Type     File system  Flags
 1      63s       1220939s  1220877s  primary
 2      1220940s  2088449s  867510s   primary  ntfs

ubuntu at ubuntu:~$ sudo blkid -c /dev/null
/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="3775e530-e9a4-4eeb-8c42-34cab4d90564" TYPE="ext2"
/dev/sda2: UUID="1F6A66977B9DD3E2" TYPE="ntfs"
/dev/ramzswap0: TYPE="swap"
ubuntu at ubuntu:~$


Note the missing "ext2" file system type for partition number 1 in the 
"parted ... print" output.

>   
>> However if I mount the second partition and proceed to delete the
>> first partition, then when I recreate the first partition and format
>> it, parted is unable to recognize the file system on the first
>> partition.
>>     
>
> Again, please be more specific.
>   

My apologies again.

I have not been able to recreate the problem using parted alone.

The steps I use to demonstrate the problem in gparted are:

1)  Begin with a disk device that has an msdos disk label, and two 
primary partitions (/dev/sda1 and /dev/sda2 with file systems ext2 and 
ntfs respectively).

2)  Create a mount point, and mount /dev/sda2 on the mount point.
      (e.g., mount /dev/sda2 /mnt/tempmnt)

3)  Start gparted, select and delete /dev/sda1, and apply this operation.

4)  Now select the unallocated space where /dev/sda1 used to be and 
create a new partition with a file system (I used ext2).  Apply this 
operation.

5)  After gparted finishes the device refresh, the /dev/sda1 partition 
is shown, but with an unrecognized file system.

6)  Exit gparted.

7)  The parted print command will also "not recognize" the file system 
as shown above.

8)  The blkid command will display the file system as the proper type 
("ext2" in this case).  Also the /dev/sda1 partition can be mounted and 
data written to the file system.


After thinking about this some more, this problem reminds me of another 
problem in which gparted and parted did not recognize file systems after 
partitions were re-ordered by fdisk:

     http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/201
     https://bugzilla.gnome.org/show_bug.cgi?id=545361

This file system recognition problem seemed to disappear with 
parted-1.9.0, but perhaps a regression has occurred?

It is also possible that the problem resides in the GParted code which I 
maintain.

Regards,
Curtis Gedak



More information about the parted-devel mailing list