parted package
Parted module.
This module presents a pythonic interface to the parted library. cffi is used to bind to the parted library.
Example
>>> from parted import device, disk, constraint
>>> dev = device.Device('/dev/sda')
>>> dsk = dev.disk
>>> # print information about the partition table
>>> print(disk.debug())
>>> with dev.open() as d:
... first = dev.read(0)
... last = dev.read(-1)
... print(first, last)
>>> # clobber partition table
>>> dev.clobber()
>>> # create a new partition table (disk)
>>> dsk = dev.new_table(disk.DiskType.WNT.GPT)
>>> # create a new partition on table
>>> part = disk.Partition.new(dsk, disk.PartitionType.NORMAL, filesys.FileSystemType.WNT.ext4, 2048, 4095)
>>> # add the partition to the table
>>> dsk.add_partition(part, constraint.Constraint.any())
- author:
Adolfo Gómez, dkmaster at dkmon dot com
Submodules
- parted.alignment module
- parted.constraint module
ConstraintConstraint.align()Constraint.any()Constraint.duplicate()Constraint.end_alignConstraint.end_rangeConstraint.exact()Constraint.intersect()Constraint.is_solution()Constraint.max_sizeConstraint.min_sizeConstraint.new()Constraint.new_from_max()Constraint.new_from_min()Constraint.new_from_min_max()Constraint.objConstraint.solve_max()Constraint.solve_nearest()Constraint.start_alignConstraint.start_range
- parted.device module
CHSGeometryDeviceDevice.begin_external_access()Device.bios_geomDevice.boot_dirtyDevice.clobber()Device.close()Device.copy()Device.didDevice.dirtyDevice.end_external_access()Device.enumerate()Device.external_modeDevice.free_all()Device.get()Device.hostDevice.hw_geomDevice.is_busyDevice.is_openedDevice.lengthDevice.modelDevice.new_table()Device.next()Device.objDevice.open()Device.open_countDevice.pathDevice.phys_sector_sizeDevice.probe()Device.probe_all()Device.read()Device.read_onlyDevice.read_table()Device.sector_sizeDevice.sizeDevice.sync()Device.sync_fast()Device.typeDevice.wants_access()Device.write()
DeviceTypeDeviceType.AOEDeviceType.ATARAIDDeviceType.CPQARRAYDeviceType.DAC960DeviceType.DASDDeviceType.DMDeviceType.FILEDeviceType.I2ODeviceType.IDEDeviceType.LOOPDeviceType.MDDeviceType.NVMEDeviceType.PMEMDeviceType.RAMDeviceType.SCSIDeviceType.SDMMCDeviceType.SX8DeviceType.UBDDeviceType.UNKNOWNDeviceType.VIODASDDeviceType.VIRTBLKDeviceType.XVDDeviceType.from_string()
- parted.disk module
DiskDisk.active_partitionsDisk.add_partition()Disk.check()Disk.commit_to_dev()Disk.commit_to_os()Disk.create_partition()Disk.debug()Disk.delete_all_partitions()Disk.delete_partition()Disk.devDisk.duplicate()Disk.flagsDisk.free_partitionsDisk.get_extended_partition()Disk.get_flag()Disk.get_max_partition_geometry()Disk.get_partition()Disk.get_partition_by_sector()Disk.is_flag_available()Disk.last_partition_numDisk.max_primary_partition_countDisk.maximize_partition_geometry()Disk.minimize_extended_partition()Disk.new_partition()Disk.objDisk.partitionsDisk.partitions_list()Disk.print()Disk.set_flag()Disk.set_partition_geometry()Disk.type
DiskFlagDiskTypePartitionPartition.activePartition.add_to_disk()Partition.busyPartition.delete()Partition.diskPartition.extended_listPartition.extended_list_activePartition.extended_list_freePartition.flagsPartition.fs_typePartition.geometryPartition.is_validPartition.max_geometry()Partition.maximize()Partition.namePartition.numPartition.objPartition.pathPartition.set_flag()Partition.set_geometry()Partition.type
PartitionFlagPartitionFlag.APPLE_TV_RECOVERYPartitionFlag.BIOS_GRUBPartitionFlag.BLS_BOOTPartitionFlag.BOOTPartitionFlag.CHROMEOS_KERNELPartitionFlag.DIAGPartitionFlag.ESPPartitionFlag.HIDDENPartitionFlag.HPSERVICEPartitionFlag.IRSTPartitionFlag.LBAPartitionFlag.LEGACY_BOOTPartitionFlag.LINUX_HOMEPartitionFlag.LVMPartitionFlag.MSFT_DATAPartitionFlag.MSFT_RESERVEDPartitionFlag.PALOPartitionFlag.PREPPartitionFlag.RAIDPartitionFlag.ROOTPartitionFlag.SWAPPartitionFlag.from_string()
PartitionType
- parted.exceptions module
- parted.excpt module
PedExceptionexception_handler()
- parted.filesys module
FileSystemFileSystemTypeFileSystemType.WNTFileSystemType.WNT.affs0FileSystemType.WNT.affs1FileSystemType.WNT.affs2FileSystemType.WNT.affs3FileSystemType.WNT.affs4FileSystemType.WNT.affs5FileSystemType.WNT.affs6FileSystemType.WNT.amufs0FileSystemType.WNT.amufs1FileSystemType.WNT.amufs2FileSystemType.WNT.amufs3FileSystemType.WNT.amufs4FileSystemType.WNT.amufs5FileSystemType.WNT.apfs1FileSystemType.WNT.apfs2FileSystemType.WNT.asfsFileSystemType.WNT.btrfsFileSystemType.WNT.ext2FileSystemType.WNT.ext3FileSystemType.WNT.ext4FileSystemType.WNT.fat16FileSystemType.WNT.fat32FileSystemType.WNT.freebsd_ufsFileSystemType.WNT.from_string()FileSystemType.WNT.hfsFileSystemType.WNT.hfsplusFileSystemType.WNT.hfsxFileSystemType.WNT.hp_ufsFileSystemType.WNT.jfsFileSystemType.WNT.linux_swapFileSystemType.WNT.linux_swap_v0FileSystemType.WNT.linux_swap_v1FileSystemType.WNT.nilfs2FileSystemType.WNT.ntfsFileSystemType.WNT.reiserfsFileSystemType.WNT.sun_ufsFileSystemType.WNT.swsuspFileSystemType.WNT.udfFileSystemType.WNT.xfsFileSystemType.WNT.zfs
FileSystemType.enumerate()FileSystemType.from_string()FileSystemType.nameFileSystemType.next()FileSystemType.none()FileSystemType.obj
- parted.geom module
- parted.timer module
- parted.util module