diff --git a/sh/debian/ubuntu/configure.sh b/sh/debian/ubuntu/configure.sh index 1948ea7e..52b7a5fc 100755 --- a/sh/debian/ubuntu/configure.sh +++ b/sh/debian/ubuntu/configure.sh @@ -388,10 +388,22 @@ cd $script_dir rm -rf /tmp/system if ! test -v PERSISTENT; then - sgdisk -n0:0:+32G "$disk" - sgdisk -N0 "$disk" - sgdisk -c3:01-tmp-home "$disk" - sgdisk -c4:01-tmp-system "$disk" + sgdisk --new 0:0:+32G "$disk" + sgdisk --new 0:0:+32G "$disk" + sgdisk --largest-new 0 "$disk" + sgdisk --change-name 3:01-tmp-home "$disk" + sgdisk --change-name 4:01-docker "$disk" + sgdisk --change-name 5:01-tmp-system "$disk" + + # Add Docker persistent partition + mkfs.ext4 -E lazy_journal_init,lazy_itable_init=0 /dev/disk/by-partlabel/01-docker + echo 'PARTLABEL=01-docker /var/lib/docker ext4 noatime,errors=remount-ro 0 2' >> /etc/fstab + systemctl stop docker.service containerd.service + mv /var/lib/docker /tmp + mkdir /var/lib/docker + mount /dev/disk/by-partlabel/01-docker + mv /tmp/docker/* /var/lib/docker + umount /var/lib/docker # Remove fsck because the system partition will be read-only (overlayroot) rm /usr/share/initramfs-tools/hooks/fsck @@ -407,9 +419,6 @@ if ! test -v PERSISTENT; then # Disable user password passwd -d student - # Enable docker relocation - systemctl enable mount-docker - # Remove tty cat <<-"EOF">> /etc/systemd/logind.conf NAutoVTs=0 diff --git a/sh/debian/ubuntu/system/etc/systemd/system/mount-docker.service b/sh/debian/ubuntu/system/etc/systemd/system/mount-docker.service deleted file mode 100644 index 0ad039af..00000000 --- a/sh/debian/ubuntu/system/etc/systemd/system/mount-docker.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Docker relocation -Before=docker.service - -[Service] -ExecStart=/usr/local/bin/mount-docker.sh -Type=oneshot - -[Install] -RequiredBy=docker.service diff --git a/sh/debian/ubuntu/system/usr/local/bin/mount-docker.sh b/sh/debian/ubuntu/system/usr/local/bin/mount-docker.sh deleted file mode 100755 index 52fdeea7..00000000 --- a/sh/debian/ubuntu/system/usr/local/bin/mount-docker.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Unofficial Bash Strict Mode -set -euo pipefail -IFS=' -' - -cp -a /var/lib/docker /tmp -mount -t tmpfs -osize=2G tmpfs /var/lib/docker -mv /tmp/docker/* /var/lib/docker