Adding ZFS drivers to boot disk & recovery?

Moderators: jhartley, MSR734, nola

Adding ZFS drivers to boot disk & recovery?

Post by satadru » Fri Nov 30, 2012 8:45 am

So I have my time machine backups going to a zfs pool. I'd like to be able to restore from backup and/or create an emergency netboot setup with minimal modifications so I can access my pools.

Any ideas on what to modify?

I imagine I have to copy over the zfs kext and all the user utilities, right? (Or can I just copy over the kext if I just need access to the pools w/o wanting to modify their properties?)

I'm running 10.8.2 here.

I did run otool to figure out what dependencies the zfs tools had, but I'm seeing links to ../lib/libzfs.dylib and ../lib/libmisc.dylib which I don't see in /usr/lib.

Code: Select all
otool  -L /usr/sbin/zfs
/usr/sbin/zfs:
   @executable_path/../lib/libzfs.dylib (compatibility version 1.0.0, current version 1.0.0)
   @executable_path/../lib/libmisc.dylib (compatibility version 1.0.0, current version 1.0.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
satadru Offline


 
Posts: 20
Joined: Fri Sep 14, 2012 10:07 pm

reference

Post by grahamperrin » Fri Nov 30, 2012 2:12 pm

Overlap with parts of an earlier topic: boot OS X from a ZFS volume
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Adding ZFS drivers to boot disk & recovery?

Post by satadru » Fri Nov 30, 2012 5:14 pm

So here are the steps that worked for restoring from a Time Machine volume that was on a zpool, without modifying the restore boot partition:

    Do a 10.8.2 clean install
    Create a temp account
    Reinstall zevo (and reboot to get the zpools back)
    Mount the Time Machine image off of the zpool with hdiutil
    Open Migration Assistant and choose to restore from a Time Machine backup (and choose the mounted Time Machine volume when prompted.)
satadru Offline


 
Posts: 20
Joined: Fri Sep 14, 2012 10:07 pm

Re: Adding ZFS drivers to boot disk & recovery?

Post by grahamperrin » Fri Nov 30, 2012 7:06 pm

Smart, thanks.

Note that reinstallation of ZEVO Community Edition is currently multi-step with multiple reboots (first 1.1 then 1.1.1).
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Adding ZFS drivers to boot disk & recovery?

Post by satadru » Fri Nov 30, 2012 7:13 pm

Hmmm.. I installed 1.1, then 1.1.1, then rebooted. Should I reinstall? It seems to be working fine.
satadru Offline


 
Posts: 20
Joined: Fri Sep 14, 2012 10:07 pm

Re: Adding ZFS drivers to boot disk & recovery?

Post by mk01 » Fri Nov 30, 2012 9:26 pm

whole trick about recovery partition is in the read only dmg inside it. you have to extrakt it, add kext, run cache update via terminal on a custom dir and put everything back into same type read only image.
mk01 Offline


 
Posts: 65
Joined: Mon Sep 17, 2012 1:16 am

currently two reboots for installation of, and update to, ZE

Post by grahamperrin » Sat Dec 01, 2012 1:44 am

satadru wrote:… 1.1, then 1.1.1, then rebooted …


That's fine – currently two reboots (one for 1.1, another for 1.1.1).
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Adding ZFS drivers to boot disk & recovery?

Post by adwardrob » Sat Dec 29, 2012 4:10 am

i think it is good no need of modification..
:):)
Are you worried about Test Inside & ASQ preparation? We offer up-to-dated Stanford University practice questions and wikipedia with 100% exam pass guarantee of mcts training.
adwardrob Offline


 
Posts: 1
Joined: Sat Dec 29, 2012 3:52 am

Recovery OS 10.8.4 with ZEVO Community Edition 1.1.1

Post by grahamperrin » Tue Jul 23, 2013 3:49 pm

mk01 wrote:whole trick about recovery partition is in the read only dmg inside it. you have to extrakt it, add kext, run cache update via terminal on a custom dir and put everything back into same type read only image.


I took a slightly different approach – to include the zdb, zfs and zpool binaries within zfs.fs

Something like this:

  • defaults write com.apple.finder AppleShowAllFiles TRUE
  • diskutil mount the slice of the disk where the Recovery OS is to be customised
  • Disk Utility to convert the hidden BaseSystem.dmg to a read/write image in ~/Desktop
  • attach the image
  • enable ownership
  • put in place three ZEVO bundles – ZFSDriver.kext, ZFSFilesystem.kext, zfs.fs
  • for those three, sudo chown -R root:wheel
  • detach the image, convert to a compressed image in ~/Documents
  • overwrite the hidden BaseSystem.dmg with the customised image
  • unmount
  • start Recovery OS
  • cd /System/Library/Filesystems/zfs.fs/Contents/Resources/bin/
  • ./zpool import -d /dev

Postscript

I chose to omit symbolic links such as:
  • /usr/local/bin/zdb
  • /usr/sbin/zfs
  • /usr/sbin/zpool

I imagine that adding symlinks for zfs and zpool would allow dynamic import, but in an edge case (example: panic on import) it's desirable to be without those dynamics in a recovery environment.
Last edited by grahamperrin on Sun Jul 28, 2013 1:38 am, edited 4 times in total.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Migration Assistant

Post by grahamperrin » Tue Jul 23, 2013 3:53 pm

satadru wrote:
    Do a 10.8.2 clean install
    Create a temp account
    Reinstall zevo (and reboot to get the zpools back)
    Mount the Time Machine image off of the zpool with hdiutil
    Open Migration Assistant and choose to restore from a Time Machine backup (and choose the mounted Time Machine volume when prompted.)


With a Time Machine Backups volume attached from a sparse bundle disk image on ZFS, I could not get Migration Assistant in Mountain Lion to work as expected with the found user accounts.

Maybe a peculiarity of my current test environment.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom


Return to General Discussion

Who is online

Users browsing this forum: ilovezfs and 0 guests

cron