Skip to content

Instantly share code, notes, and snippets.

@trentster
trentster / do-smartmachine-dataset.sh
Last active May 25, 2016 22:46
PURPOSE: turn a SmartOS zone vm into a dataset
#!/bin/bash
#
# SCRIPT: do-smartmachine-dataset.sh
# AUTHOR: Mark Slatem
# DATE: 16 January 2013
# REV: 1.0
#
# PLATFORM: SmartOS
# REQUIREMENTS: SmartOS
#
# mdb -kw
> 0x0::zid2zone | ::walk zsd z | ::print 'struct zsd_entry' zsd_create | ::grep .==evch_zoneinit | ::eval "<z::print 'struct zsd_entry' zsd_data | ::print 'struct evch_globals'"
{
evch_list = {
dh_head = {
dl_next = 0xffffff21d16b0f10
dl_prev = 0xffffff21ff76a320
}
dh_count = 0x7