zpool not imported/mounted on reboot after install, leaves the system hanging
I would like to switch my NAS to NixOS. Before doing so, I started experimenting with a VM.
The test system has two hard drives. The smaller drive would contain the `/` and `/boot` partitions, while the larger drive would contain a ZFS volume for data storage. I created a simple disko config to incorporate all of this and made a bare-minimum flake-based config. I followed the disko quick start guide.
```nix
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
storage = {
type = "disk";
device = "/dev/vdb";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "data";
};
};
};
};
};
};
zpool = {
data = {
type = "zpool";
mode = "";
mountpoint = "/srv/data";
rootFsOptions = {
acltype = "posixacl";
atime = "off";
compression = "zstd";
xattr = "sa";
};
options.ashift = "12";
datasets = {
share = {
type = "zfs_fs";
mountpoint = "/srv/data/share";
};
};
};
};
};
}
```
After installing the system, the machine does not boot. It gets to the systemd-boot screen, but after that it freezes.
After some trial and error (re-running the installer after each failed boot), I found that I need to add `boot.zfs.extraPools = ["data"];` to my `configuration.nix`.
I think the mounting the pools created by disko should be automatic. Or is it the intended behavior?
3 条评论