格式化文件类型: mkfs.[文件格式] [设备]
[root@shu001 ~]# mkfs.xfs /dev/sdb3 mkfs.xfs: /dev/sdb3 appears to contain a partition table (dos). mkfs.xfs: Use the -f option to force overwrite. [root@shu001 ~]# mkfs.xfs -f /dev/sdb3 meta-data=/dev/sdb3 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@shu001 ~]# blkid /dev/sdb3 /dev/sdb3: UUID="c890c488-0732-4a58-930c-391a9de5bce9" TYPE="xfs"
查看文件类型:blkid [设备]
[root@shu001 ~]# blkid /dev/sdb3 /dev/sdb3: UUID="c890c488-0732-4a58-930c-391a9de5bce9" TYPE="xfs"
挂载格式:mount [设备] [挂载目录]
[root@shu001 ~]# mount /dev/sdb2 /mnt/ [root@shu001 ~]# df -h | grep -v tmpfs 文件系统 容量 已用 可用 已用% 挂载点 /dev/sda3 28G 1.3G 27G 5% / /dev/sda1 197M 97M 100M 50% /boot /dev/sdb2 2.0G 33M 2.0G 2% /mnt
# 查看磁盘挂载情况 lsblk -ip # 查看磁盘使用挂载情况 df -h # 查看磁盘使用情况 fdisk
# 查看磁盘的UUID blkid /dev/sdb # 编辑 /etc/fstab, 将UUID写入 vim /etc/fstab