[Bug 620448] New: addpart fails when logical part starts one sector behind extended part
http://bugzilla.novell.com/show_bug.cgi?id=620448 http://bugzilla.novell.com/show_bug.cgi?id=620448#c0 Summary: addpart fails when logical part starts one sector behind extended part Classification: openSUSE Product: openSUSE 11.3 Version: RC 2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: aschnell@novell.com QAContact: qa@suse.de Found By: Development Blocker: --- addpart fails for a logical partition when the logical partition starts one sector behind the extended partition. (This can happen, see bug #617945). The kernel has no problem rereading the partition table with blockdev. # parted /dev/sdd unit s print Model: ATA Hitachi HDS72168 (scsi) Disk /dev/sdd: 160836480s Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 2048s 20965375s 20963328s primary ext4 type=83 2 20965376s 41928703s 20963328s primary ext4 type=83 3 41928704s 160835583s 118906880s extended lba, type=0f 5 41928705s 160835583s 118906879s logical type=83 # delpart /dev/sdd 5 # addpart /dev/sdd 5 41928705 160835583 BLKPG: Device or resource busy # blockdev --rereadpt /dev/sdd # cat /sys/block/sdd/sdd5/start 41928705 Calling addpart with starting point plus one sector works. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=620448 http://bugzilla.novell.com/show_bug.cgi?id=620448#c1 Arvin Schnell <aschnell@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aschnell@novell.com --- Comment #1 from Arvin Schnell <aschnell@novell.com> 2010-07-07 12:00:20 UTC --- The length parameter for addpart is wrong in my example above but this does not cause the issue. # addpart /dev/sdd 5 41928705 118906879 BLKPG: Device or resource busy # addpart /dev/sdd 5 41928706 118906878 -> works -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=620448 https://bugzilla.novell.com/show_bug.cgi?id=620448#c2 Jeff Mahoney <jeffm@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Component|Kernel |Kernel Version|RC 2 |Final Resolution| |WONTFIX Product|openSUSE 11.3 |openSUSE 12.1 --- Comment #2 from Jeff Mahoney <jeffm@suse.com> 2012-03-05 22:44:46 UTC --- I can reproduce this on 12.1 but it turns out it's by design:
From fs/partitions/msdos.c: sector_t size = nr_sects(p)*sector_size; if (!size) continue; if (is_extended_partition(p)) { /* * prevent someone doing mkfs or mkswap on an * extended partition, but leave room for LILO * FIXME: this uses one logical sector for > 512b * sector, although it may not be enough/proper. */ sector_t n = 2; n = min(size, max(sector_size, n)); put_partition(state, slot, start, n);
I came across this while checking out the userspace equivalents so I could see what condition was causing it to return -EBUSY. I duplicated your partition table on a scratch disk for testing, so it should be identical. Normal partition: sled2:/sys/block/sdb/sdb2 # cat start size 20965376 20963328 Extended partition: sled2:/sys/block/sdb/sdb3 # cat start size 41928704 2 .. so that's why you can't use the adjacent sector. Interestingly, the fdisk(8) tool aligns up to the next MB anyway. Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000ae9a8 Device Boot Start End Blocks Id System /dev/sdb1 2048 20965375 10481664 83 Linux /dev/sdb2 20965376 41928703 10481664 83 Linux /dev/sdb3 41928704 160835583 59453440 5 Extended Command (m for help): n Partition type: p primary (2 primary, 1 extended, 1 free) l logical (numbered from 5) Select (default p): l Adding logical partition 5 First sector (41930752-160835583, default 41930752): The version of parted in 12.1 won't actually let you create the partition without ignoring two different warnings. How did you create that partition table? If this was introduced recently, I'd consider it a regression -- however, it's been around since at least 2.4.19. I'm closing this as WONTFIX. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com