Revision e687ec01 tools/lvmstrap
b/tools/lvmstrap | ||
---|---|---|
85 | 85 |
|
86 | 86 |
#: Minimum partition size to be considered (1 GB) |
87 | 87 |
PART_MINSIZE = 1024 * 1024 * 1024 |
88 |
MBR_MAX_SIZE = 2 * 10**12 |
|
88 |
MBR_MAX_SIZE = 2 * (10 ** 12) |
|
89 |
|
|
89 | 90 |
|
90 | 91 |
class Error(Exception): |
91 | 92 |
"""Generic exception""" |
... | ... | |
192 | 193 |
action="store_true", default=False, |
193 | 194 |
help="use sfdisk instead of parted") |
194 | 195 |
|
195 |
|
|
196 | 196 |
options, args = parser.parse_args() |
197 | 197 |
if len(args) != 1: |
198 | 198 |
Usage() |
... | ... | |
232 | 232 |
match = PART_RE.match(disk) |
233 | 233 |
if match: |
234 | 234 |
# this is a partition, which resides in /sys/block under a different name |
235 |
disk = "%s/%s" % (match.group(1), disk)
|
|
235 |
disk = "%s/%s" % (match.group(1), disk) |
|
236 | 236 |
return "/sys/block/%s" % disk |
237 | 237 |
|
238 | 238 |
|
... | ... | |
776 | 776 |
result = ExecCommand("parted -s /dev/%s mklabel %s" % (name, label_type)) |
777 | 777 |
if result.failed: |
778 | 778 |
raise OperationalError("Critical: failed to create %s label on %s" % |
779 |
(label_type,name)) |
|
779 |
(label_type, name))
|
|
780 | 780 |
result = ExecCommand("parted -s /dev/%s mkpart pri ext2 1 100%%" % name) |
781 | 781 |
if result.failed: |
782 | 782 |
raise OperationalError("Critical: failed to create partition on %s" % |
... | ... | |
892 | 892 |
" LV count: %s, size: %s, free: %s." % |
893 | 893 |
(vgname, lv_count, vg_size, vg_free)) |
894 | 894 |
|
895 |
|
|
896 | 895 |
disklist = ValidateDiskList(options) |
897 | 896 |
|
898 | 897 |
for disk in disklist: |
Also available in: Unified diff