Mkpart / Create 16gb Partition Gpt Linux
Create 16gb Partition Gpt Linux
Mkpart command syntax to create 16gb partition gpt linux. Copyable examples, output expectations, and common mistakes.
$
Terminal mkpart <partition_name> <btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs> <0%> <16G> mkpart <partition_name> <btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs> <0%> <16G> #!/bin/bash
# Create 16gb Partition Gpt Linux
mkpart {{partition_name}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}} import subprocess
# Create 16gb Partition Gpt Linux
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"mkpart",
"<partition_name>",
"<btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs>",
"<0%>",
"<16G>"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: mkpart not found. Please install it first.")
if __name__ == "__main__":
run_command() Command Breakdown
What each part is doing
-
mkpart - Base Command
- The executable that performs this operation. Here it runs Mkpart before the shell applies any redirect operators.
-
<partition_name> - partition name
- The value supplied for partition name.
-
<btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs> - btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux swap|ntfs|reiserfs|udf|xfs
- The value supplied for btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux swap|ntfs|reiserfs|udf|xfs.
-
<0%> - 0%
- The value supplied for 0%.
-
<16G> - 16G
- The value supplied for 16G.