Skip to content

Instantly share code, notes, and snippets.

@AnatomicJC
Last active December 14, 2023 00:33
Show Gist options
  • Save AnatomicJC/897e0e65973df1a777427ad9c1c6f0e3 to your computer and use it in GitHub Desktop.
Save AnatomicJC/897e0e65973df1a777427ad9c1c6f0e3 to your computer and use it in GitHub Desktop.

Revisions

  1. AnatomicJC revised this gist Sep 12, 2019. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions zfs-docker.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,7 @@ Add the mount to /etc/fstab:
    $ cat /etc/fstab
    /dev/zvol/rpool/docker /var/lib/docker ext4 noatime,data=writeback,barrier=0,nobh,errors=remount-ro 0 1

    Ref:
    https://github.com/rancher/k3s/issues/66#issuecomment-520183720
    https://blog.smartlogic.io/2009-06-04-rails-development-mount-options-to-improve-ext4-file-system-performance/
    Ref:

    * https://github.com/rancher/k3s/issues/66#issuecomment-520183720
    * https://blog.smartlogic.io/2009-06-04-rails-development-mount-options-to-improve-ext4-file-system-performance/
  2. AnatomicJC renamed this gist Sep 12, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. AnatomicJC revised this gist Sep 12, 2019. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions zfs-docker.txt
    Original file line number Diff line number Diff line change
    @@ -8,11 +8,14 @@ formatting that volume to ext4, and having docker use "overlay2" on top of that,

    zfs create -s -V 30G rpool/docker
    mkfs.ext4 /dev/zvol/rpool/docker
    tune2fs -o journal_data_writeback /dev/zvol/rpool/docker
    mount /dev/zvol/rpool/docker /var/lib/docker

    Add the mount to /etc/fstab:

    $ cat /etc/fstab
    /dev/zvol/rpool/docker /var/lib/docker ext4 defaults 0 0
    /dev/zvol/rpool/docker /var/lib/docker ext4 noatime,data=writeback,barrier=0,nobh,errors=remount-ro 0 1

    Ref: https://github.com/rancher/k3s/issues/66#issuecomment-520183720
    Ref:
    https://github.com/rancher/k3s/issues/66#issuecomment-520183720
    https://blog.smartlogic.io/2009-06-04-rails-development-mount-options-to-improve-ext4-file-system-performance/
  4. AnatomicJC revised this gist Sep 11, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion zfs-docker.txt
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,6 @@ formatting that volume to ext4, and having docker use "overlay2" on top of that,
    Add the mount to /etc/fstab:

    $ cat /etc/fstab
    /dev/zvol/rpool/docker /var/lib/docker ext4 defaults 0 0
    /dev/zvol/rpool/docker /var/lib/docker ext4 defaults 0 0

    Ref: https://github.com/rancher/k3s/issues/66#issuecomment-520183720
  5. AnatomicJC revised this gist Sep 11, 2019. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion zfs-docker.txt
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,15 @@ Create a dedicated ZFS docker pool with deduplication disabled in case of dedup

    zfs create -o mountpoint=/var/lib/docker -o dedup=off rpool/docker

    Sometimes, you don't want ZFS for docker storage. ZFS is sadly quite painful with Docker in Docker and similar scenarios. It might be best to avoid the problem by creating a volume in your ZFS pool, formatting that volume to ext4, and having docker use "overlay2" on top of that, instead of "zfs".
    Sometimes, you don't want ZFS for docker storage. ZFS can be sadly quite painful with Docker in Docker
    and similar scenarios. It might be best to avoid the problem by creating a volume in your ZFS pool,
    formatting that volume to ext4, and having docker use "overlay2" on top of that, instead of "zfs".

    zfs create -s -V 30G rpool/docker
    mkfs.ext4 /dev/zvol/rpool/docker
    mount /dev/zvol/rpool/docker /var/lib/docker

    Add the mount to /etc/fstab:

    $ cat /etc/fstab
    /dev/zvol/rpool/docker /var/lib/docker ext4 defaults 0 0
  6. AnatomicJC created this gist Sep 11, 2019.
    5 changes: 5 additions & 0 deletions zfs-docker.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    Create a dedicated ZFS docker pool with deduplication disabled in case of dedup enabled on your system:

    zfs create -o mountpoint=/var/lib/docker -o dedup=off rpool/docker

    Sometimes, you don't want ZFS for docker storage. ZFS is sadly quite painful with Docker in Docker and similar scenarios. It might be best to avoid the problem by creating a volume in your ZFS pool, formatting that volume to ext4, and having docker use "overlay2" on top of that, instead of "zfs".