Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Detta fungerar
- dev = parted.Device("/dev/sdb")
- dsk = parted.freshDisk(dev, "msdos")
- constraint = parted.Constraint(device = dev)
- geom = parted.Geometry(device=dev, start=1, end=(constraint.maxSize - 1))
- partition = parted.Partition(disk=dsk, type=parted.PARTITION_NORMAL, geometry=geom)
- constraint = parted.Constraint(exactGeom = geom)
- dsk.addPartition(partition = partition, constraint=constraint)
- dsk.commit()
- men detta genererar fel
- dev = parted.Device("/dev/sdb")
- dsk = parted.freshDisk(dev, "gpt")
- constraint = parted.Constraint(device = dev)
- geom = parted.Geometry(device=dev, start=1, end=(constraint.maxSize - 1))
- partition = parted.Partition(disk=dsk, type=parted.PARTITION_NORMAL, geometry=geom)
- constraint = parted.Constraint(exactGeom = geom)
- dsk.addPartition(partition = partition, constraint=constraint)
- dsk.commit()
- _ped.PartitionException: Unable to satisfy all constraints on the partition.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement