Jay Taylor's notes

back to listing index

linux - Automount ZFS zpool in Ubuntu 12.04 - Super User

[web search]
Original source (superuser.com)
Tags: ubuntu zfs filesystem zfs-fuse superuser.com
Clipped on: 2013-09-09

So, I've been told that ZFS for Linux has the ability to automatically mount a zpool on system startup in Ubuntu 12.04, but it doesn't work for me and I can't find any documentation on how to make it work.

I have a 5 disk raidz zpool mounted at /zstorage. Currently, when my server starts, I have to type sudo zfs mount zstorage in order to get it to be accessible, which is a bit of an issue as I have a number of programs that start automatically and look for folders in there.

In the case of on, SabNZBD+, if it doesn't find the folders it needs it will revert to the default. This is especially a problem as the default folder is in a tiny SSD which is meant for nothing but as a boot volume.

asked Aug 7 '12 at 6:04
Image (Asset 1/3) alt= 9629
add comment

2 Answers

up vote 1 down vote accepted

If you are using zfs-fuse, just running the zfs-fuse init script on startup should do it. I have several computers with zpools on external disks and they are all mounted automatically on boot with zfs-fuse.

In particular, the init script contains the line

zfs mount -a

which mounts all available zfs filesystems. You could add this line to any zfs init scripts you have or put this line into the local init script.

answered Aug 7 '12 at 16:14
Image (Asset 2/3) alt= 92946
  upvote
 flag
I'm using 'ZFS on Linux': zfsonlinux.org – dougoftheabaci Aug 8 '12 at 17:26
1 upvote
 flag
Have you tried running zfs mount -a on startup? – Lars Kotthoff Aug 8 '12 at 17:29
  upvote
 flag
I imagine that would work but how do I automate it? Sorry, I should clarify, this is my first real experience with Ubuntu and I may have just dived in at the deep end. – dougoftheabaci Aug 9 '12 at 18:05
  upvote
 flag
The easiest way is probably to add the command to /etc/rc.local. Also see en.kioskea.net/faq/… – Lars Kotthoff Aug 9 '12 at 18:21
  upvote
 flag
Finally had a chance to give this a try. Works great. Thanks! – dougoftheabaci Sep 11 '12 at 3:10
add comment

If you go to /etc/default/zfs that is where you'd set the flag to normally mount the ZFS volumes on startup but not anymore. As it states in the config-file mentioned above, what you could try is installing zfs-mountall with apt-get:

sudo apt-get install zfs-mountall

This should work, provided you have installed native ZFS and not zfs-fuse. More information is provided here: http://zfsonlinux.org/faq.html

answered Aug 12 '12 at 19:30
Image (Asset 3/3) alt= 7613
  upvote
 flag
Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'mountall' instead of 'zfs-mountall' mountall is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – dougoftheabaci Aug 15 '12 at 4:30
  upvote
 flag
Any progress on this for you? I've just installed Ubuntu 11.10 instead (didn't like 12.04) and what I did was install zfs, create the mountpoint, change permissions on the mountpoint to 777, import my zpool, checked that it mounted correctly with sudo zfs mount -a, rebooted and ran sudo apt-get update && sudo apt-get upgrade. The mountall package was then updated with zfs and my zpool now mounts on startup. I don't know why it doesn't work for you, but the process above worked for me. – Henric Sep 2 '12 at 14:53
  upvote
 flag
It might be a 12.04 issue. What are the benefits of using 11.10 vs. 12.04? I could possibly reinstall 11.10 instead of 12.04 (seems things support it a bit better right now) but it's a bit of a whole to-do as I'd need to borrow a screen from work. – dougoftheabaci Sep 4 '12 at 17:41
  upvote
 flag
There was a couple of reasons why I chose to install 11.10 instead but the main one is that I simply couldn't get unity-2d to work which I need for VNC (unity 3d doesn't update over VNC). Since my machine is headless it's something I really need. I also found 11.10 to be a lot faster for what I use it for (iTunes server in Windows XP virtualbox, file server, web server etc.). I can't point to any specific benefits as this is just what I experienced. I do think that support is better for 11.10 so that might be a reason to change. – Henric Sep 4 '12 at 20:31
add comment

Your Answer

 
community wiki

Not the answer you're looking for? Browse other questions tagged or ask your own question.

tagged

 × 20004
 × 567
 × 82
 × 73

asked

1 year ago

viewed

3962 times

active

1 year ago

Related