Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

old_roots (as created in the example script in the README.md file) is a mystery. #258

Open
quasipedia opened this issue Feb 14, 2025 · 1 comment

Comments

@quasipedia
Copy link

I'm not sure if this is:

  • An issue with the example in the README.md file (script not working)
  • An issue with the documentation (script working, but non-obvious second step)
  • An issue between the chair and the keyboard (that is to say: I'm failing to see the obvious)

However:

It appears that old_roots is not being populated, or that retriving its content is not as trivial as one (or at least somebody new to NixOS like me), would expect.

By reading the script, I expected /old_roots to be a directory in the FS at the same level than /nix or /persist, with sub-entries named root-<time&date>. However such directory is not there, nor there is an unmounted subvolume showing up with lsblk...

I have put echo and sleep statements in the script to make sure the issue was not the script not running, and I can confirm that the script enter the if clause below:

if [[ -e /btrfs_tmp/root ]]; then
    mkdir -p /btrfs_tmp/old_roots
    timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
    mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi

Is it me who am not understanding (in which case sorry for taking your time) or is there a real issue with the example provided?

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/boot-initrd-postdevicecommands-not-executed-by-nixos/48891/6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants