5.7. 高度なパーティションを使用したイメージモード RHEL のディスクイメージのビルド
bootc-image-builder
を使用して、高度なパーティションを使用したイメージモードのディスクイメージを作成します。カスタムマウントポイントを使用してイメージモード RHEL から作成するイメージモードのディスクイメージには、カスタムマウントオプション、LVM ベースのパーティション、および LVM ベースの SWAP が含まれます。これにより、たとえば、config.toml
ファイルを使用して /
および /boot
ディレクトリーのサイズを変更できます。ベアメタルマシンに RHEL Image Mode をインストールすると、Anaconda で利用可能なすべてのパーティション機能を活用できます。
前提条件
- ホストマシンに Podman がインストールされている。
-
ホストマシンに
virt-install
がインストールされている。 -
bootc-image-builder
ツールを実行し、コンテナーを--privileged
モードで実行して、イメージをビルドするための root アクセスがある。
手順
config.toml
を作成してカスタムマウントオプションを設定します。次に例を示します。name = "lvm" description = "A base system with custom LVM partitioning" [customizations.disk] [[customizations.disk.partitions]] mountpoint = "/var/data" minsize = "1 GiB" label = "data" fs_type = "ext4" [[customizations.disk.partitions]] mountpoint = "/" minsize = "2 GiB" label = "root" fs_type = "ext4"
name = "lvm" description = "A base system with custom LVM partitioning" [customizations.disk] [[customizations.disk.partitions]] mountpoint = "/var/data" minsize = "1 GiB" label = "data" fs_type = "ext4" [[customizations.disk.partitions]] mountpoint = "/" minsize = "2 GiB" label = "root" fs_type = "ext4"
Copy to Clipboard Copied! config.toml
を引数として渡して、bootc-image-builder
を実行します。注記コンテナーストレージマウントおよび --local イメージオプションがない場合は、イメージをパブリックにする必要があります。
sudo podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v ./config.toml:/config.toml \ -v ./output:/output \ registry.redhat.io/rhel9/bootc-image-builder:latest \ --type <image_type>\ --config config.toml \ quay.io/<namespace>/<image>:<tag>
$ sudo podman run \ --rm \ -it \ --privileged \ --pull=newer \ --security-opt label=type:unconfined_t \ -v ./config.toml:/config.toml \ -v ./output:/output \ registry.redhat.io/rhel9/bootc-image-builder:latest \ --type <image_type>\ --config config.toml \ quay.io/<namespace>/<image>:<tag>
Copy to Clipboard Copied! カスタマイズした高度なパーティションを使用したイメージが、出力フォルダーに保存されます。