How to craete logical partition with MBR? #1296
Answered
by
vojtechtrefny
Yurii-huang
asked this question in
Q&A
-
How to craete logical partition with MBR? |
Beta Was this translation helpful? Give feedback.
Answered by
vojtechtrefny
Sep 25, 2024
Replies: 1 comment 1 reply
-
You can specify partition type with Example of creating both the extended and logical partition: import blivet
import parted
b = blivet.Blivet()
b.reset()
sdf = b.devicetree.get_device_by_name("sdf")
b.format_device(sdf, blivet.formats.get_format("disklabel", label_type="msdos"))
epart = b.new_partition(parents=[sdf], size=blivet.size.Size("100 MiB"), part_type=parted.PARTITION_EXTENDED)
b.create_device(epart)
lpart = b.new_partition(parents=[sdf], size=blivet.size.Size("50 MiB"), part_type=parted.PARTITION_LOGICAL)
b.create_device(lpart)
blivet.partitioning.do_partitioning(b)
b.do_it() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Yurii-huang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can specify partition type with
part_type=parted.PARTITION_LOGICAL
.Example of creating both the extended and logical partition: