nix-community / nix-community/disko

btrfs example and enabling compression failing

Open
#331 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Nix
Stars
3.3k
Forks
332
Avg merge
1d 11h
Merged PRs (30d)
1

Description

https://github.com/nix-community/disko/blob/4eed2457b053c4bbad7d90d2b3a1d539c2c9009c/example/btrfs-subvolumes.nix#L31

The /rootfs subvolume is the first mounted in this example, and it does not have compression enabled so the device will not have compression enabled by btrfs. The following subvolumes will fail to enable compression with the mount script disko creates/uses.

See: https://github.com/numtide/nixos-anywhere/issues/188

When installing with nixos-anywhere the install will not be compressed. Once the system is installed and rebooted, compression is correclty enabled on the whole device.

So there are a couple things:

  1. The example should be updated

  2. Since mount silently fails to enable compression when mounting a fs with the option if the device is already mounted with it disabled (mount exits with 0 in this case).

Should the disko mount script verify the mount options that were requested are in fact set?

In this example it can -o remount the subvolume mount and it will cause the device to be remounted with compression enabled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with example/btrfs-subvolumes.nix at line 31 and reproduce the installation behavior described with nixos-anywhere. Then trace the disko mount script that handles the subvolume options, checking the linked nixos-anywhere issue for context. Done means the example enables compression during installation and the mount behavior verifies or successfully applies the requested options.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.