Help mounting a zfs filesystem inside a dmg

111 views
Skip to first unread message

Fernando Sanchez

unread,
Aug 12, 2012, 10:47:28 AM8/12/12
to zfs-...@googlegroups.com
Hoping somebody can shed some light.

I follow the instructions here to create a zfs file system on a disk image:


How do I mount the zfs file system created after a reboot or unmount?

Jason

unread,
Aug 12, 2012, 11:26:59 AM8/12/12
to zfs-...@googlegroups.com
Depending on why your doing it this way, and your end goals, a script should do it. If bash or other scripts aren't your thing, Automator might be easier. You want to run the mount command at boot for a particular DMG. So you need the mount info, you need a way to execute and you need it done at boot. You have the first, the second is going to use bash (script), launchd (command sequence), etc., and the last can use launchd, bash, etc.. Everyone has different desires in this stuff, so your choices may differ.

Jason
Sent from my iPad
--
 
 
 

Jason

unread,
Aug 12, 2012, 11:40:07 AM8/12/12
to zfs-...@googlegroups.com


Jason
Sent from my iPad
--
 
 
 

Fernando Sanchez

unread,
Aug 12, 2012, 11:41:47 AM8/12/12
to zfs-...@googlegroups.com
Thanks.   Do you have the command(s) to attach.  I am comfortable with scripts.

Daniel Bethe

unread,
Aug 12, 2012, 3:00:52 PM8/12/12
to zfs-...@googlegroups.com
As far as I know, the soonest way to run a manual command in the boot process, is to put it in /etc/rc.common.  Am I right?  You'd have to do this manually, because nothing is going to autodetect it.


From: Jason <jason...@belecmartin.com>
To: "zfs-...@googlegroups.com" <zfs-...@googlegroups.com>
Sent: Sunday, 12 August 2012, 8:26
Subject: Re: [zfs-macos] Help mounting a zfs filesystem inside a dmg

--
 
 
 


Daniel Bethe

unread,
Aug 12, 2012, 3:06:27 PM8/12/12
to zfs-...@googlegroups.com
Oh yeah that's the *correct* way to do it.  ^_^  If nothing inside your user login depends on it.  You didn't put ~/Library in a DMG, did you? ;)

Sent: Sunday, 12 August 2012, 8:40

Subject: Re: [zfs-macos] Help mounting a zfs filesystem inside a dmg
--
 
 
 


Jason

unread,
Aug 12, 2012, 3:14:32 PM8/12/12
to zfs-...@googlegroups.com
I don't do it this way, but it is an option. I let people do their own research. ;) I try never to put things in places the OS updates may wipe out. I also run rather customized systems so my ways are not the ways of so many Podlings. I so enjoy taking essences!!! Back to my cave.....


Jason
Sent from my iPad
--
 
 
 

Daniel Bethe

unread,
Aug 12, 2012, 3:18:32 PM8/12/12
to zfs-...@googlegroups.com

--



>
>
>

Daniel Bethe

unread,
Aug 12, 2012, 3:19:58 PM8/12/12
to zfs-...@googlegroups.com
Argh, darn Yahoo Mail and its stupid helpful non-disableable non-configurable keyboard shortcuts.

>I don't do it this way, but it is an option. I let people do their own research. ;) I try never to put things in places the OS updates may wipe out. I also run rather customized systems so my ways are not the ways of so many Podlings. I so enjoy taking essences!!! Back to my cave.....


OH NO YOU DON'T.  Just where do you think you're going, mister?!  You'd better end up on IRC one of these days.  You've got some asplainin' to do.

Jason

unread,
Aug 12, 2012, 9:45:36 PM8/12/12
to zfs-...@googlegroups.com
Hehe, it's funny to think I'm that old for IRC, just don't use it, they have cool new stuff nowadays. I'll try this week to hop in to the matrix. It'll be like going back to punch cards, ahhhh, the memories......

Jason
Sent from my iPad

> --
>
>
>

coax...@gmail.com

unread,
Jul 13, 2013, 12:17:45 PM7/13/13
to zfs-...@googlegroups.com
I've read through this thread a couple times now, and it talks about where to put a script for automounting, but I don't see what commands are supposed to go into the script. The stackoverflow link isn't very helpful, and in fact, I don't even want to mount it at boot, just sometime "after a reboot" as the original question asks.

After rebooting:
open, hdiutil attach, and hdiutil mount all say "no mountable file systems", both before and after loading the ZFS kext
zpool status says "You must be root in order to load the ZFS kext"
sudo zpool status says "no pools available"

So how do I remount the image file?

Jason Belec

unread,
Jul 13, 2013, 1:20:31 PM7/13/13
to zfs-...@googlegroups.com
Those are the same problems for when your system doesn't load ZFS at startup and you want ZFS stuff. You run a script, on the MacZFS site within Getting Started. If ZFS is not running, you can't mount ZFS. So you need to load the ZFS module either before or after you mount the image. Then your pool and data should appear. Unless you exported the pool, then you'll have to import.


--
Jason Belec
Sent from my iPad
--
 
---
You received this message because you are subscribed to the Google Groups "zfs-macos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-macos+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Simon Casady

unread,
Jul 13, 2013, 1:31:17 PM7/13/13
to zfs-...@googlegroups.com
see the hdiutil man page
hdiutil attach
              should return the dev name where the dmg was "attached"  if it fails then you need to use the -nomount option
see zpool import man page
zpool import 
      should list the pool in your dmg if not then  option -d "dir where the device was attached by hdiutil" may be needed
zpool import pool
      should import and mount pool where pool is as listed in output of previous zpool import command

may need to load kexts and sudo etc


--

coax...@gmail.com

unread,
Jul 13, 2013, 1:50:22 PM7/13/13
to zfs-...@googlegroups.com
Yep, I was just reading the hdiutil man page, the -nomount option is indeed what's needed here. Got it working now. Though it would nice if the pool configuration was persistent, but import works well enough.

Jason Belec

unread,
Jul 13, 2013, 2:31:52 PM7/13/13
to zfs-...@googlegroups.com
Yeah the persistent issue has yet to be resolved as far as I know.



--
Jason Belec
Sent from my iPad
Reply all
Reply to author
Forward
0 new messages