格式化磁盘
格式化磁盘
=============================
mkfs.xfs命令
NAME
mkfs.xfs - construct an XFS filesystem
(构建一个XFS文件系统)
示例:
[root@aminglinux ~]# fdisk -l /dev/sdb
磁盘 /dev/sdb:10.7 GB, 10737418240 字节,20971520 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x3326d135
设备 Boot Start End Blocks Id System
/dev/sdb1 2048 4196351 2097152 83 Linux
/dev/sdb2 4196352 8390655 2097152 83 Linux
/dev/sdb3 8390656 20971519 6290432 5 Extended
/dev/sdb5 8392704 9416703 512000 83 Linux
/dev/sdb6 9418752 11515903 1048576 83 Linux
[root@aminglinux ~]# mkfs.xfs /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=131072 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=524288, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@aminglinux ~]# blkid /dev/sdb1
/dev/sdb1: UUID="d7fd68fc-4a24-43ad-9404-c3c2f2abbe4d" TYPE="xfs"
[root@aminglinux ~]# mkfs.xfs -L APP /dev/sdb2 //-L,预设该分区的标签(Label)
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=131072 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=524288, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@aminglinux ~]# blkid /dev/sdb2
/dev/sdb2: LABEL="APP" UUID="8d6e18fc-dd7e-4451-b623-ba9a6cb5e2a1" TYPE="xfs"
mke2fs
NAME
mke2fs - create an ext2/ext3/ext4 filesystem
(创建一个ext2 / ext3 / ext4文件系统)
示例:
[root@aminglinux ~]# mke2fs -t ext4 /dev/sdb5 //-t,用来指定文件系统的类型。
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=1024 (log=0)
分块大小=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
第一个数据块=1
Maximum filesystem blocks=34078720
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (8192 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
[root@aminglinux ~]# mke2fs -t ext4 -L BACKUP /dev/sdb6
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=BACKUP
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (8192 blocks): 完成
Writing superblocks and filesystem accounting information: 完成