GNOME Bugzilla – Bug 545361
Unable to find mountpoint - extended partition problem
Last modified: 2010-03-08 22:34:42 UTC
Please describe the problem: This is on a USB disk with NO partitions mounted, thus no mountpoints. In the following partition table, if the partitions /dev/sda5 and 7 are swapped, it works, i.e if the same geometry appears in a different order Device Boot Start End Blocks Id System /dev/sda1 * 1 509 4088511 7 HPFS/NTFS /dev/sda2 510 2598 16779892+ 83 Linux /dev/sda3 2599 4165 12586927+ c W95 FAT32 (LBA) /dev/sda4 4166 30401 210740670 5 Extended /dev/sda5 4166 6254 16779861 83 Linux /dev/sda6 6255 9729 27912906 83 Linux /dev/sda7 9730 30401 166047808+ 83 Linux This gives the warning and locks the /dev/sda5 partition and /dev/sda4 as well making editing impossible The following partition table works fine: Device Boot Start End Blocks Id System /dev/sda1 * 1 509 4088511 7 HPFS/NTFS /dev/sda2 510 2598 16779892+ 83 Linux /dev/sda3 2599 4165 12586927+ c W95 FAT32 (LBA) /dev/sda4 4166 30401 210740670 5 Extended /dev/sda5 6255 9729 27912906 83 Linux /dev/sda6 9730 30401 166047808+ 83 Linux /dev/sda7 4166 6254 16779861 83 Linux Steps to reproduce: 1. Create a table like the first above using fdisk, format the partitions. None mounted 2. Check it with gparted. 3. use fdisk to delete 5,6, and 7, then recreate in the other order. 4. Check it with gparted Actual results: The warning locked icon in the first case. It looks fine in the second, but the actual geometry is identical Expected results: No lock icons Does this happen every time? yes. I'm trying to mirror a laptop to a larger drive, but can't get this key partition changed, nor expand /dev/sda4 to use the rest of the larger disk (until I removed /dev/sda5 and recreated it as /dev/sda7 - erasing it!!!). But moving it back to /dev/sda5 broke it again. Other information:
Thank you thomas for the bug report and your interest in improving gparted. PROBLEM RECREATION ------------------ Following is a list of the steps I took to try to reproduce the problem: 1. Create a table using fdisk and then format the partitions. Device Boot Start End Blocks Id System /dev/sdb1 1 509 4088511 7 HPFS/NTFS /dev/sdb2 510 2598 16779892+ 83 Linux /dev/sdb3 2599 4165 12586927+ c W95 FAT32 (LBA) /dev/sdb4 4166 19457 122832990 5 Extended /dev/sdb5 4166 6254 16779861 83 Linux /dev/sdb6 6255 9729 27912906 83 Linux /dev/sdb7 9730 19457 78140128+ 83 Linux 2. Check it with gparted All appears well within gparted. None of the partitions is mounted. 3. Use fdisk to delete 5, 6, and 7, then recreated in the other order. Device Boot Start End Blocks Id System /dev/sdb1 1 509 4088511 7 HPFS/NTFS /dev/sdb2 510 2598 16779892+ 83 Linux /dev/sdb3 2599 4165 12586927+ c W95 FAT32 (LBA) /dev/sdb4 4166 19457 122832990 5 Extended /dev/sdb5 6255 9729 27912937+ 83 Linux /dev/sdb6 9730 19457 78140128+ 83 Linux /dev/sdb7 4166 6254 16779861 83 Linux NOTE that at this point I have not reformatted the 5, 6, and 7 partitions. Hence I anticipate some sort of problem. 4. Check it with gparted Partition 5 displays a lock icon. The information message from double- clicking the icon says: Unable to detect filesystem! Possible reasons are: -The filesystem is damaged -The filesystem is unknown to GParted -There is no filesystem available (unformatted). 5. Check it with parted $ parted /dev/sda print Model: ATA ST3160022ACE (scsi) Disk /dev/sdb: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 4187MB 4187MB primary ntfs 2 4187MB 21.4GB 17.2GB primary ext2 3 21.4GB 34.3GB 12.9GB primary fat32 lba 4 34.3GB 160GB 126GB extended 7 34.3GB 51.4GB 17.2GB logical ext2 5 51.4GB 80.0GB 28.6GB logical 6 80.0GB 160GB 80.0GB logical ext2 6. Reformat partition 5 I used the command "mke2fs /dev/sda5" 7. Check it with gparted All appears well. Not one of the partitions is locked. 8. Check it with parted Number Start End Size Type File system Flags 1 32.3kB 4187MB 4187MB primary ntfs 2 4187MB 21.4GB 17.2GB primary ext2 3 21.4GB 34.3GB 12.9GB primary fat32 lba 4 34.3GB 160GB 126GB extended 7 34.3GB 51.4GB 17.2GB logical ext2 5 51.4GB 80.0GB 28.6GB logical ext2 6 80.0GB 160GB 80.0GB logical ext2 All appears well. CONCLUSION ---------- I believe that the problem arises due to the change in chaining of logical partitions within the extended partition that in turn affects the previous file system format layout. Re-formatting the first partition in the chain (sda5) appears to fix the problem. Fdisk does not report a problem because it simply displays the content of the Master Boot Record (MBR) partition table and the Extended Boot Record (EBR) partition table chains. Parted, and hence gparted which uses the libparted library, does detect a problem because it looks not only at the MBR and EBR chain, but it also looks into the partition to determine the file system. I still find it strange that parted recognized an ext2 file system on partitions 6 and 7. I would have expected that all of the deleted and recreated partitions (5, 6, and 7) would have shown a problem. My recommendation would be to format all of the partitions (5, 6, and 7) that were deleted and recreated. QUESTION -------- Does this address the problem you posted? If not then perhaps you could open a bug on the parted project and post a link to it back here?
First, you might want to up the status to "Confirmed" since you were able to reproduce it. Perhaps this belongs in libparted as opposed to gparted, but in both cases the filesystems are mountable and pass the fsck. WITHOUT REFORMATTING. fdisk does not check the contents, but whatever gparted is doing to check the filesystem within is returning an error where none exists. The filesystem is NOT damaged, it is NOT unformatted. It mounts r/w perfectly, umounts, and passes whatever checks I throw at it from Linux. I can even boot and run fine from the "damaged" partition. Only gparted/libparted/whatever seems to think there is a problem. Unless your "fix" is to backup, reformat, and restore every time you use gparted in this case (then why bother with gparted?), it is still a bug. Perhaps not in the frontend, but in the library. If so, tell me where to move this thread to.
Thank you thomas for your prompt reply, and for testing and confirming that the partition does indeed work without reformatting. I was not aware that the partition in question actually worked. That was a mistake on my part :-( It would appear then that we are looking at a bug that affects not only gparted, but any application that uses the libparted library such as, qtparted and pyparted. I checked the active bug tickets for parted and did not observe this problem in the list. Would you be able to open a bug report under the parted project and then post a link to that bug in this thread? The URL for opening parted bugs is: http://parted.alioth.debian.org/cgi-bin/trac.cgi/newticket
If you can submit it, please do. Also you might want to try using fdisk to reshuffle the partitions after doing mke2fs and see if it locks it (or a different one) again. I can't submit it because GNU says the following message is SPAM, "500 Internal Server Error (Submission rejected as potential spam)" The full text of the attempted submission follows (in wikiformatting) ------------------------- See the thread at: http://bugzilla.gnome.org/show_bug.cgi?id=545361 I originally found it with gparted. Short description: Create a series of partitions. Use fdisk to change sequence. parted, gparted, and others will not see the ext2 after scrambling, although it will be seen by grub and will boot to linux, mount and allow r/w, pass e2fsck, etc. This is on a USB disk with NO partitions mounted, thus no mountpoints. In the following partition table, if the partitions /dev/sda5 and 7 are swapped, it works, i.e if the same geometry appears in a different order {{{ Device Boot Start End Blocks Id System /dev/sda1 * 1 509 4088511 7 HPFS/NTFS /dev/sda2 510 2598 16779892+ 83 Linux /dev/sda3 2599 4165 12586927+ c W95 FAT32 (LBA) /dev/sda4 4166 30401 210740670 5 Extended /dev/sda5 4166 6254 16779861 83 Linux /dev/sda6 6255 9729 27912906 83 Linux /dev/sda7 9730 30401 166047808+ 83 Linux }}} This gives the warning and locks the /dev/sda5 partition and /dev/sda4 as well making editing impossible The following partition table works fine: {{{ Device Boot Start End Blocks Id System /dev/sda1 * 1 509 4088511 7 HPFS/NTFS /dev/sda2 510 2598 16779892+ 83 Linux /dev/sda3 2599 4165 12586927+ c W95 FAT32 (LBA) /dev/sda4 4166 30401 210740670 5 Extended /dev/sda5 6255 9729 27912906 83 Linux /dev/sda6 9730 30401 166047808+ 83 Linux /dev/sda7 4166 6254 16779861 83 Linux }}} Steps to reproduce: 1. Create a table like the first above using fdisk, format the partitions. None mounted. Install Linux as bootable on any or all if you want to verify deeper. 2. Check it with gparted, or another libparted using utility. 3. use fdisk to delete 5,6, and 7, then recreate in the other order (6,7,5). 4. Check it with libparted using utility. The first ext2 partition will show a lock and say it is unreadable, unformatted, etc. With gparted: Partition 5 displays a lock icon. The information message from double- clicking the icon says: {{{ Unable to detect filesystem! Possible reasons are: -The filesystem is damaged -The filesystem is unknown to GParted -There is no filesystem available (unformatted). }}} (yet it will boot, mount, etc.). {{{ $ parted /dev/sda print Model: ATA ST3160022ACE (scsi) Disk /dev/sdb: 160GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 4187MB 4187MB primary ntfs 2 4187MB 21.4GB 17.2GB primary ext2 3 21.4GB 34.3GB 12.9GB primary fat32 lba 4 34.3GB 160GB 126GB extended 7 34.3GB 51.4GB 17.2GB logical ext2 5 51.4GB 80.0GB 28.6GB logical 6 80.0GB 160GB 80.0GB logical ext2 }}} Reformatting will fix partition 5, but I suspect if you reshuffle them again, another one might bet "locked".
Thank you for attempting to report this bug with the parted project. It has now been opened under the title: File system not recognized after altering positions in extended partition http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/201
I suspect it has something to do with the extended partition and the filesystem starting "at the same block". I don't know what partitioning or geometry or formatting code is doing, but I would suspect the original is one filesystem block shorter or something to compensate (some hack for extended partitions somewhere assuming the first logical partition will be the first in the table). So if created in the position, it matches, but when moved it doesn't match. There are sections of the code that attempt to match sectors with partitions and will skip to logical if it is in an extended partition. I need to try ltrace or something. It should be obvious once we know where the code is rejecting it.
Testing with GParted Live 0.5.1-1 confirms that this problem is fixed with the included package parted-1.9.0. Closing this bug report.