Advertisement
Guest User

Untitled

a guest
Sep 29th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Detta fungerar
  2.  
  3. dev = parted.Device("/dev/sdb")
  4. dsk = parted.freshDisk(dev, "msdos")
  5. constraint = parted.Constraint(device = dev)
  6. geom = parted.Geometry(device=dev, start=1, end=(constraint.maxSize - 1))
  7. partition = parted.Partition(disk=dsk, type=parted.PARTITION_NORMAL, geometry=geom)
  8. constraint = parted.Constraint(exactGeom = geom)
  9. dsk.addPartition(partition = partition, constraint=constraint)
  10. dsk.commit()
  11.  
  12.  
  13.  
  14. men detta genererar fel
  15. dev = parted.Device("/dev/sdb")
  16. dsk = parted.freshDisk(dev, "gpt")
  17. constraint = parted.Constraint(device = dev)
  18. geom = parted.Geometry(device=dev, start=1, end=(constraint.maxSize - 1))
  19. partition = parted.Partition(disk=dsk, type=parted.PARTITION_NORMAL, geometry=geom)
  20. constraint = parted.Constraint(exactGeom = geom)
  21. dsk.addPartition(partition = partition, constraint=constraint)
  22. dsk.commit()
  23.  
  24. _ped.PartitionException: Unable to satisfy all constraints on the partition.
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement