cfdisk Command Examples

Curses-based Partition Table Editor with Text User Interface

About cfdisk

cfdisk is a user-friendly, curses-based partition table editor for Linux. Unlike fdisk's command-line interface, cfdisk provides a visual, menu-driven Text User Interface (TUI) that makes disk partitioning more intuitive and less error-prone. It supports DOS, SGI, Sun, and GPT disklabel formats, making it suitable for both legacy and modern systems.

The curses interface displays partitions in a clear table format and provides interactive navigation using arrow keys and simple single-letter commands. This makes cfdisk an excellent choice for users who prefer visual feedback and those who are new to partition management, while still providing the power and control needed by system administrators.

Critical Warning

Like fdisk, cfdisk directly modifies partition tables. Always backup critical data before partitioning operations. Changes are written immediately when you select "Write" - there is no undo! Be especially careful to verify you're working on the correct disk before making changes.

Example 1: Launch cfdisk on a Specific Disk
The most basic usage is launching cfdisk to view and manage partitions on a specific disk. This opens the interactive TUI interface.
sudo cfdisk /dev/sda
cfdisk (util-linux 2.37.2) Disk: /dev/sda Size: 465.8 GiB, 500107862016 bytes Sectors: 976773168, Sector size: 512 bytes Label: gpt, Identifier: A1B2C3D4-E5F6-7890 Device Start End Sectors Size Type >> /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 975773167 974722544 465G Linux filesystem /dev/sda3 975773168 976773134 999967 488M Linux swap ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘ Select partition and press arrow keys to navigate

Understanding the cfdisk Interface:

  • Header Information: Shows disk path, total size, sector count, and label type (GPT or DOS)
  • Partition Table: Clear visual display of all partitions with sizes and types
  • Selected Row: Highlighted partition (indicated by >>) is the current selection
  • Bottom Menu: Context-sensitive menu showing available operations
  • Navigation: Use arrow keys to move between partitions and menu items
  • Color Coding: Different partition types may be shown in different colors
  • Real-time Display: Interface updates immediately as you make changes

Basic Navigation Keys:

↑/↓ Arrows
Move between partitions in the list
←/→ Arrows
Move between menu options at bottom
Enter
Activate selected menu option
Esc / q
Cancel current operation or quit
Pro Tip: If you launch cfdisk without specifying a disk, it will prompt you to select one from available devices. Using cfdisk -z /dev/sdb starts with a fresh, zeroed partition table.
Example 2: Create a New Partition in Free Space
Creating a new partition in cfdisk is straightforward and visual. Navigate to free space and select "New" from the menu.
sudo cfdisk /dev/sdb
cfdisk (util-linux 2.37.2) Disk: /dev/sdb Size: 931.5 GiB, 1000204886016 bytes Device Start End Sectors Size Type /dev/sdb1 2048 209717247 209715200 100G Linux filesystem >> Free space 209717248 2097151999 1887434752 900G ┌────────────────────────────────────────────────────────────┐ │ [New] [Quit] [Help] [Write] │ └────────────────────────────────────────────────────────────┘ Partition size: 900G█ (Enter desired size, e.g., 100G, 50M, +2T) Press Enter to accept default (use all free space)

Creating New Partition Process:

  • Select Free Space: Use arrow keys to highlight free space area
  • Choose "New": Navigate to [New] menu option and press Enter
  • Specify Size: Enter desired size using units (G, M, T) or press Enter for maximum
  • Size Format: Can use absolute (100G), relative (+100G), or percentage formats
  • Default Type: New partitions default to "Linux filesystem" type
  • Automatic Alignment: cfdisk automatically aligns partitions to optimal boundaries
  • Immediate Display: New partition appears in table immediately
  • Not Yet Written: Changes remain in memory until you select "Write"
Size Tip: You can use various formats: 100G (gigabytes), 512M (megabytes), 2T (terabytes), or just +50% for percentage of free space.
Example 3: Delete a Partition
Deleting a partition in cfdisk is quick and visual. The interface clearly shows which partition you're about to delete, reducing the chance of errors.
sudo cfdisk /dev/sdb
cfdisk (util-linux 2.37.2) Disk: /dev/sdb Device Start End Sectors Size Type /dev/sdb1 2048 209717247 209715200 100G Linux filesystem >> /dev/sdb2 209717248 419432447 209715200 100G Linux filesystem /dev/sdb3 419432448 629147647 209715200 100G Linux filesystem ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘ Confirm deletion of /dev/sdb2 (100G Linux filesystem)? [yes/no]:
After confirming deletion: Device Start End Sectors Size Type /dev/sdb1 2048 209717247 209715200 100G Linux filesystem >> Free space 209717248 419432447 209715200 100G /dev/sdb3 419432448 629147647 209715200 100G Linux filesystem ┌────────────────────────────────────────────────────────────┐ │ [New] [Quit] [Help] [Write] │ └────────────────────────────────────────────────────────────┘

Safe Deletion Process:

  • Visual Selection: Clearly see which partition is selected before deletion
  • Confirmation Prompt: Must type "yes" to confirm (prevents accidental deletion)
  • Immediate Update: Deleted partition becomes "Free space" in the display
  • Reversible (before Write): Can quit without saving if you delete wrong partition
  • Partition Numbering: Numbers don't automatically shift (sdb3 remains sdb3)
  • Data Intact: Deletion only removes partition table entry, data still exists on disk
  • Unmount Required: Should unmount partition before deletion to prevent data corruption
  • Menu Changes: Available menu options update based on selection (partition vs free space)
Safety First: Before deleting, verify partition isn't mounted with mount | grep sdb2 and check nothing is using it: sudo lsof /dev/sdb2. Always backup data first!
Example 4: Change Partition Type
cfdisk makes it easy to change partition types with a visual menu of available types. This example shows changing a Linux filesystem to Linux swap.
sudo cfdisk /dev/sdb
cfdisk (util-linux 2.37.2) Disk: /dev/sdb Device Start End Sectors Size Type >> /dev/sdb1 2048 209717247 209715200 100G Linux filesystem ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘ Select partition type (press Enter for default): ┌────────────────────────────────────────────┐ │ EFI System │ │ BIOS boot │ │ Linux filesystem │ │ Linux root (x86-64) │ │ Linux swap │ │ Linux home │ │ Linux server data │ │ Linux LVM │ │ Linux RAID │ │ Microsoft basic data │ └────────────────────────────────────────────┘
After selecting "Linux swap": Device Start End Sectors Size Type >> /dev/sdb1 2048 209717247 209715200 100G Linux swap ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘

Common Partition Types in cfdisk:

  • Linux filesystem: Standard data partition (ext4, xfs, btrfs, etc.)
  • Linux swap: Virtual memory swap space
  • Linux LVM: Physical volume for Logical Volume Manager
  • Linux RAID: Software RAID member partition
  • EFI System: Boot partition for UEFI systems (typically 512MB FAT32)
  • Linux home: Designated for /home directory
  • Linux root (x86-64): Root filesystem for x86-64 systems
  • Microsoft basic data: NTFS or FAT partitions for Windows compatibility
  • BIOS boot: Small partition for GRUB on GPT disks with BIOS boot
Important: Changing the partition type in the table doesn't format the partition! After changing to swap, you still need to run sudo mkswap /dev/sdb1 and then sudo swapon /dev/sdb1.
Example 5: Write Changes to Disk
After making partition changes, you must explicitly write them to disk. cfdisk requires typing "yes" as a safety measure to prevent accidental writes.
sudo cfdisk /dev/sdb
cfdisk (util-linux 2.37.2) Disk: /dev/sdb Device Start End Sectors Size Type /dev/sdb1 2048 209717247 209715200 100G Linux filesystem >> /dev/sdb2 209717248 629147647 419430400 200G Linux filesystem ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘
After pressing Enter on "Write": ┌──────────────────────────────────────────────────────────────┐ │ │ │ Are you sure you want to write the partition table to disk?│ │ │ │ WARNING: This will destroy data on the disk! │ │ │ │ Type "yes" or "no": yes█ │ │ │ └──────────────────────────────────────────────────────────────┘
After confirming "yes": The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. Press any key to exit cfdisk...

Understanding Write Operation:

  • In-Memory Changes: All modifications are stored in memory until you Write
  • Safety Confirmation: Must type "yes" exactly - "y" or "Yes" won't work
  • Point of No Return: Once confirmed, changes are immediately committed to disk
  • ioctl() Call: Kernel is notified to re-read the partition table
  • Disk Sync: Ensures all changes are physically written to disk
  • Exit After Write: cfdisk typically exits after successful write
  • Kernel Update: May require partprobe or reboot for kernel to see changes
  • Check Results: Verify with lsblk or fdisk -l after writing
Pro Tip: If you're unsure about your changes, select [Quit] instead of [Write]. cfdisk will discard all changes and exit safely. You can always start over if needed.
Example 6: Resize an Existing Partition
cfdisk allows resizing partitions when there's adjacent free space. This is particularly useful when you need to adjust partition sizes without data loss (though always backup first!).
sudo cfdisk /dev/sdb
cfdisk (util-linux 2.37.2) Disk: /dev/sdb Device Start End Sectors Size Type >> /dev/sdb1 2048 209717247 209715200 100G Linux filesystem Free space 209717248 629147647 419430400 200G ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘
After selecting "Resize": ┌────────────────────────────────────────────────────────────┐ │ New size for /dev/sdb1: │ │ │ │ Current: 100G │ │ Maximum: 300G (including adjacent free space) │ │ │ │ Enter new size: 250G█ │ │ │ └────────────────────────────────────────────────────────────┘
After entering new size: Device Start End Sectors Size Type >> /dev/sdb1 2048 524290047 524288000 250G Linux filesystem Free space 524290048 629147647 104857600 50G ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘

Partition Resizing Considerations:

  • Adjacent Free Space: Can only expand into immediately adjacent free space
  • Partition Table Only: Resizing in cfdisk only changes partition boundaries
  • Filesystem Not Resized: Must separately resize filesystem after writing changes
  • Expanding Filesystems: Use resize2fs for ext4, xfs_growfs for XFS
  • Shrinking Risk: Shrinking is dangerous - can lose data if filesystem doesn't fit
  • Backup First: Always backup data before any resize operation
  • Unmount Recommended: Best practice to unmount partition before resizing
  • Start Sector Fixed: Resize typically only changes end sector, keeping start sector
Complete Resize Workflow: 1) Resize partition in cfdisk and Write, 2) Run sudo partprobe /dev/sdb, 3) Resize filesystem: sudo resize2fs /dev/sdb1 (for ext4).
Example 7: Create New GPT Partition Table
When working with a new disk or reinitializing an existing one, you can create a fresh GPT partition table. This example uses the -z flag to start with a clean slate.
sudo cfdisk -z /dev/sdc
cfdisk (util-linux 2.37.2) Disk: /dev/sdc Size: 1.82 TiB, 2000398934016 bytes ┌────────────────────────────────────────────────────────────┐ │ Select label type: │ │ │ │ gpt GUID Partition Table │ │ dos DOS partition table (MBR) │ │ sgi Silicon Graphics partition table │ │ sun Sun partition table │ │ │ │ Press Enter to accept selected type │ └────────────────────────────────────────────────────────────┘
After selecting "gpt": cfdisk (util-linux 2.37.2) Disk: /dev/sdc Size: 1.82 TiB, 2000398934016 bytes Sectors: 3907029168, Sector size: 512 bytes Label: gpt, Identifier: 9A8B7C6D-5E4F Device Start End Sectors Size Type >> Free space 2048 3907029134 3907027087 1.8T ┌────────────────────────────────────────────────────────────┐ │ [New] [Quit] [Help] [Write] │ └────────────────────────────────────────────────────────────┘ Entire disk is free space - ready for partitions

Label Type Selection:

  • GPT (Recommended): Modern standard, supports disks > 2TB, up to 128 partitions, built-in redundancy
  • DOS/MBR: Legacy format, max 2TB disk size, limited to 4 primary partitions
  • SGI: Silicon Graphics IRIX systems (rare, specialized use)
  • Sun: Sun Microsystems systems (Solaris, rare)
  • -z Flag: Ignores existing partition table, starts fresh (dangerous if used on wrong disk!)
  • UEFI Requirement: Modern UEFI systems require GPT for boot drives
  • Automatic GUID: GPT creates unique disk identifier automatically
  • Protective MBR: GPT includes legacy MBR to prevent old tools from corrupting disk
Best Practice: Always use GPT for new disks unless you have specific legacy requirements. For disks > 2TB, GPT is mandatory. The -z flag is useful for USB drives and new disks but dangerous on production systems!
Example 8: View Help System
cfdisk includes a comprehensive built-in help system that explains all available commands and navigation keys. This is accessible anytime within the interface.
sudo cfdisk /dev/sda
After selecting [Help] from menu: ┌────────────────────────────────────────────────────────────┐ │ cfdisk Help System │ ├────────────────────────────────────────────────────────────┤ │ │ │ COMMANDS: │ │ b Toggle bootable flag (DOS partition tables only) │ │ d Delete the currently selected partition │ │ h Print this help screen │ │ n Create new partition from free space │ │ q Quit without saving changes │ │ r Resize the currently selected partition │ │ s Sort partitions by start sector │ │ t Change partition type │ │ u Dump disk layout to sfdisk script file │ │ W Write partition table to disk (MUST be uppercase) │ │ x Toggle extra information display │ │ │ │ NAVIGATION: │ │ ↑/↓ Move between partitions │ │ ←/→ Move between menu commands │ │ Enter Activate selected command │ │ Esc Cancel current operation / Return to main screen │ │ │ │ Press any key to return... │ └────────────────────────────────────────────────────────────┘

Key Commands Reference:

  • n (New): Create new partition in free space
  • d (Delete): Remove selected partition (prompts for confirmation)
  • t (Type): Change partition type/filesystem identifier
  • r (Resize): Expand or shrink partition boundaries
  • W (Write): Save changes to disk (uppercase W required as safety feature)
  • q (Quit): Exit without saving changes
  • b (Bootable): Toggle bootable flag (MBR only, not GPT)
  • s (Sort): Reorganize partition table entries by start sector
  • u (Dump): Export partition layout to sfdisk script format
  • x (Extra): Toggle display of additional partition information
Quick Access: Press 'h' at any time to bring up the help screen. Note that Write must be uppercase 'W' - this is an intentional safety feature to prevent accidental writes from hitting 'w' by mistake.
Example 9: Quit Without Saving Changes
If you make changes but decide not to commit them, cfdisk allows you to quit safely without writing to disk. This is your safety net for experimental operations.
sudo cfdisk /dev/sdb
cfdisk (util-linux 2.37.2) Disk: /dev/sdb Device Start End Sectors Size Type /dev/sdb1 2048 209717247 209715200 100G Linux filesystem >> /dev/sdb2 209717248 629147647 419430400 200G Linux swap /dev/sdb3 629147648 838862847 209715200 100G Linux filesystem ┌────────────────────────────────────────────────────────────┐ │ [Delete] [Resize] [Quit] [Type] [Help] [Write] │ └────────────────────────────────────────────────────────────┘
After selecting [Quit]: ┌────────────────────────────────────────────────────────────┐ │ │ │ You have modified the partition table. │ │ │ │ Are you sure you want to quit without saving? │ │ │ │ All changes will be lost. │ │ │ │ [Yes] [No] │ │ │ └────────────────────────────────────────────────────────────┘
After confirming "Yes": Exiting cfdisk without writing changes. All modifications have been discarded. user@hostname:~$ _

Safe Exit Process:

  • Change Detection: cfdisk tracks whether you've made any modifications
  • Confirmation Prompt: Only appears if you've made changes that haven't been written
  • All Changes Lost: Selecting "Yes" discards all modifications made in current session
  • No Disk Changes: Original partition table remains completely unchanged
  • No Confirmation: If no changes made, quit exits immediately without prompting
  • ESC Key: Pressing ESC is equivalent to selecting Quit
  • Safety Feature: This is your undo button - use it if you make mistakes
  • Start Fresh: Can immediately relaunch cfdisk to try again
Practice Tip: When learning cfdisk, make experimental changes and then Quit without saving. This lets you practice safely without any risk to your actual disk layout. Only use Write when you're confident!
Example 10: Working with Specific Partition Table Type
You can force cfdisk to use a specific partition table type using the -t option. This is useful when you know exactly what format you want to use.
sudo cfdisk -t gpt /dev/sdd
cfdisk: Device /dev/sdd has no partition table Creating new GPT partition table on /dev/sdd
cfdisk (util-linux 2.37.2) Disk: /dev/sdd Size: 3.64 TiB, 4000787030016 bytes Sectors: 7814037168, Sector size: 512 bytes Label: gpt, Identifier: 1A2B3C4D-5E6F Device Start End Sectors Size Type >> Free space 2048 7814037134 7814035087 3.6T ┌────────────────────────────────────────────────────────────┐ │ [New] [Quit] [Help] [Write] │ └────────────────────────────────────────────────────────────┘
sudo cfdisk -t dos /dev/sde
cfdisk (util-linux 2.37.2) Disk: /dev/sde Size: 1.86 TiB, 2000398934016 bytes Sectors: 3907029168, Sector size: 512 bytes Label: dos, Identifier: 0x12345678 Device Start End Sectors Size Type >> Free space 2048 3907029167 3907027120 1.8T ┌────────────────────────────────────────────────────────────┐ │ [New] [Quit] [Help] [Write] │ └────────────────────────────────────────────────────────────┘ Note: DOS label has 2TB limit - use GPT instead!

Partition Table Type Options:

  • -t gpt: Force GPT partition table (best for modern systems and large disks)
  • -t dos: Force DOS/MBR partition table (legacy systems, max 2TB)
  • -t sgi: Force SGI partition table (IRIX systems)
  • -t sun: Force Sun partition table (Solaris systems)
  • No -t flag: cfdisk auto-detects existing label or prompts for selection
  • Size Considerations: Disks > 2TB require GPT
  • Boot Requirements: UEFI systems typically require GPT
  • Legacy Systems: Old BIOS systems may need DOS/MBR
Recommendation: Use GPT for all new installations unless you have specific legacy requirements. The command sudo cfdisk -z -t gpt /dev/sdX creates a fresh GPT table, overwriting any existing data.

Additional cfdisk Information

🎯 cfdisk vs fdisk vs parted

Feature cfdisk fdisk parted
Interface Curses TUI (Visual) Command-line (Text) Command-line + Interactive
Ease of Use Very Easy (Beginner-friendly) Moderate (Needs learning) Moderate to Complex
Visual Feedback Excellent (Real-time) Limited (Text-only) Good (Structured output)
Partition Resizing Yes (Table only) No (Delete/Recreate) Yes (Table + Filesystem)
GPT Support Yes (Full) Yes (Full) Yes (Full)
Scripting No Yes (sfdisk better) Yes
Error Prevention Excellent (Visual + Confirms) Good (Commands clear) Fair (Immediate writes)
Best For Interactive single-disk work Quick tasks, scripting Complex operations, automation

⚙️ Common cfdisk Workflows

Setting Up a New Data Disk:

  1. Identify disk: lsblk or sudo fdisk -l
  2. Launch cfdisk: sudo cfdisk -z -t gpt /dev/sdX
  3. Select GPT label type (for modern systems)
  4. Create new partition: Navigate to free space, select [New]
  5. Accept default size (entire disk) or specify custom size
  6. Change type if needed (select [Type] for swap, LVM, etc.)
  7. Write changes: Select [Write], type "yes"
  8. Format partition: sudo mkfs.ext4 /dev/sdX1
  9. Mount and use: sudo mount /dev/sdX1 /mnt/data
  10. Add to fstab for persistent mounting

Reclaiming Space by Removing Partition:

  1. Backup any important data from partition
  2. Unmount partition: sudo umount /dev/sdX2
  3. Remove fstab entry (edit /etc/fstab)
  4. Launch cfdisk: sudo cfdisk /dev/sdX
  5. Navigate to partition to delete
  6. Select [Delete], confirm with "yes"
  7. Space now shows as "Free space"
  8. Can create new partition or resize adjacent partition
  9. Write changes: Select [Write], type "yes"

Creating Multiple Partitions:

  1. Launch cfdisk on target disk
  2. For first partition: Select free space → [New] → Enter size (e.g., 100G)
  3. Set type if needed: [Type] → Select appropriate type
  4. For second partition: Navigate to remaining free space → [New] → Enter size
  5. Repeat for additional partitions
  6. Review entire layout carefully
  7. Write changes when satisfied
  8. Format each partition with desired filesystem

🔒 Safety Features in cfdisk

  • Visual Confirmation: Always shows exactly which partition/space is selected
  • In-Memory Changes: All modifications stay in RAM until explicit Write
  • "yes" Requirement: Must type "yes" (exactly) to confirm writes and deletes
  • Uppercase W: Write command requires uppercase to prevent accidental activation
  • Quit Safety: Warns if quitting with unsaved changes
  • Clear Indicators: Color coding and highlighting show current selection
  • Help Always Available: Press 'h' anytime for command reference
  • No Destructive Defaults: Never automatically writes without explicit command

💡 Best Practices

  • Backup First: Always backup important data before partitioning operations
  • Verify Device: Double-check you're working on correct disk with lsblk
  • Unmount Before Changes: Unmount partitions before deleting or resizing
  • Use GPT for New Disks: Modern standard, better for disks > 2TB
  • Alignment Automatic: cfdisk handles sector alignment automatically
  • Review Before Writing: Carefully examine full partition table before committing
  • Document Layout: Save partition information: sudo sfdisk -d /dev/sda > backup.txt
  • Test in VM First: Practice complex operations in virtual machine
  • Keep Boot Media Ready: Have rescue USB available for recovery
  • Check After Writing: Verify changes with lsblk -f

🐛 Troubleshooting Common Issues

Problem: "Device or resource busy"

Solution: Partition is mounted or in use. Check with mount | grep sdX and lsof /dev/sdX1, then unmount before proceeding.

Problem: Changes not visible after writing

Solution: Kernel may not have updated partition table. Run sudo partprobe /dev/sdX or reboot system to refresh.

Problem: cfdisk exits with "Cannot open /dev/sdX"

Solution: Need root privileges. Use sudo cfdisk /dev/sdX or run as root. Also verify device exists with ls /dev/sd*.

Problem: Terminal too small for cfdisk display

Solution: cfdisk requires minimum 80x24 character terminal. Resize terminal window or use stty size to check current size.

Problem: Partition numbering gaps after deletion

Solution: Normal behavior - partition numbers don't automatically renumber. If this bothers you, use 's' command to sort, but it's purely cosmetic and unnecessary.

🔧 Command-Line Options

Option Description Example
-z Start with zeroed partition table (ignore existing) cfdisk -z /dev/sdb
-t type Force specific partition table type (gpt, dos, sgi, sun) cfdisk -t gpt /dev/sdc
-L[=color] Colorize output (auto, always, never) cfdisk -L=always
-h Display help and exit cfdisk -h
-V Display version information cfdisk -V

📚 Related Commands

  • fdisk: Command-line partition editor (more scripting-friendly)
  • gdisk: GPT-focused partition editor with advanced features
  • parted: Powerful partition editor that can resize filesystems
  • sfdisk: Scriptable partition table manipulator
  • partprobe: Inform kernel of partition table changes
  • lsblk: List block devices and partitions in tree format
  • blkid: Display partition UUIDs and filesystem types
  • mkfs: Create filesystems on partitions

🎓 When to Use cfdisk

cfdisk is IDEAL for:

  • Interactive partition management on single disks
  • Users who prefer visual feedback over command-line
  • Learning partition management (safest for beginners)
  • Quick partition table review and minor adjustments
  • Systems where you need to work directly on console
  • Situations where you want clear visual confirmation before writing

Use fdisk instead when:

  • Scripting partition operations
  • Working over slow SSH connections (less terminal overhead)
  • Need to quickly check partition tables (fdisk -l)
  • Advanced features like partition UUID changes

Use parted instead when:

  • Need to resize both partition table AND filesystem together
  • Complex operations requiring precise sector control
  • Scripting with more advanced features
  • Working with exotic partition table types