Sophos UTMのEBSストレージを拡張する

AWS環境でSophos UTMをデフォルトのEBS容量より多くして起動する場合、UTMでストレージ拡張の操作が必要になります。拡張して起動する手順をご紹介します。
2019.08.14

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

AWS環境でSophos UTMをデフォルトのEBS容量より多くして起動する場合、UTMでストレージ拡張の操作が必要になります。拡張して起動する手順をご紹介します。

UTMの起動

Sophos UTMはAWS Marketplaceから起動します。ライセンス持ち込み(BYOL)かライセンス込みかなどでURLが異なります。

EC2コンソールから起動すると、EBSのデフォルト容量が100GBであることがわかります。今回は200GBを指定して起動しました。

WebAdmin(https://UTMのIPアドレス:4444/)に接続するとホスト名やパスワードなどの設定を求められます。入力すると再起動されるので、40秒ほど待ちます。完了すると、ログイン画面が表示されるので、マネジメント>webAdmin設定>WebAdmin言語で日本語に切り替えます。

ストレージ容量の確認

WebAdminの"ログのレポート"から、UTMが認識しているストレージサイズが100GBであることがわかります。AWSコンソールでは200GBを指定したものの、100GB分が認識できていません。

ストレージの拡張

UTMのコマンドライン操作を行い、200GBを認識させます。手順はSophos UTM on AWS: UTM ルート EBS ボリュームの容量を増やす手順の通りです。

ユーザーloginuserでSSH接続し、sudo suでrootユーザーに昇格します。

$ ssh -i EC2作成時に指定したキー loginuser@UTMのIPアドレス
Last login: Wed Aug 14 06:02:26 2019 from xxxxxxxxxxxxxx


Sophos UTM
(C) Copyright 2000-2018 Sophos Limited and others. All rights reserved.
Sophos is a registered trademark of Sophos Limited and Sophos Group.
All other product and company names mentioned are trademarks or registered
trademarks of their respective owners.

For more copyright information look at /doc/astaro-license.txt
or http://www.astaro.com/doc/astaro-license.txt

NOTE: If not explicitly approved by Sophos support, any modifications
      done by root will void your support.

loginuser@ec2-xx-xxx-xxx-231:/home/login > sudo su
ec2-xx-xxx-xxx-231:/home/login #

lsblkコマンドを実行すると、パーティションxvda1が100GBになっていることがわかります。

ec2-xx-xxx-xxx-231:/home/login # lsblk
NAME    MAJ:MIN RM   SIZE RO MOUNTPOINT
xvda    202:0    0   200G  0
└─xvda1 202:1    0   100G  0 /
ec2-xx-xxx-xxx-231:/home/login #

fdisk /dev/xvdaコマンドを実行し、deleteでパーティションを削除します。new>p>1でプライマリパーティションを作成します。First sectorとLast sectorはEnterを入力します。

ec2-xx-xxx-xxx-231:/home/login # fdisk /dev/xvda

Command (m for help): delte
Selected partition 1

Command (m for help): new
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-419430399, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399):
Using default value 419430399

Command (m for help):

a>1で起動可能なフラグを設定します。

Command (m for help): a
Partition number (1-4): 1

wqで終了します。

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
ec2-xx-xxx-xxx-231:/home/login #

EC2コンソールから、stop、startします。WebAdminの"ログのレポート"を確認すると、200GB認識されています。

まとめ

AWS環境でSophos UTMをデフォルトのEBS容量より多くして起動する場合、UTMでストレージ拡張の操作が必要になります。執筆時点では100GBがデフォルトでしたが、200GBを指定して起動したところ、100GBを認識した状態で起動しました。コマンドラインからパーティションを作り直すことで200GBを認識できました。

参考