Home >Operation and Maintenance >Linux Operation and Maintenance >What is the command to format a hard disk in Linux?
Formatting command, take formatting the /dev/sda1 partition as an example:
$ sudo umount /dev/sda1 # 必须先卸载该分区
Recommendation: Linux self-study video
Format to FAT partition
$ sudo mkfs.vfat -F 32 /dev/sda1 # -F 参数必须大写,参数有 12,16 和 32,分别对应 FAT12,FAT16,FAT32。
To format to NTFS partition, you must first install ntfsprogs, take Ubuntu/Debian as an example:
$ sudo apt-get install ntfsprogs
Then execute the format format command, take formatting the /dev/sda1 partition as an example:
$ sudo umount /dev/sda1 # 必须先卸载该分区 $ sudo mkfs.ntfs /dev/sda1 # 格式化为ntfs速度有点慢。
Format to ext4/3/2, take formatting the /dev/sda1 partition as an example:
$ sudo umount /dev/sda1 # 必须先卸载该分区 $ sudo mkfs.ext4 /dev/sda1 # 格式化为ext4分区 $ sudo mkfs.ext3 /dev/sda1 # 格式化为ext3分区 $ sudo mkfs.ext2 /dev/sda1 # 格式化为ext2分区
PHP中文网, a large number of Introduction to Programming tutorials, welcome to learn!
The above is the detailed content of What is the command to format a hard disk in Linux?. For more information, please follow other related articles on the PHP Chinese website!