Debian & Ubuntu: Rework dataset creation step

The major change for Ubuntu is to mark many of these as optional, like
with Debian and the old guides.  As I move away from zsys, this will end
up being more like the old way.

This was also discussed in #306 and #307, but this change has
trade-offs.  It can reduce the number of datasets created on the
system, but it does so by increasing the complexity to read and follow
the guide.

Then I just harmonized Debian with Ubuntu.  Aside from whitespace,
reordering, rewording, the substantive changes were to drop /opt and
add /var/lib/NetworkManager.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
This commit is contained in:
Richard Laager
2022-05-19 23:10:17 -05:00
parent 7343c2253f
commit db5c8c4785
3 changed files with 145 additions and 67 deletions

View File

@@ -439,70 +439,58 @@ Step 3: System Installation
#. Create datasets::
zfs create rpool/home
zfs create -o mountpoint=/root rpool/home/root
zfs create rpool/home
zfs create -o mountpoint=/root rpool/home/root
chmod 700 /mnt/root
zfs create -o canmount=off rpool/var
zfs create -o canmount=off rpool/var/lib
zfs create rpool/var/log
zfs create rpool/var/spool
zfs create -o canmount=off rpool/var
zfs create -o canmount=off rpool/var/lib
zfs create rpool/var/log
zfs create rpool/var/spool
The datasets below are optional, depending on your preferences and/or
software choices.
If you wish to exclude these from snapshots::
If you wish to separate these to exclude them from snapshots::
zfs create -o com.sun:auto-snapshot=false rpool/var/cache
zfs create -o com.sun:auto-snapshot=false rpool/var/tmp
zfs create -o com.sun:auto-snapshot=false rpool/var/cache
zfs create -o com.sun:auto-snapshot=false rpool/var/lib/nfs
zfs create -o com.sun:auto-snapshot=false rpool/var/tmp
chmod 1777 /mnt/var/tmp
If you use /opt on this system::
zfs create rpool/opt
If you use /srv on this system::
zfs create rpool/srv
zfs create rpool/srv
If you use /usr/local on this system::
zfs create -o canmount=off rpool/usr
zfs create rpool/usr/local
zfs create -o canmount=off rpool/usr
zfs create rpool/usr/local
If this system will have games installed::
zfs create rpool/var/games
zfs create rpool/var/games
If this system will store local email in /var/mail::
If this system will have a GUI::
zfs create rpool/var/mail
If this system will use Snap packages::
zfs create rpool/var/snap
If you use /var/www on this system::
zfs create rpool/var/www
If this system will use GNOME::
zfs create rpool/var/lib/AccountsService
zfs create rpool/var/lib/AccountsService
zfs create rpool/var/lib/NetworkManager
If this system will use Docker (which manages its own datasets &
snapshots)::
zfs create -o com.sun:auto-snapshot=false rpool/var/lib/docker
zfs create -o com.sun:auto-snapshot=false rpool/var/lib/docker
If this system will use NFS (locking)::
If this system will store local email in /var/mail::
zfs create -o com.sun:auto-snapshot=false rpool/var/lib/nfs
zfs create rpool/var/mail
Mount a tmpfs at /run::
If this system will use Snap packages::
mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
zfs create rpool/var/snap
If you use /var/www on this system::
zfs create rpool/var/www
A tmpfs is recommended later, but if you want a separate dataset for
``/tmp``::
@@ -521,6 +509,12 @@ Step 3: System Installation
to limit the maximum space used. Otherwise, you can use a tmpfs (RAM
filesystem) later.
#. Mount a tmpfs at /run::
mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
#. Install the minimal system::
debootstrap bullseye /mnt

View File

@@ -486,32 +486,77 @@ Step 3: System Installation
#. Create datasets::
zfs create -o com.ubuntu.zsys:bootfs=no \
rpool/ROOT/ubuntu_$UUID/srv
zfs create -o com.ubuntu.zsys:bootfs=no -o canmount=off \
rpool/ROOT/ubuntu_$UUID/usr
zfs create rpool/ROOT/ubuntu_$UUID/usr/local
zfs create -o com.ubuntu.zsys:bootfs=no -o canmount=off \
rpool/ROOT/ubuntu_$UUID/var
zfs create rpool/ROOT/ubuntu_$UUID/var/games
zfs create rpool/ROOT/ubuntu_$UUID/var/lib
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/AccountsService
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/apt
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/dpkg
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/NetworkManager
zfs create rpool/ROOT/ubuntu_$UUID/var/log
zfs create rpool/ROOT/ubuntu_$UUID/var/mail
zfs create rpool/ROOT/ubuntu_$UUID/var/snap
zfs create rpool/ROOT/ubuntu_$UUID/var/spool
zfs create rpool/ROOT/ubuntu_$UUID/var/www
zfs create -o canmount=off -o mountpoint=/ \
rpool/USERDATA
zfs create -o com.ubuntu.zsys:bootfs-datasets=rpool/ROOT/ubuntu_$UUID \
-o canmount=on -o mountpoint=/root \
rpool/USERDATA/root_$UUID
chmod 700 /mnt/root
If you want a separate dataset for ``/tmp``::
The datasets below are optional, depending on your preferences and/or
software choices.
If you wish to separate these to exclude them from snapshots::
zfs create rpool/ROOT/ubuntu_$UUID/var/cache
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/nfs
zfs create rpool/ROOT/ubuntu_$UUID/var/tmp
chmod 1777 /mnt/var/tmp
If desired (the Ubuntu installer creates these)::
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/apt
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/dpkg
If you use /srv on this system::
zfs create -o com.ubuntu.zsys:bootfs=no \
rpool/ROOT/ubuntu_$UUID/srv
If you use /usr/local on this system::
zfs create rpool/ROOT/ubuntu_$UUID/usr/local
If this system will have games installed::
zfs create rpool/ROOT/ubuntu_$UUID/var/games
If this system will have a GUI::
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/AccountsService
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/NetworkManager
If this system will use Docker (which manages its own datasets &
snapshots)::
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/docker
If this system will store local email in /var/mail::
zfs create rpool/ROOT/ubuntu_$UUID/var/mail
If this system will use Snap packages::
zfs create rpool/ROOT/ubuntu_$UUID/var/snap
If you use /var/www on this system::
zfs create rpool/ROOT/ubuntu_$UUID/var/www
For a mirror or raidz topology, create a dataset for ``/boot/grub``::
zfs create -o com.ubuntu.zsys:bootfs=no bpool/grub
A tmpfs is recommended later, but if you want a separate dataset for
``/tmp``::
zfs create -o com.ubuntu.zsys:bootfs=no \
rpool/ROOT/ubuntu_$UUID/tmp

View File

@@ -480,24 +480,13 @@ Step 3: System Installation
#. Create datasets::
zfs create -o com.ubuntu.zsys:bootfs=no \
rpool/ROOT/ubuntu_$UUID/srv
zfs create -o com.ubuntu.zsys:bootfs=no -o canmount=off \
rpool/ROOT/ubuntu_$UUID/usr
zfs create rpool/ROOT/ubuntu_$UUID/usr/local
zfs create -o com.ubuntu.zsys:bootfs=no -o canmount=off \
rpool/ROOT/ubuntu_$UUID/var
zfs create rpool/ROOT/ubuntu_$UUID/var/games
zfs create rpool/ROOT/ubuntu_$UUID/var/lib
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/AccountsService
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/apt
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/dpkg
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/NetworkManager
zfs create rpool/ROOT/ubuntu_$UUID/var/log
zfs create rpool/ROOT/ubuntu_$UUID/var/mail
zfs create rpool/ROOT/ubuntu_$UUID/var/snap
zfs create rpool/ROOT/ubuntu_$UUID/var/spool
zfs create rpool/ROOT/ubuntu_$UUID/var/www
zfs create -o canmount=off -o mountpoint=/ \
rpool/USERDATA
@@ -506,16 +495,60 @@ Step 3: System Installation
rpool/USERDATA/root_$UUID
chmod 700 /mnt/root
The datasets below are optional, depending on your preferences and/or
software choices.
If you wish to separate these to exclude them from snapshots::
zfs create rpool/ROOT/ubuntu_$UUID/var/cache
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/nfs
zfs create rpool/ROOT/ubuntu_$UUID/var/tmp
chmod 1777 /mnt/var/tmp
If desired (the Ubuntu installer creates these)::
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/apt
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/dpkg
If you use /srv on this system::
zfs create -o com.ubuntu.zsys:bootfs=no \
rpool/ROOT/ubuntu_$UUID/srv
If you use /usr/local on this system::
zfs create rpool/ROOT/ubuntu_$UUID/usr/local
If this system will have games installed::
zfs create rpool/ROOT/ubuntu_$UUID/var/games
If this system will have a GUI::
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/AccountsService
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/NetworkManager
If this system will use Docker (which manages its own datasets &
snapshots)::
zfs create rpool/ROOT/ubuntu_$UUID/var/lib/docker
If this system will store local email in /var/mail::
zfs create rpool/ROOT/ubuntu_$UUID/var/mail
If this system will use Snap packages::
zfs create rpool/ROOT/ubuntu_$UUID/var/snap
If you use /var/www on this system::
zfs create rpool/ROOT/ubuntu_$UUID/var/www
For a mirror or raidz topology, create a dataset for ``/boot/grub``::
zfs create -o com.ubuntu.zsys:bootfs=no bpool/grub
Mount a tmpfs at /run::
mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
A tmpfs is recommended later, but if you want a separate dataset for
``/tmp``::
@@ -534,6 +567,12 @@ Step 3: System Installation
to limit the maximum space used. Otherwise, you can use a tmpfs (RAM
filesystem) later.
#. Mount a tmpfs at /run::
mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
#. Install the minimal system::
debootstrap jammy /mnt