Cinder volume 挂载

GNU/Linux

From a shell issue the lsblk command, this will list the block devices you can use:

admin@mariadb:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
vda    253:0    0   160G  0 disk
└─vda1 253:1    0   160G  0 part /
vdb    253:16   0   9.8T  0 disk

The device /dev/vda is the root disk of your system. It has one partition called /dev/vda1 filling all the space. Then you can see /dev/vdb which is the volume you just attached.

In order to be able to use it you need to format it and mount it somewhere.
This is easily done with:

admin@mariadb:~$ sudo mkfs.ext4 /dev/vdb
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

admin@mariadb:~$ sudo mkdir /storage

admin@mariadb:~$ sudo mount /dev/vdb /storage

admin@mariadb:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       158G  1.1G  150G   1% /
/dev/vdb        9.7T   38M  9.3T   1% /strorage

You can now store your files on the directory /storage.

对已经使用的目录使用软链接的方式扩容:

cd /home

mv k8s /storage/

ln -s /storage/k8s /home/k8s

这样就建立了一个软连接

cd /home/k8s 实际上进入的是/storage/k8s

猜你喜欢

转载自blog.csdn.net/niekunhit/article/details/51577133