1. 程式人生 > >mkfs磁盤格式化命令

mkfs磁盤格式化命令

linux命令

磁盤格式化是為了寫入文件系統。man mkfs

mkfs - build a Linux file system

mkfs [-t filesysterm] 設備文件名

或者使用mkfs.ext4 設備文件名格式化分區。


[root@www ~]# fdisk -l

Disk /dev/sdd: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xdcb315ff


Device Boot Start End Blocks Id System

/dev/sdd1 1 50 401593+ 83 Linux

/dev/sdd2 51 130 642600 5 Extended

/dev/sdd5 51 80 240943+ 83 Linux

/dev/sdd6 81 130 401593+ 83 Linux


mkfs -t ext4

[root@www ~]# mkfs -t ext4 /dev/sdd1

mke2fs 1.41.12 (17-May-2010)

警告: 183 塊未使用.


文件系統標簽=

操作系統:Linux

塊大小=1024 (log=0)

分塊大小=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

100744 inodes, 401409 blocks

20079 blocks (5.00%) reserved for the super user

第一個數據塊=1

Maximum filesystem blocks=67633152

49 block groups

8192 blocks per group, 8192 fragments per group

2056 inodes per group

Superblock backups stored on blocks:

8193, 24577, 40961, 57345, 73729, 204801, 221185


正在寫入inode表: 完成

Creating journal (8192 blocks): 完成

Writing superblocks and filesystem accounting information: 完成


This filesystem will be automatically checked every 21 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.


mkfs.ext4

[root@www ~]# mkfs.ext4 /dev/sdd5

mke2fs 1.41.12 (17-May-2010)

文件系統標簽=

操作系統:Linux

塊大小=1024 (log=0)

分塊大小=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

60240 inodes, 240940 blocks

12047 blocks (5.00%) reserved for the super user

第一個數據塊=1

Maximum filesystem blocks=67371008

30 block groups

8192 blocks per group, 8192 fragments per group

2008 inodes per group

Superblock backups stored on blocks:

8193, 24577, 40961, 57345, 73729, 204801, 221185


正在寫入inode表: 完成

Creating journal (4096 blocks): 完成

Writing superblocks and filesystem accounting information: 完成


This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

[root@www ~]#


mkfs磁盤格式化命令