Excellent questions about low-level disk management!
1. Adding an MSDOS partition table using parted:
MSDOS refers to the type of partition table, not to be confused with the operating system MS-DOS. The MSDOS partition table is also known as the Master Boot Record (MBR) partition table. To create an MSDOS (MBR) partition table on a disk using parted, follow these steps:
bash
# First, identify the disk you want to modify (e.g., /dev/sdb). BE VERY SURE OF THE DISK NAME TO AVOID DATA LOSS.
# Then, run parted with the disk as an argument:
sudo parted /dev/sdb
# Once in the parted interactive shell:
(parted) mklabel msdos
# To verify the change (optional but recommended):
(parted) print
# Quit parted:
(parted) quit
Explanation:
sudo parted /dev/sdb: Opens the parted utility with superuser privileges, focusing on the /dev/sdb disk. Ensure you specify the correct disk to avoid overwriting valuable data.
(parted) mklabel msdos: Creates a new MSDOS (MBR) type partition table on the specified disk, erasing any existing partition table and its partitions.
(parted) print: Optionally, verify that the partition table type has been successfully changed to msdos.
(parted) quit: Exits the parted interactive shell.
2. Is MSDOS MBR or is that another topic?
Not another topic! This is closely related. Here’s the clarification:
MSDOS in the context of parted and disk partitioning refers specifically to the type of partition table.
MBR stands for Master Boot Record, which is essentially the first sector of a bootable disk. The MBR contains:
Bootloader code (usually occupying the first 446 bytes).
The partition table (occupying the next 64 bytes, which can describe up to four primary partitions).
The MBR signature (2 bytes at the end, 0x55 0xAA).
The terms are often used interchangeably in informal contexts because the MSDOS partition table is stored within the MBR. However, to be precise:
MSDOS refers to the partition table scheme (supporting up to four primary partitions, with one possibly being an extended partition that can contain multiple logical partitions).
MBR refers to the overall structure that includes the bootloader, the partition table (which can be of type MSDOS, among others, though MSDOS is the traditional and most common type for MBR), and the MBR signature.
So, when you add an "MSDOS partition table" using parted, you're modifying the partition table section within the MBR to use the MSDOS scheme.
To directly answer your question: MSDOS and MBR are related but distinct concepts. MSDOS is a type of partition table, while MBR is the broader structure that includes this partition table. They are not separate topics but interconnected aspects of traditional BIOS-based systems.
3. Modern Alternatives: GPT
While MBR/MSDOS partitioning is widely supported, modern systems often use GPT (GUID Partition Table), which offers several advantages:
Larger disk support: GPT can handle disks larger than 2 TB, unlike MBR.
More partitions: GPT allows for up to 128 partitions without the need for extended or logical partitions.
Better reliability: GPT stores multiple copies of the partition table for redundancy.
UEFI support: GPT is required for UEFI firmware, which has largely replaced traditional BIOS.
For modern systems, especially those using UEFI or larger disks, GPT is generally recommended over MBR/MSDOS. You can create a GPT partition table using parted by replacing msdos with gpt in the mklabel command: