Bug 533328 - autopartition doesn't use the disk fully
autopartition doesn't use the disk fully
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: parted (Show other bugs)
12
All Linux
low Severity low
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-06 01:26 EST by Arenas Belon, Carlo Marcelo
Modified: 2009-12-18 05:12 EST (History)
3 users (show)

See Also:
Fixed In Version: parted-1.9.0-24.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-18 05:12:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
anaconda log for a session where using the full disk was requested (55.52 KB, text/plain)
2009-11-14 01:36 EST, Arenas Belon, Carlo Marcelo
no flags Details
storage.log (54.56 KB, text/plain)
2009-11-14 01:37 EST, Arenas Belon, Carlo Marcelo
no flags Details
python script to print the disks' layouts (876 bytes, text/plain)
2009-11-16 11:22 EST, David Lehman
no flags Details

  None (edit)
Description Arenas Belon, Carlo Marcelo 2009-11-06 01:26:25 EST
Description of problem:
when installing on a 2GB volume (for a VM with 512MB of memory) and using autopartition with a "use the whole disk" selection, two primary partitions
are created (in bytes):

            start        end       size
  boot:     32256  209747455  209715200
   lvm: 209747456 2146798079 1937050624

the disk size is 2147483648 bytes though and therefore the last 685569 bytes
are left unallocated

Version-Release number of selected component (if applicable):
12.43-1

How reproducible:
always

Steps to Reproduce:
1. create a 2GB raw disk volume
2. install fedora rawhide on it using KVM with 512MB of memory
3. select all default options
  
Actual results:
anaconda reports free range detected is 64-4192964 (2047MB)

Expected results:
anaconda reports free range detected is 64-4194303 (2048MB) as allowed by parted
Comment 1 David Lehman 2009-11-11 14:32:05 EST
Please include the full output of the command 'parted -l' after partitioning, along with the files /tmp/storage.log and /tmp/anaconda.log.
Comment 2 Arenas Belon, Carlo Marcelo 2009-11-14 01:32:40 EST
parted -l uses the default unit which would round up the partitions to show them incorrectly to be fully using the disk as shown by :

Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  210MB   210MB   primary  ext4         boot
 2      210MB   2147MB  1937MB  primary               lvm


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/VolGroup-lv_swap: 642MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system     Flags
 1      0.00B  642MB  642MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/VolGroup-lv_root: 1292MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  1292MB  1292MB  ext4

but doing print using bytes (or sectors) as units shows instead :

odel: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 2147483648B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End          Size         Type     File system  Flags
 1      32256B      209747455B   209715200B   primary  ext4         boot
 2      209747456B  2146798079B  1937050624B  primary               lvm


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/VolGroup-lv_swap: 641728512B
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End         Size        File system     Flags
 1      0B     641728511B  641728512B  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/VolGroup-lv_root: 1291845632B
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End          Size         File system  Flags
 1      0B     1291845631B  1291845632B  ext4
Comment 3 Arenas Belon, Carlo Marcelo 2009-11-14 01:36:59 EST
Created attachment 369517 [details]
anaconda log for a session where using the full disk was requested
Comment 4 Arenas Belon, Carlo Marcelo 2009-11-14 01:37:50 EST
Created attachment 369518 [details]
storage.log
Comment 5 Bug Zapper 2009-11-16 10:12:07 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 David Lehman 2009-11-16 11:22:44 EST
Created attachment 369734 [details]
python script to print the disks' layouts

Please run the attached script on the system in question and post the full output here so I can see exactly what is happening.

Keep in mind that anaconda uses parted, and this is almost certainly a result of something parted does.
Comment 7 Arenas Belon, Carlo Marcelo 2009-11-17 03:49:24 EST
the output of the script after using autopartition in anaconda

/dev/sda
  0-62 (0.03 MB) METADATA
  63-409662 (200.00 MB) /dev/sda1
  409663-4192964 (1847.32 MB) /dev/sda2
  4192965-4194303 (0.65 MB) METADATA

the output of the script if instead parted is used outside of anaconda to destroy and recreate partition 2 to use the full disk with (mkpart primary 209747456B -1S)

/dev/sda
  0-62 (0.03 MB) METADATA
  63-409662 (200.00 MB) /dev/sda1
  409663-4194303 (1847.97 MB) /dev/sda2

not sure what "METADATA" refers to here but while the first cilinder might be kept reserved for compatibility with some boot loaders, reserving the last part of the disk seems arbitrary.
Comment 8 David Lehman 2009-11-17 11:25:57 EST
[2009-11-14 01:18:36,395]    DEBUG: checking freespace on sda
[2009-11-14 01:18:36,396]    DEBUG: getBestFreeSpaceRegion: disk=/dev/sda part_type=0 req_size=1847MB boot=False best=None
[2009-11-14 01:18:36,396]    DEBUG: current free range is 409663-4192964 (1847MB)

These log messages indicate that when we asked parted for a list of the free regions on sda it told us that the free region ended at sector 4192964, even though there are 1338 free sectors directly adjacent.

This does not seem to be a serious problem, but I will reassign to parted since its erroneous freespace reporting is what causes this behavior.
Comment 9 Hans de Goede 2009-12-18 05:12:05 EST
Dave,

This is fixed in parted-1.9.0-24.fc13, but only when you use the new
(pyparted bindings coming up) per disk flag functions (which work just
like the per partition functions), and clear the parted.DISK_CYLINDER_ALIGNMENT flag:
if disk.isFlagAvailable(parted.DISK_CYLINDER_ALIGNMENT):
    disk.unsetFlag(parted.DISK_CYLINDER_ALIGNMENT)

before checking for free regions.

About the new per disk flag functions and the parted.DISK_CYLINDER_ALIGNMENT
flag. This is what we ended up with when discussing the disabling of the automatic
cylinder alignment for msdos disk labels.

Upstream did not accept the isAlignToCylinders() and toggleAlignToCylinders()
functions. The current parted build still has them, to ease the transition,
but the next pyparted build will remove the bindings for them, after which
anaconda will need to switch to:
if disk.isFlagAvailable(parted.DISK_CYLINDER_ALIGNMENT):
    disk.unsetFlag(parted.DISK_CYLINDER_ALIGNMENT)

And a new parted build will be done which will remove them.

Regards,

Hans

Note You need to log in before you can comment on or make changes to this bug.