Linux command
cfdisk 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo cfdisk [/dev/sdX]
Example
sudo cfdisk -z [/dev/sdX]
说明
cfdisk is a curses-based disk partition table editor from the util-linux package. It provides a user-friendly text interface for creating, deleting, resizing, and changing the type of disk partitions, making it more approachable than the command-driven fdisk. The tool supports both MBR (DOS) and GPT partition tables and displays partition layout in an interactive menu-driven format. Navigation uses arrow keys to select partitions and operations, with changes held in memory until explicitly written with the "Write" command. The `-z` flag starts with a zeroed partition table, which is useful when setting up a new disk or switching between MBR and GPT schemes.
参数
- -z, --zero
- Start with an empty partition table (useful for new disks)
- -L, --color
- Colorize output
- -h, --help
- Display help
FAQ
What is the cfdisk command used for?
cfdisk is a curses-based disk partition table editor from the util-linux package. It provides a user-friendly text interface for creating, deleting, resizing, and changing the type of disk partitions, making it more approachable than the command-driven fdisk. The tool supports both MBR (DOS) and GPT partition tables and displays partition layout in an interactive menu-driven format. Navigation uses arrow keys to select partitions and operations, with changes held in memory until explicitly written with the "Write" command. The `-z` flag starts with a zeroed partition table, which is useful when setting up a new disk or switching between MBR and GPT schemes.
How do I run a basic cfdisk example?
Run `sudo cfdisk [/dev/sdX]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -z, --zero do in cfdisk?
Start with an empty partition table (useful for new disks)