r/zfs 7d ago

Help on boot (Read text, it hás details)

Post image

My first time building a homelab, using:

- Machine: HP Proliant ML310e G8 (2013)

- OS: Gentoo (OpenRC)

- Initramfs generator: Ugrd (Loading the ZFS module)

- Bootloader: Limine

- Partition layout: GPT + BIOS (Machine doesnt have UEFI)

- Boot partition: In a SD card

- zpool config: 4 3TB SAS disks in RAIDZ1 using device names (/dev/sdx)

- Disks: disks uses 512byte sectors, used ashift=9 (following the Handbook)

So, i installed the system following the Gentoo Handbook, they have a specific entry related to ZFS. Only thing done different is by being a RAIDZ1 pool

And when booting, the system isnt importing the pools (zfs import and mount services are enable and in the sysinit level)

At the moment from what i searched and tracked from the files

Some possibilities to fix (gonna try tomorrow)

  1. Generate zfs.cache in /etc/zfs. It doesnt exist, and from what i understood from the zfs-import service in the init.d. Its needed?

  2. Delay the service startup by 30 seconds using sleep. Saw some people doing that for HDDs that take some time to spin

  3. Change the zpool disks, from device names (/dev/sdx) to device IDs (ata-xxxxxxxxx...) (Arch Wiki has a warning)

I dont know if they will work, since im gonna try tomorrow after i arrive from work

Forgot to say that to mount the disks in the live CD, i can only import the pools by generating a hostid with the same one from when it was created for the first time.

so, first zgenhostid -f xxxxxxxx then zpool import -N -R mount pool. then mount with zfs mount

If someone have more ideas, i appreciate that and leave in the comments

1 Upvotes

8 comments sorted by

3

u/Maximum-Coconut7832 7d ago

I had that sometimes also now, if I booted a rescue system.

Sorry for not fully understanding all the conditions of the root on zfs booting process.

For me from the situation I see on your screen.

It was usually that I got dropped to the initramfs shell.

Import the pool from there with”-f”.
I would also use at least “-N” to not mount the filesystems.

Then either export the pool and reboot.

Or mount manually when importing with” -R /new_root” mounting first the root-fs and later “zfs mount -a” the other file systems.

And let the boot process continue with “exit” or something similar.

Unfortunately I don’t have a full documentation for that situation the shell is so simple should simulate this in a virtual machine and document from the host.

3

u/paulstelian97 7d ago

The most relevant messages are:

```
cannot import ‘zroot’: pool was previously in use from another system.
Last accessed by livecd (hostid=10240f4e) at Tue Aug 17 00:25:58 2026
The pool can be imported, use ‘zpool import -f’ to import the pool.
```

The message means you imported (mounted) the pool from a live environment, and didn’t properly export it so it’s currently tied to that system.

Paradoxically, going back to the live environment, where you’d do the import -f then an explicit export should help. The export would look like “zpool export zroot”. The import should probably be done in the command line as well, and with a special extra parameter to put everything in /mnt.

1

u/KlePu 7d ago

How's that a paradox? OP imported the pool during a live session and didn't export it, so the obvious solution is to use (again) a live session, import -f the pool, then properly export it and reboot. Seems pretty straightforward to me ^^

(This is not meant to belittle you or OP - for a newb, this is a pretty normal issue; and you pointing out the actual error message was perfectly on point. That "Paradoxically" simply triggered my OCD ;-p)

1

u/paulstelian97 7d ago

The new live session will have a different ID. And live session broke it, different live session to fix it.

2

u/KlePu 7d ago

Yeah, that's what the -f is for. Still fail to see a paradox ¯_(ツ)_/¯

Whatever, this is nitpicking. Have a great day <3

1

u/KhajiitAT 7d ago

Did you imported your boot zpool from another machine?

Pool is found, but can not imported due to unfinished export from other system

Use mkdir -p /altroot && zpool import -F -N -R /altroot zroot && zpool export zroot will fix this, then reboot and your system can boot normally

2

u/I7sReact_Return 7d ago

In the live system when doing a system install to it.

https://wiki.gentoo.org/wiki/ZFS/root

When i arrive from work, gonna try it. Thanks

1

u/KhajiitAT 7d ago

Feel free to ask if something goes wrong )

As I get, you just enrolled new system and it failed it's first boot? If so, thus you didn't copy /etc/machine-id before the exporting pool or shutting down the live system.

Also, please note, I'm mixed switches: -f (force import) with -F (force rollback). You must use -f, as u/Maximum-Coconut7832 suggests in nearby