Page 1 of 1

zfs import at each boot

Posted: 06 Oct 2013 21:05
by dodgy
Hi all,

I had a full install of Nas4Free on my HP N40L and I decided to go for the embedded version because I would need the extra SATA ports in the future. I had a ZFS raidz1 volume on my full install with 3 disks.

I chose not to keep the configuration of my full install for different reasons so I installed a fresh embedded version on a USB stick and configured everything from scratch again. I succeeded to import the ZFS volume (I exported it in the full install before shutdown) but then I noticed that the import command was used at each boot of the server. I can see it in the history:

Code: Select all

2013-10-06.18:45:39 zpool import -d /dev -f -a
2013-10-06.18:56:00 zpool import -d /dev -f -a
2013-10-06.20:46:15 zpool import -d /dev -f -a
I don't think this is normal as I did not see this in my previous install. I have the full history of the ZFS volume and this starts to appear as soon as I started to use the embedded version.

Any idea or explanations?

Thanks!
dodgy

Re: zfs import at each boot

Posted: 06 Oct 2013 23:29
by siftu
This is normal, even happens on my ZoL installs. The pool has to be imported for it to be used.

Re: zfs import at each boot

Posted: 07 Oct 2013 07:30
by dodgy
Thanks for your feedback. I just find it odd that the command did not appear in the history while I was running the full install. Do you have an explanations for this?

Re: zfs import at each boot

Posted: 07 Oct 2013 07:40
by siftu
I do not know for sure since I avoid full installs. I will test it out in a VM but would be surprised if it didn't show. Maybe you just had the full install up and running without a reboot for a while and you viewed the history after the last reboot?

Re: zfs import at each boot

Posted: 07 Oct 2013 21:29
by dodgy
I have the history of the pool since its creation and I'm sure I rebooted the server several time. I'm wondering if this could have to to with what is in the /etc/fstab.

Re: zfs import at each boot

Posted: 07 Oct 2013 22:31
by dodgy
I've done the test myself on a VM with a full install. I do not see this in the pool history.

Code: Select all

History for 'tankpool':
2013-10-07.20:12:56 zpool create -m /mnt/tankpool tankpool raidz1 /dev/ada1 /dev/ada2 /dev/ada3 /dev/ada4 /dev/ada5
2013-10-07.20:13:28 zpool scrub tankpool
2013-10-07.20:13:50 zpool scrub tankpool
This is what I get after several reboots. There's nothing in the fstab.

Re: zfs import at each boot

Posted: 08 Oct 2013 09:06
by b0ssman
look in the init.d zfs script.

ifs its the full install it uses a persistent file to mount the array which is not there in the embedded and therefore has to import the pool again.

Re: zfs import at each boot

Posted: 08 Oct 2013 15:33
by siftu
b0ssman wrote:look in the init.d zfs script.

ifs its the full install it uses a persistent file to mount the array which is not there in the embedded and therefore has to import the pool again.
Ah yes, probably the cachefile which I never use

Re: zfs import at each boot

Posted: 08 Oct 2013 21:27
by dodgy
Well done!

Code: Select all

        # Make sure /boot/zfs/zpool.cache exists. On 'embedded' installations
        # this file is missing after a reboot => zpools are missing, so we
        # have to import them to be able to use them.
        if [ ! -e /boot/zfs/zpool.cache ]; then
                info Importing ZFS pools...
                zpool import -d /dev -f -a
                zfs umount -a
        fi
Thanks for your help!