Accessing a Tape Device from a non-global Zone

This is a quick article on how to assign a tape drive from the global zone for use in a Solaris non-global zone.

In this example, we are assigning /dev/rmt/0n to the non-global zone sol10z1:

global# zonecfg -z sol10z1
zonecfg:sol10z1> add device
zonecfg:sol10z1:device> set match=/dev/rmt/0n
zonecfg:sol10z1:device> end
zonecfg:sol10z1> verify
zonecfg:sol10z1> commit
zonecfg:sol10z1> exit

Note:

  • The zonecfg must be run on the global zone.
  • A reboot of the non-global zone is required in order to access the tape drive.
    # zoneadm -z sol10z1 reboot

Once the non-global zone has rebooted, you should now have access to your tape drive and be able to use it as normal:

sol10z1# mt status
HP Ultrium LTO 4 tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 3
sol10z1# tar -cvf /dev/rmt/0n /data
a /data/ 0 tape blocks
a /data/docs/ 0 tape blocks
a /data/docs/os/ 0 tape blocks
a /data/docs/os/solaris10 0 tape blocks
a /data/docs/os/solaris10/data-structures.odt 115 tape blocks
a /data/docs/os/solaris10/emc-networker-install.odt 37 tape blocks
[...]