Saturday, September 10, 2016

Access iSCSI block device, setup as ZFS volume on CentOS7 - won't automount on boot, hangs on reboot

I am running CentOS7 on a virtual instance at Softlayer. There is a block storage device available to the instance via multipath/iscsi



I have successfully had this block device mounted as XFS. I decided I would give ZFS a try. When I manually issue commands to 'mount' this ZFS volume, it works fine.



zpool import -f zfs-data


There are two issues that I am having with ZFS on CentOS7.





  • a.) my zpool isn't automatically mounted on boot

  • b.) the system hangs on reboot



I suspect the solution for (a) could also fix (b).



Lets have a look at (a) first.



There is this discussion on the github page for zfsonlinux CentOs 7. Not mount/import pool after reboot




It appears that the /etc/hostid file is not created when ZFS is installed via yum. So as suggested on this page I run the following command to create it.



dd if=/dev/urandom of=/etc/hostid bs=4 count=1


Then it suddenly occurred to me that it cannot mount automatically because as the machine is booting, ZFS is being loaded before the iSCSI stuff.



from /var/log/boot.log - first column is the line number



81     Starting Import ZFS pools by cache file...

147 Starting Open-iSCSI...


How do I change the load order?



(b) hangs on reboot



If I import the pool and don't write anything to it, I can reboot fine. However as soon as any data is exchanged on the mount, the reboot/shutdown log contains these lines..



Stopping Import network configuration from initramfs...



[ 550.096199] end_request: I/O error, dev dm-0, sector 5514152


^^ repeated ten times with different numbers.



WARNING: Pool 'zfs-data' has encountered an uncorrectable I/O failure and has been suspended
[...]
Unmounting /zfs-data...

[...]
A stop job is running for /zfs-data


This never finishes and a HARD reboot is required to get back into the instance.



Any insight would be appreciated.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...