刚开始 不懂,随便找个博客将 数据盘 格式化为 ext3 , 考虑到潜在的问题,考虑 升级到 ext 4.
// ext3 升级到 ext4
[root@hdp02 ~]# tune2fs -O extents,uninit_bg,dir_index /dev/xvdb1
tune2fs 1.42.9 (28-Dec-2013)
// 磁盘扫描
[root@hdp02 ~]# fsck -pf /dev/xvdb1
fsck from util-linux 2.23.2
/dev/xvdb1: 10091/131072000 files (6.6% non-contiguous), 16652110/524287744 blocks
[root@hdp02 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 40G 0 disk
└─xvda1 202:1 0 40G 0 part /
xvdb 202:16 0 2T 0 disk
└─xvdb1 202:17 0 2T 0 part
// 查看数据盘是否格式化
[root@hdp02 ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
xvda
└─xvda1 ext4 eb697457-a097-4263-8bbf-a75aa632d27c /
xvdb
└─xvdb1 ext4 b6dc8e3f-fbad-4847-aa6b-f7041496adda
[root@hdp02 ~]# fdisk -l
Disk /dev/xvda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008e3b4
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 83886079 41942016 83 Linux
Disk /dev/xvdb: 2147.5 GB, 2147483648000 bytes, 4194304000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa9732a67
Device Boot Start End Blocks Id System
/dev/xvdb1 2048 4194303999 2097150976 83 Linux
// 磁盘挂载
[root@hdp02 ~]# mount -t ext4 /dev/xvdb1 /var
// 查看挂载是否成功
[root@hdp02 ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 40G 2.2G 36G 6% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 300K 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
tmpfs 3.2G 0 3.2G 0% /run/user/0
/dev/xvdb1 2.0T 32G 1.8T 2% /var