Linux分区格式化的命令
当硬盘分区完成后,需要对分区进行格式化。
使用mkfs工具对硬盘分区进行格式化,支持MBR和GPT两种分区表。
命令1:格式化sdb1分区为ext3格式
mkfs.ext3/dev/sdb1
mke2fs1.41.12(17-May-2010) 文件系统标签= 操作系统:Linux 块大小=4096(log=2) 分块大小=4096(log=2) Stride=0blocks,Stripewidth=0blocks 131072inodes,524288blocks 26214blocks(5.00%)reservedforthesuperuser 第一个数据块=0 Maximumfilesystemblocks=536870912 16blockgroups 32768blockspergroup,32768fragmentspergroup 8192inodespergroup Superblockbackupsstoredonblocks: 32768,98304,163840,229376,294912
正在写入inode表:完成
Creatingjournal(16384blocks):完成 Writingsuperblocksandfilesystemaccountinginformation:完成 Thisfilesystemwillbeautomaticallycheckedevery24mountsor 180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
命令2:格式化sdb5分区为ext4格式
mkfs-text4/dev/sdb5
mke2fs1.41.12(17-May-2010) 文件系统标签= 操作系统:Linux 块大小=4096(log=2) 分块大小=4096(log=2) Stride=0blocks,Stripewidth=0blocks 131072inodes,524288blocks 26214blocks(5.00%)reservedforthesuperuser 第一个数据块=0 Maximumfilesystemblocks=536870912 16blockgroups 32768blockspergroup,32768fragmentspergroup 8192inodespergroup Superblockbackupsstoredonblocks: 32768,98304,163840,229376,294912 正在写入inode表:完成 Creatingjournal(16384blocks):完成 Writingsuperblocksandfilesystemaccountinginformation:完成 Thisfilesystemwillbeautomaticallycheckedevery20mountsor 180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
p.s.
MBR分区表磁盘中的扩展分区不能格式化,即只能格式化主分区和逻辑分区;
格式化操作是即时生效的,不需要重启Linux系统,但此时用df命令并不能查看到磁盘的文件系统和类型,原因是还没有进行挂载。
df-hT/dev/sdb1 FilesystemTypeSizeUsedAvailUse%Mountedon --492M260K491M1%/dev
总结
以上所述是小编给大家介绍的Linux分区格式化的命令,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!