Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

ZFS on GEOM ELI on ZVOL

More than 3 years have passed since last update.

ZFSのZVOLで作ったブロックデバイスをGEOM ELI(geli)で暗号化してその上にZFSのpoolを作る

physical disk→ZFS→ZVOL→GEOM-ELI→ZFS

zvolの作成

% sudo zfs create -V 256m zroot/encvol

キーの作成

% openssl rand -out geli_key 64

初期化

% sudo geli init -s 4096 -K geli_key /dev/zvol/zroot/encvol
Enter new passphrase:
Reenter new passphrase:

Metadata backup can be found in /var/backups/zvol_zroot_encvol.eli and
can be restored with the following command:

        # geli restore /var/backups/zvol_zroot_encvol.eli /dev/zvol/zroot/encvol

アタッチ

% sudo geli  attach -k geli_key /dev/zvol/zroot/encvol
Enter passphrase: 

zpoolの作成

% sudo zpool create encpool /dev/zvol/zroot/encvol.eli
% sudo zfs set mountpoint=none encpool

再起動後

再起動するとデタッチされてるので

% zpool list
NAME      SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
encpool      -      -      -      -         -      -      -  FAULTED  -
zroot    1016M   431M   585M    31%         -    42%  1.00x  ONLINE  -

アタッチする

% sudo geli  attach -k geli_key /dev/zvol/zroot/encvol
Enter passphrase: 
% zpool list
NAME      SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
encpool   250M   528K   249M     2%         -     0%  1.00x  ONLINE  -
zroot    1016M   431M   585M    31%         -    42%  1.00x  ONLINE  -
suzukis
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away