OracleCloud VPSにブロックストレージを追加

Matrixの文章を見ていたらOracleのサービスで200GBまでストレージが使えそうなのに気づきました.

表 1. Free Matrix Server using Oracle Cloud | Matrix.org 🏛️
VendorTime-limitCountRAM (GB)Storage (GB)Transfer (GB)

AWS

12 months

1 t2.micro

1

30

15

Azure

12 months

1 B1S

1

2x 64

15

GCP

no limit

1 e2-micro

1

30

1

Oracle

no limit

1-4 VM.Standard.A1.Flex

24

200

10000

公式ページを見ても200GB使えそうです.

2つのBlock Volumeストレージ、合計200 GB。

現在は50GB程x2利用しているのであと100GB使えそうです.試してみました.


https://cloud.oracle.com/ 🏛️ からログインして,「ストレージ」→「ブロック・ボリューム」から,「ブロック・ボリュームの作成」を行います.

そこで「名前」に「任意の名前」,ボリューム・サイズとパフォーマンス → カスタム,ボリューム・サイズ(GB)に「100GB」を設定.

左下の「リソース」,「メトリック」→「アタッチされたインスタンス」から「ブロック・ボリュームのアタッチ」で既存のインスタンスニアタッチします.
ここでは「ボリュームの選択」→「上で作成したボリューム」,「アタッチメント・タイプ」→「準仮想化」,「アクセス」→「読取り/書込み」,「デバイス・パス」→「/dev/oracleoci/oraclevdb」
という感じで設定しました.

(スクリーンショットを取得してなかったので大雑把です……)

この状態でインスタンを確認するとデバイス( /dev/oracleoci/oraclevdb )が出来ていました. /dev/sdb にシンボリックリンクがはられています.

$ ls /dev/oracleoci/oraclevdb
/dev/oracleoci/oraclevdb
$ ls -l /dev/sdb /dev/oracleoci/oraclevdb
lrwxrwxrwx 1 root root     6 Jun 28 12:57 /dev/oracleoci/oraclevdb -> ../sdb
brw-rw---- 1 root disk 8, 16 Jun 28 12:57 /dev/sdb

後は普通のLinuxなのでパーティションを切って,フォーマットしてマウントします.

$ sudo fdisk -l /dev/oracleoci/oraclevdb (1)
Disk /dev/oracleoci/oraclevdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: BlockVolume
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
$ sudo fdisk /dev/oracleoci/oraclevdb (2)

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x130d310a.

Command (m for help): n (3)
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p (4)
Partition number (1-4, default 1): (5)
First sector (2048-209715199, default 2048): (6)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-209715199, default 209715199): (7)

Created a new partition 1 of type 'Linux' and of size 100 GiB.

Command (m for help): p (8)
Disk /dev/oracleoci/oraclevdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: BlockVolume
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disklabel type: dos
Disk identifier: 0x130d310a

Device                    Boot Start       End   Sectors  Size Id Type
/dev/oracleoci/oraclevdb1       2048 209715199 209713152  100G 83 Linux

Command (m for help): w (9)
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

$ sudo mkfs.ext4 /dev/oracleoci/oraclevdb1 (10)
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 26214144 4k blocks and 6553600 inodes
Filesystem UUID: dbc5f8b5-5f38-4246-9f41-6003e1f5d1fb
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

$ sudo mkdir /export (11)
$ sudo mount /dev/oracleoci/oraclevdb1 /export (12)
$ df -H | grep -vE "loop|tmpfs|udev" (13)
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        49G   29G   20G  60% /
/dev/sda15      103M  297k  102M   1% /boot/efi
/dev/sdb1       106G   63M  100G   1% /export
$ sudo umount /export (14)
$ echo "/dev/sdb1        /export ext4    defaults        0 1" | sudo tee -a /etc/fstab (15)
/dev/sdb1       /export ext4    defaults        0 1
$ sudo mount -a (16)
$ df -H | grep -vE "loop|tmpfs|udev" (17)
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        49G   29G   20G  60% /
/dev/sda15      103M  297k  102M   1% /boot/efi
/dev/sdb1       106G   63M  100G   1% /export
  1. diskの確認
  2. パーティションの設定
  3. n で新しいパーティション作成
  4. p でプライマリパーティション作成
  5. パーティション番号を Enter で規定値の 1
  6. 先頭セクタを Enter で規定値の 2048
  7. 終了セクタを Enter で規定値の 209715199 (全領域)
  8. p でパーティション設定確認
  9. w でパーティション書き込み
  10. ext4の既定値でフォーマット
  11. マウントポイント作成
  12. マウント
  13. 容量確認
  14. アンマウント
  15. /etc/fatab を設定
  16. fstab を使ってマウント
  17. マウント確認

後は普通に使えるはずです.

ということでarm64 4core, 24GB RAN, Disk 150GBな無料VPSができました.amd64のインスタンスを削除すればDisk 200GBにもできるはずです.
これが無料で使えるのすごいですね.(いつ使えなくなってもおかしくはないだろうけど)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)