This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

zfs import at each boot

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
dodgy
NewUser
NewUser
Posts: 5
Joined: 06 Oct 2013 20:49
Status: Offline

zfs import at each boot

Post 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

User avatar
siftu
Moderator
Moderator
Posts: 71
Joined: 17 Oct 2012 06:36
Status: Offline

Re: zfs import at each boot

Post by siftu »

This is normal, even happens on my ZoL installs. The pool has to be imported for it to be used.
System specs: NAS4Free amd64-embedded on ASUSTeK. M5A78L-M LX PLUS - AMD Phenom(tm) II X3 720 Processor - 8GB ECC Ram, Storage: 2x ZFS mirrors with 4x Western Digital Green (WDC WD10EADS)
My NAS4Free related blog - http://n4f.siftusystems.com/

dodgy
NewUser
NewUser
Posts: 5
Joined: 06 Oct 2013 20:49
Status: Offline

Re: zfs import at each boot

Post 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?

User avatar
siftu
Moderator
Moderator
Posts: 71
Joined: 17 Oct 2012 06:36
Status: Offline

Re: zfs import at each boot

Post 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?
System specs: NAS4Free amd64-embedded on ASUSTeK. M5A78L-M LX PLUS - AMD Phenom(tm) II X3 720 Processor - 8GB ECC Ram, Storage: 2x ZFS mirrors with 4x Western Digital Green (WDC WD10EADS)
My NAS4Free related blog - http://n4f.siftusystems.com/

dodgy
NewUser
NewUser
Posts: 5
Joined: 06 Oct 2013 20:49
Status: Offline

Re: zfs import at each boot

Post 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.

dodgy
NewUser
NewUser
Posts: 5
Joined: 06 Oct 2013 20:49
Status: Offline

Re: zfs import at each boot

Post 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.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: zfs import at each boot

Post 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.
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

User avatar
siftu
Moderator
Moderator
Posts: 71
Joined: 17 Oct 2012 06:36
Status: Offline

Re: zfs import at each boot

Post 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
System specs: NAS4Free amd64-embedded on ASUSTeK. M5A78L-M LX PLUS - AMD Phenom(tm) II X3 720 Processor - 8GB ECC Ram, Storage: 2x ZFS mirrors with 4x Western Digital Green (WDC WD10EADS)
My NAS4Free related blog - http://n4f.siftusystems.com/

dodgy
NewUser
NewUser
Posts: 5
Joined: 06 Oct 2013 20:49
Status: Offline

Re: zfs import at each boot

Post 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!

Post Reply

Return to “ZFS (only!)”