setting forceImportRoot to false
pytest / pytest (pull_request) Successful in 53s
treefmt / nix fmt (pull_request) Successful in 9s
build_systems / build-brain (pull_request) Successful in 2m33s
build_systems / build-bob (pull_request) Successful in 2m41s
build_systems / build-leviathan (pull_request) Successful in 3m22s
build_systems / build-rhapsody-in-green (pull_request) Successful in 3m32s
build_systems / build-jeeves (pull_request) Successful in 8m52s
build_systems / build-bob (push) Successful in 33s
treefmt / nix fmt (push) Successful in 6s
build_systems / build-brain (push) Successful in 31s
pytest / pytest (push) Successful in 26s
build_systems / build-leviathan (push) Successful in 41s
build_systems / build-rhapsody-in-green (push) Successful in 47s
build_systems / build-jeeves (push) Successful in 2m28s
pytest / pytest (pull_request) Successful in 53s
treefmt / nix fmt (pull_request) Successful in 9s
build_systems / build-brain (pull_request) Successful in 2m33s
build_systems / build-bob (pull_request) Successful in 2m41s
build_systems / build-leviathan (pull_request) Successful in 3m22s
build_systems / build-rhapsody-in-green (pull_request) Successful in 3m32s
build_systems / build-jeeves (pull_request) Successful in 8m52s
build_systems / build-bob (push) Successful in 33s
treefmt / nix fmt (push) Successful in 6s
build_systems / build-brain (push) Successful in 31s
pytest / pytest (push) Successful in 26s
build_systems / build-leviathan (push) Successful in 41s
build_systems / build-rhapsody-in-green (push) Successful in 47s
build_systems / build-jeeves (push) Successful in 2m28s
This commit was merged in pull request #3.
This commit is contained in:
@@ -23,7 +23,10 @@
|
|||||||
boot = {
|
boot = {
|
||||||
tmp.useTmpfs = true;
|
tmp.useTmpfs = true;
|
||||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_12;
|
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_12;
|
||||||
zfs.package = lib.mkDefault pkgs.zfs_2_4;
|
zfs = {
|
||||||
|
package = lib.mkDefault pkgs.zfs_2_4;
|
||||||
|
forceImportRoot = lib.mkDefault false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# ZFS failed root import recovery
|
||||||
|
|
||||||
|
## Fast path
|
||||||
|
|
||||||
|
If the machine fails to boot because ZFS refuses to import `root_pool`:
|
||||||
|
|
||||||
|
### GRUB
|
||||||
|
|
||||||
|
1. At the bootloader menu, select the normal NixOS entry.
|
||||||
|
2. Press `e`.
|
||||||
|
3. Find the line that starts with `linux`.
|
||||||
|
4. Append this to the end of that line:
|
||||||
|
|
||||||
|
```text
|
||||||
|
zfs_force=1
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Boot once with `Ctrl+x` or `F10`.
|
||||||
|
|
||||||
|
### systemd-boot
|
||||||
|
|
||||||
|
1. At the bootloader menu, highlight the normal NixOS entry.
|
||||||
|
2. Press `e`.
|
||||||
|
3. Append this to the end of the options line:
|
||||||
|
|
||||||
|
```text
|
||||||
|
zfs_force=1
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Press `Enter` to boot once.
|
||||||
|
|
||||||
|
## After boot
|
||||||
|
|
||||||
|
Run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo zpool status
|
||||||
|
sudo zpool import
|
||||||
|
journalctl -b | rg "ZFS|zfs|import|root_pool"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Expected result
|
||||||
|
|
||||||
|
`sudo zpool status` should show `root_pool` as `ONLINE`.
|
||||||
|
|
||||||
|
## Reboot test
|
||||||
|
|
||||||
|
Run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
Do not add `zfs_force=1` the second time.
|
||||||
|
|
||||||
|
## If it still fails
|
||||||
|
|
||||||
|
Boot once more with:
|
||||||
|
|
||||||
|
```text
|
||||||
|
zfs_force=1
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo zpool status -v
|
||||||
|
sudo zpool history | tail -n 50
|
||||||
|
journalctl -b | rg "ZFS|zfs|import|root_pool"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- Root pool name is `root_pool`.
|
||||||
|
- This is a one-time recovery path after disk moves, controller changes, dirty exports, or interrupted imports.
|
||||||
|
- Some hosts also need the LUKS unlock USB key inserted before boot.
|
||||||
Reference in New Issue
Block a user