Add device to a non-global zone

From Wiki
Jump to: navigation, search

Here's how to create a zvol and add it as a new device to a non-global zone.

[root@sctest1.example.com] ~ >> zfs create -V 4G primary/icecast-fs1
[root@sctest1.example.com] ~ >> zonecfg -z icecast-zone

[root@sctest1.example.com] ~ >> zonecfg -z icecast-zone
zonecfg:icecast-zone> add device
zonecfg:icecast-zone:device> set match=/dev/zvol/rdsk/primary/icecast-fs1
zonecfg:icecast-zone:device> end
zonecfg:icecast-zone> add device
zonecfg:icecast-zone:device> set match=/dev/zvol/dsk/primary/icecast-fs1
zonecfg:icecast-zone:device> end
zonecfg:icecast-zone> verify
zonecfg:icecast-zone> commit
zonecfg:icecast-zone> 

[root@sctest1.example.com] ~ >> zoneadm list -vc
  ID NAME             STATUS     PATH                           BRAND    IP    
   0 global           running    /                              native   shared
   2 icecast-zone     running    /zones/icecast                 native   shared

[root@sctest1.example.com] ~ >> zoneadm -z icecast-zone reboot

Once the zone is booted you can login and format the device, mount it, etc.