1、查看已挂载好的磁盘,命令:df -h
> df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs 7.9G 416K 7.9G 1% /run
tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/xvda1 50G 1.6G 49G 4% /
tmpfs 1.6G 0 1.6G 0% /run/user/1000
2、列出可用磁盘,命令:lsblk -l
> lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 50G 0 disk
xvda1 202:1 0 50G 0 part /
xvdb 202:16 0 500G 0 disk
3、找到为挂载的磁盘xvdb
并格式化磁盘,命令:sudo mkfs.xfs -f /dev/xvdb
> sudo mkfs.xfs -f /dev/xvdb
meta-data=/dev/xvdb isize=512 agcount=4, agsize=32768000 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0
data = bsize=4096 blocks=131072000, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=64000, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
4、将磁盘挂载到指定目录位置,命令:sudo mount -t xfs /dev/xvdb /home/zxb
> sudo mount -t xfs /dev/xvdb /home/zxb
5、查看挂载是否成功,命令:df -h
> df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs 7.9G 416K 7.9G 1% /run
tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/xvda1 50G 1.6G 49G 4% /
tmpfs 1.6G 0 1.6G 0% /run/user/1000
/dev/xvdb 500G 543M 500G 1% /home/zxb
网友评论