Linux command
fdisk 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
List
sudo fdisk -l
Example
sudo fdisk [/dev/sdX]
说明
fdisk is a dialog-driven program for managing partition tables and partitions on storage drives. It supports MBR, GPT, SGI, and Sun partition tables.
参数
- -l, --list
- List partition tables for all devices or specified device
- -u, --units
- Display units in sectors (default) or cylinders
- -s, --getsz partition
- Print size of partition in 512-byte sectors
- -b, --sector-size size
- Specify physical and logical sector size
- -c, --compatibility mode
- Specify compatibility mode (dos or nondos)
- -L, --color
- Colorize output
- -t, --type type
- Specify disk label type (dos, gpt, sgi, sun)
FAQ
What is the fdisk command used for?
fdisk is a dialog-driven program for managing partition tables and partitions on storage drives. It supports MBR, GPT, SGI, and Sun partition tables.
How do I run a basic fdisk example?
Run `sudo fdisk -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l, --list do in fdisk?
List partition tables for all devices or specified device