Oracle Cloud Oracle Cloud Boot Volume Expansion and Block Storage Volume Mounting

Original link:


Oracle Cloud’s storage service is called块存储卷, English Block Volume , which is actually the disk of conventional cloud service providers, which is divided into块存储卷and引导卷. This article will introduce the区别the two,挂载方式,磁盘额度and引导卷备份.

√> This article is an original article by Stille . It has been practiced, tested, and published. If you need to reprint, please contact the author for authorization, and indicate the reprint address.

Difference Between Block Storage and Boot Volume

block storage volume

Fast storage can be understood as创建一个新磁盘, attaching it to the instance (server), partitioning, formatting, and mounting it on a certain directory on the server, mainly for adding a new disk capacity to store data .

boot volume

The boot volume is the系统启动盘of the instance (server). Generally, the capacity of the system disk is selected when the instance is created. After adjusting the size of the boot volume, the existing system disk needs to be expanded in real time.

the difference

举例来说the above two disks can be understood as the hard disk of a desktop computer. Generally, the C disk is installed with Windows as the system disk. If the C disk is filled with data, cache, etc. during use, it is necessary to expand the boot volume to increase the size. The capacity of the C drive can be不影响当前系统运行的情况下扩容.

Practical use case: The blogger is a docker enthusiast, the default system disk is 50G , and the default data path of docker is in the boot disk. As the container continues to increase, the boot volume is almost full.此时使用引导卷扩容最为方便without stopping. Any service can expand the boot volume in real time.

Quick storage can be understood as购买了一块全新硬盘, installing it into the computer, formatting it under Windows , and partitioning it as D disk, which can store more非系统运行所需文件和数据.

x> is the same as the above case: in fact, it can also be solved by mounting a new block storage volume, but you need to stop all containers and migrate the docker home directory to the new block storage volume mounting path. The operation is relatively more troublesome and has to be stopped The transmission method and IO read speed of the mounted disk are also different from the boot disk, which is generally not recommended.

[scode type=”green”] Therefore,扩展引导卷mainly solves the lack of system disk capacity, while the块存储卷is recommended to store non-running data, such as regular backup data.[/scode]

About free user block storage volume quota and fees

Here’s an addition, according to the above, how many free servers can Oracle Cloud create? It is mentioned that each free user has a storage quota of 200G . If it is not used up, it can be used to create block storage volumes. It is necessary to adjust the performance of the目标卷性能adjustment will incur additional costs.

Block Storage Volume Creation and Mounting

Menu – Storage – Block Storage Volume – Create Block Storage Volume <br />Fill in the name and select the custom volume size.

After creation, click附加到实例

It is better to choose ISCSI by default.
If the access type is not shared by several servers at the same time, please keep the default读/写.
Select the instance you want to mount.
The path selection is the first one by default.

!> It is worth noting that the ISCSI mounting method belongs to network mounting. After mounting, the system read and write data will use the default network card to transmit through the intranet network. The intranet transmission is free, but some system traffic monitoring software, such as vnstat will This intranet traffic and public network traffic are counted together, please pay attention to distinguish it to avoid misunderstanding that the public network traffic is too large.

After attaching, click the ISCSI Commands and Information in the small dot on the right.

Copy additional commands

附加命令for logging in to the server to perform replication

Execute fdisk -l to see that there is a new disk of /dev/sdb

Execute the following command to start formatting the new disk partition

 fdisk /dev/sdb n # 按n 开始p # 选择p 为主要分区# 剩下的默认回撤w # 结尾输入w 来保存

Execute fdisk -l again to see that it has been partitioned as /dev/sdb1

Execute mkfs.ext4 /dev/sdb1 to format the disk.
If you need to format other partition formats, you can search for related commands online.

Create a directory, or mount to an existing directory, the example in this article is to create the /backup directory.

 mkdir /backup mount /dev/sdb1 /backup # 挂载磁盘到/backup

At this point, the /backup directory has the capacity of the 50G block storage volume created above.

Set the automatic mount at startup to ensure that the directory can be automatically mounted after the server restarts.

 vi /etc/fstab # 在最后一行添加/dev/sdb1 /backup ext4 defaults 0 0

Extend boot volume

Menu – Storage – Block Storage Volume – Click on Boot Volume on the left <br />As shown in the figure, I only used less than 150G of disk capacity, and I can expand the boot volume of one of the instances to 100GB .

Click on the boot volume that needs to be expanded, edit at the point, modify the volume size to 100GB , keep the default performance of the target volume, and save it.

Copy the scan command that pops up.

Log in to the server and execute lsblk to see the entire default system disk, that is, the boot volume is 46.6G , of which sda3 is the capacity of the system root directory, and we need to expand it.

Execute the scan command just copied, execute lsblk again, and find that the entire boot volume sda ​​has become 100G , but the sda3 root directory is still the previous capacity.

Continue to execute the following commands to expand it. Enter y when prompted to Confirm .

 LANG=en_US.UTF-8 sudo /usr/libexec/oci-growfs # 提示Confirm 时输入y

Execute the lsblk check again, and the sda3 system disk has been successfully expanded.

After the boot volume is expanded to 100G , it does not exceed the limit of 200G , so it still shows that始终免费.

Boot volume backup

The boot volume backup of Oracle Cloud should be similar to the快照service of conventional cloud service providers. The blogger has only tested the创建of multiple snapshots, and they all show that始终免费, and there is no additional cost in the bill. However, I have没有测试过恢复备份, everyone. You can try it yourself.

Menu – Storage – Block Storage Volume – Boot Volume <br /> Right menu click Create Manual Backup

Fill in the name to select the backup type

Always free backups can be seen on the Boot Volume Backups page


For more Oracle Cloud related skills, tutorials and information, please continue to pay attention to the Oracle Cloud Oracle Cloud series of articles:

[button color=”success” icon=”glyphicon glyphicon-tasks” url=””]Oracle Cloud Oracle Cloud series articles summary[/button]

This article is reprinted from:
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment