1.首先查看分区
fdisk -l
插上和拔掉分别看下挂载的分区就知道我们需要格式化的磁盘是挂载在那个目录, 比如是在/dev/sdc1
2.sudo mkfs -t ext4 /dev/sdc1
如果提示如下
/dev/sdc1 is mounted.
Refusing to make a filesystem here!
表示需要先进行卸载,才能进行格式化
3.sudo umount /dev/sdc1
4.继续执行步骤2
sudo mkfs -t ext4 /dev/sdc1
若打印如下,说明格式化成功
ego@linux:~/Desktop/Image/t80d$ sudo mkfs -t ext4 /dev/sdc1
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244189952 blocks
12209497 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
done