summaryrefslogtreecommitdiffstats
path: root/storage/formats/disklabel.py
Commit message (Collapse)AuthorAgeFilesLines
* DiskLabel.status can't be determined so return False. (#563526,#561074)David Lehman2010-02-221-4/+1
|
* Fixup partition aligning (#560586)Hans de Goede2010-02-011-0/+10
| | | | | | | | | | | | | | | | | | Our partitioning code was assuming that having a partition from sector 0 - 512 means the partition stops at sector 512, iow that it goes from sector 0 till 511, but that is not how parted geometries work, the range includes the end sector. So 0 - 512 will get you a 513 sectors partition. This patch adds an endAligment property to disklabel which can be used to properly align end sectors (which must be aligned to the disklabel's alignment with the offset decreased by 1), patches partitioning.py to use this to align end sectors and fixes up end sector calculations in partitioning.py to be start + length - 1. On DASD's (s390), the wrong end sector was causing a traceback (#560586), as DASD's disklabels need partitions to be cylinder aligned, and the wrong end sector violated this.
* Make sure to clear partitions before destroying a disklabel.David Lehman2010-01-131-0/+3
| | | | | | | | | This becomes important when removing a disklabel from a device which has a disklabel and partitions but which is not something we support partitioning (eg: lvm lv). In normal cases the partitions will already have been removed, but in the case of an unsupported partitioned device we ignore the partitions when scanning and so have to remove them this way.
* Add a "dict" attribute to Device and DeviceFormat classes.David Lehman2009-12-221-0/+10
| | | | | | | This attribute is a dict that describes the device or format instance with considerable detail. It is intended that the dict will be pickled using the shelve module, so values should be picklable objects. Keys should be descriptive strings.
* Add __str__ methods to the DeviceFormat classes.David Lehman2009-12-161-0/+16
|
* Add an alignment property to DiskLabel.David Lehman2009-12-151-0/+32
|
* Improve disklabel's name attr so we don't have to hide them anymore.David Lehman2009-12-091-2/+10
|
* Hide devices with certain formatting in the main partitioning UI.David Lehman2009-12-091-0/+1
| | | | We don't want to show biosraid, multipath, &c disks in the GUI.
* Whenever storage code tries to log a method call, do so into the ↵Ales Kozumplik2009-12-031-1/+1
| | | | | | | 'tmp/storage.log' file. (a part of #524980) Previously, the method call was logged into 'tmp/anaconda.log' which made the file harder to do anything useful with.
* Log calls to DiskLabel's commit and commitToDisk methods.David Lehman2009-11-121-0/+4
|
* Fix DiskLabel.status so it returns True, not self.partedDisk, when active.David Lehman2009-11-121-1/+2
|
* When doing initlabel on a dasd disk create a dasd disklabel (#531209)Hans de Goede2009-10-281-1/+2
| | | | | | | As discussed on IRC this changes the platform.diskType property into a platform.diskLabelType method that takes a disk/device type argument and uses this argument to check for dasd disks and in that cases returns dasd as diskLabelType.
* Rename platform.diskType to platform.diskLabelTypeHans de Goede2009-10-281-1/+1
| | | | | Rename platform.diskType to platform.diskLabelType, as diskType is confusing (we usally use it to refer to is the disk dasd, iscsi, zfcp, etc.).
* On lookup of a PartedDevice also check for _ped.DeviceException (#527699)Hans de Goede2009-10-071-1/+1
| | | | | | | | The machine in #527699 has one seriously broken disk, this causes (py)parted to throw a different exception type when looking up the device this patch catches this exception too, which will result in the disk being handled as a removeable disk (ie cardreader) with no media present, causing us to ignore it.
* Create and use DiskLabelCommitError for failure to commit.David Lehman2009-10-011-2/+2
|
* Don't retry commiting partition table to diskHans de Goede2009-10-011-17/+6
| | | | | | Since the parted ebusy errors due to unnecessary udev event generation on the partition nodes bug has been nailed, we no longer need the retry loop around committing to disk.
* Do not traceback on an usb cardreader with no card presentHans de Goede2009-09-021-2/+9
| | | | | | | | This patch fixes 2 things, which together fix tracebacks on an usb cardreader with no card present 1) Add a check to format.disklabel() for no media being present 2) _ped.DeviceException was changed to _ped.IOException for no media present errors in current pyparted
* clobber is a method of PartedDevice not PartedDiskHans de Goede2009-09-011-1/+1
|
* Update PartitionDevice's partedPartition when the PartedDisks get resetHans de Goede2009-08-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We use 2 in memory copies of the partition table (2 PartedDisk instances), one which we manipulate while auto / manual partitioning, and one copy on which we reply the changes done by the auto / manual partitioning step by step (committing each step to the disk) as we process our actions. For pre-existing partitions the PartitionDevice's partedPartition member would point to the manipulated table's partitions, even though we had already switched over and where actually executing actions. This causes issues (segfaults!) with the flag clearing in ActionDestroyFormat.execute(), as this was now calling unsetFlag on a partition which is no longer part of a disk (as it was removed by clearParts). This patch fixes this by making PartitionDevice's partedPartition property switch over to the partitions in the new PartedDisk after we've switched over to it. p.s. For some reason in my case, the segfault kept getting caught be some handler and retriggered, so I had to scp in strace to find out it was segfaulting, this showed up as the installer hanging after "executing action: Destroy Format None on .... (partition)" So this patch might fix some bug reports with these symptoms
* Do not try to commit disks changes to the os while partitions are in useHans de Goede2009-08-261-0/+7
| | | | | | | | | | | | | | | In storage.doIt() we set the bootable flag for the /boot or / (or special platform boot) partition. And then we call bootdev.format.commit(), however this will lead to parted trying to tell the kernel to rescan the partition table which will usually fail, as usually we have some VolGroup active at this point. All we really need todo is make sure the bootable flag gets written to the disk, so this patch adds a commitToDisk() method to formats.disklabel and uses that. We were not bitten by this before because uptil now parted was silently ignoring ebusy errors for us (BAD parted, BAD!).
* disklabel.commit(): DeviceError -> DeviceFormatErrorHans de Goede2009-08-261-1/+1
| | | | | | | | | | | While running anaconda with a patched libparted, which will actually return an error upon commiting to a busy disk I got a traceback as the packages.py exception handling tried to unpack the disklabel.commit() exception into a message and a device, as disklabel.commit() was throwing a DeviceError which normal has a message and a device. Since disklabel is a format now commit() should throw a DeviceFormatError instead. (And now to find out why the commit is failing)
* Import _ped so it can be used for _ped.DiskLabelException.Peter Jones2009-08-201-0/+1
| | | | | Somebody added an exception handler for _ped.DiskLabelException without bringing _ped in to get it from. Oopsie.
* Call udev_settle from DiskLabel.commit to ensure it happens.David Lehman2009-08-171-0/+3
|
* Create a DiskLabel format class for partition tables.David Lehman2009-08-171-0/+261