Cinder volume 挂载

在GNU/Linux环境中,使用命令列出可挂载的块设备,找到刚附加的Cinder Volume。对其进行格式化并挂载到指定目录,如/home/k8s,若该目录已使用,可通过软链接方式扩容,将原有目录移动到新挂载点并创建软连接,确保原有路径仍可访问。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值