Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centos 7 + 0.6.3 does not automatically import zpools #2755

Closed
rhagu opened this issue Oct 2, 2014 · 17 comments
Closed

Centos 7 + 0.6.3 does not automatically import zpools #2755

rhagu opened this issue Oct 2, 2014 · 17 comments

Comments

@rhagu
Copy link

rhagu commented Oct 2, 2014

Hi,
I exported a zpool on ubuntu 12.04 (0.6.2) and imported it on Centos 7 (0.6.3). After a reboot the pool is not automatically imported. The import needs to be done manually with import -f zpoolname and works without a problem.

[root@localhost]# systemctl | grep -i zfs
zed.service                                                                                                                    loaded active running   ZFS Event Daemon (zed)
zfs-import-cache.service                                                                                                       loaded failed failed    Import ZFS pools by cache file
zfs-mount.service                                                                                                              loaded active exited    Mount ZFS filesystems
zfs-share.service                                                                                                              loaded active exited    ZFS file system shares
zfs.target                                                                                                                     loaded active active    ZFS startup target






[root@localhost zfs]# systemctl status zfs-import-cache.service
zfs-import-cache.service - Import ZFS pools by cache file
   Loaded: loaded (/usr/lib/systemd/system/zfs-import-cache.service; static)
   Active: failed (Result: exit-code) since Do 2014-10-02 16:43:30 CEST; 13min ago
  Process: 579 ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN (code=exited, status=1/FAILURE)
 Main PID: 579 (code=exited, status=1/FAILURE)

Okt 02 16:43:30 localhost.localdomain zpool[579]: cannot import 'bigraid': pool may be in use from other system
Okt 02 16:43:30 localhost.localdomain zpool[579]: use '-f' to import anyway
Okt 02 16:43:30 localhost.localdomain zpool[579]: cannot import 'littleraid': pool may be in use from other system
Okt 02 16:43:30 localhost.localdomain zpool[579]: use '-f' to import anyway
Okt 02 16:43:30 localhost.localdomain systemd[1]: zfs-import-cache.service: main process exited, code=exited...LURE
Okt 02 16:43:30 localhost.localdomain systemd[1]: Failed to start Import ZFS pools by cache file.
Okt 02 16:43:30 localhost.localdomain systemd[1]: Unit zfs-import-cache.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
@x09
Copy link

x09 commented Oct 6, 2014

#2575

@l1k
Copy link
Contributor

l1k commented Oct 6, 2014

Likely fixed by #2766 if Dracut is used.

behlendorf pushed a commit to behlendorf/zfs that referenced this issue Oct 7, 2014
Make use of Dracut's ability to restore the initramfs on shutdown and
pivot to it, allowing for a clean unmount and export of the ZFS root.
No need to force-import on every reboot anymore.

Signed-off-by: Lukas Wunner <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#2195
Issue openzfs#2476
Issue openzfs#2498
Issue openzfs#2556
Issue openzfs#2563
Issue openzfs#2575
Issue openzfs#2600
Issue openzfs#2755
Issue openzfs#2766
@maci0
Copy link
Contributor

maci0 commented Oct 8, 2014

I often have problems with a missing /etc/hostid file either on the system or in the initrd or even both.
I think in the future we need to address this issue.

@behlendorf
Copy link
Contributor

@maci0 As of 0.6.3 a /etc/hostid file isn't needed unless your using a failover style configuration.

@dswartz
Copy link
Contributor

dswartz commented Oct 8, 2014

@maci0 As of 0.6.3 a /etc/hostid file isn't needed unless your using a
failover style configuration.

Except if the spl_hostid kernel module parameter isn't working (as I've
mentioned in the other thread...)

@maci0
Copy link
Contributor

maci0 commented Oct 8, 2014

@behlendorf I remember not having an /etc/hostid and also no spl_hostid kernel parameter set.
I had problems that the system would not automatically mount the zfs filesystems. zpool import worked fine.
But after creating /etc/hostid it always worked automatically. rootfs is not zfs here. that was a RHEL7 system with ZoL 0.6.3

@behlendorf is it hostid for legacy reasons ? on most modern linux systems there is /etc/machine-id

@rhagu
Copy link
Author

rhagu commented Oct 8, 2014

so, does this mean I should wait until 0.6.4 is released?

@maci0
Copy link
Contributor

maci0 commented Oct 9, 2014

@rhagu do you have /etc/hostid on your system ?
do you have it in your initramd?
are they the same?

im running RHEL7 fine now with 0.6.3 after making sure these files exist and are identical
btw there is lsinitrd on RHEL/Fedora to check the contents of an initrd

@rhagu
Copy link
Author

rhagu commented Oct 9, 2014

@maci0
ls /etc shows no /etc/hostid .
I dont know how to check, if there is one in initramd.

@l1k
Copy link
Contributor

l1k commented Oct 9, 2014

@rhagu: zcat < /initrd.img | cpio -tv | grep hostid

@rhagu
Copy link
Author

rhagu commented Oct 9, 2014

@l1k

[root@localhost ~]# zcat < /initrd.img | cpio -tv | grep hostid
-bash: /initrd.img: Datei oder Verzeichnis nicht gefunden
cpio: verfrühtes Ende des Archivs

@maci0
Copy link
Contributor

maci0 commented Oct 9, 2014

As I said earlier there is lsinitrd which shows you the content of your initial ramdisk images.

@rhagu
Copy link
Author

rhagu commented Oct 9, 2014

ah, ok, it shows no entry:

[root@localhost ~]# lsinitrd | grep hostid
[root@localhost ~]#

@FransUrbo
Copy link
Contributor

[root@localhost ~]# lsinitrd | grep hostid

You have to give it a initrd file to list to...

@rhagu
Copy link
Author

rhagu commented Oct 9, 2014

@FransUrbo it does actually seem to find one, it just cant grep anything with the string hostid

http://pastebin.com/WBvTRCuz

@dswartz
Copy link
Contributor

dswartz commented Oct 9, 2014

[root@localhost ~]# lsinitrd | grep hostid

You have to give it a initrd file to list to...

This is certainly not true for CentOS 7.

ryao pushed a commit to ryao/zfs that referenced this issue Nov 29, 2014
Make use of Dracut's ability to restore the initramfs on shutdown and
pivot to it, allowing for a clean unmount and export of the ZFS root.
No need to force-import on every reboot anymore.

Signed-off-by: Lukas Wunner <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#2195
Issue openzfs#2476
Issue openzfs#2498
Issue openzfs#2556
Issue openzfs#2563
Issue openzfs#2575
Issue openzfs#2600
Issue openzfs#2755
Issue openzfs#2766
@gmelikov
Copy link
Member

gmelikov commented Jul 9, 2017

Closing as stale.

@gmelikov gmelikov closed this as completed Jul 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants