Editing ZVOL boot

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
  
 
Using the same steps to create the boot helper partition as [[ZFS on Boot]], you may install Mac OS X onto a ZVOL device and use it as your boot volume.
 
Using the same steps to create the boot helper partition as [[ZFS on Boot]], you may install Mac OS X onto a ZVOL device and use it as your boot volume.
 
==== Disable bootfs ====
 
 
zvol boot does not currently co-exist with zfs boot (planned to be fixed). The presence of the '''bootfs''' property will take precedence at boot time.
 
 
You will need to clear bootfs when using zvol boot:
 
 
# <nowiki>sudo zpool set bootfs='' poolname</nowiki>
 
 
Using two single quotes will remove the previous bootfs.
 
  
 
==== Create zvol ====
 
==== Create zvol ====
Line 21: Line 11:
  
 
Erase and create a volume
 
Erase and create a volume
 
With partition map:
 
 
  # diskutil eraseDisk JHFS+ MacOS ${zvol}
 
  # diskutil eraseDisk JHFS+ MacOS ${zvol}
  Note: direct OS install may only be allowed with a partition map, testing needed
 
 
Without partitions:
 
# diskutil eraseVolume JHFS+ MacOS ${zvol}
 
 
Alternate method, also without partitions and using zvol symlink:
 
# newfs_hfs -J -v "MacOS" /var/run/zfs/zvol/rpool/ZVOL/MacOS
 
  
 
==== Clone root ====
 
==== Clone root ====
Line 59: Line 40:
  
 
==== Setup boot helper ====
 
==== Setup boot helper ====
 
Boot helper can be setup similar to the boot helper for [[ZFS on Boot]] with some differences.
 
 
Root UUID must be set to the Volume UUID of the zvol. You can retrieve this by:
 
 
# diskutil info diskN | grep "Volume UUID"
 
 
For a volume directly within a zvol, or
 
 
# diskutil info diskNsN | grep "Volume UUID"
 
 
For a zvol with a partition map.
 
 
Kernel Flags should contain "zfs_boot=poolname"
 
 
 
See [[Boot.plist]] for sample plist files.
 
See [[Boot.plist]] for sample plist files.
 
At this time zfs_boot=poolname/zvol or poolname/dataset/zvol will only import the zpool "poolname" and does not check or mount the zvol specified. Correctly setting Root UUID to match will inform the OS to locate the root volume.
 
 
In the future, it will be possible to specify a zvol by name, which will then be inspected for matching volume UUID and presented for mount. This would prevent any duplicate UUID clashes due to `zfs clone` copies. To do so will require an additional property zfs_root_uuid=<uuid>, or perhaps zfs_root_partition=N, so that the OS does not try to automatically load the first matching volume.
 

Please note that all contributions to OpenZFS on OS X may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenZFS on OS X:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)