Last active
July 14, 2022 04:49
-
-
Save mskarbek/b766dc2f19d46ce0d001f64c75d1637b to your computer and use it in GitHub Desktop.
create pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gen_pool_uuid { | |
while true; do | |
POOL_UUID=$(cat /proc/sys/kernel/random/uuid) | |
if [[ $POOL_UUID =~ ^([a-b]|[d-z]).* ]]; then | |
echo $POOL_UUID | |
break | |
fi | |
done | |
} | |
POOL_NAME=$(gen_pool_uuid) | |
zpool create -f\ | |
-o ashift=12\ | |
-O acltype=posixacl\ | |
-O compression=lz4\ | |
-O dnodesize=auto\ | |
-O utf8only=on\ | |
-O normalization=formD\ | |
-O relatime=on\ | |
-O xattr=sa\ | |
-O mountpoint=none\ | |
-O canmount=off\ | |
-O checksum=sha256\ | |
-R /run/${POOL_NAME}\ | |
${POOL_NAME}\ | |
mirror\ | |
/dev/disk/by-partuuid/7170bae6-d035-49c9-8149-635743a5c7e6\ | |
/dev/disk/by-partuuid/22590fdd-ed7c-4502-8eba-dd6a6c72f52b | |
zfs create -o mountpoint=/ ${POOL_NAME}/datafs | |
zfs create -o mountpoint=/home -o setuid=off ${POOL_NAME}/userfs | |
zfs create ${POOL_NAME}/rootfs | |
zfs create -o canmount=off -o setuid=off -o exec=off ${POOL_NAME}/datafs/var | |
zfs create -o canmount=off ${POOL_NAME}/datafs/var/lib | |
zfs create ${POOL_NAME}/datafs/var/lib/containers | |
zfs create ${POOL_NAME}/datafs/var/lib/volumes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment