This is just a quick one that may come in handy to someone, or me again in the future.
Adding a tape drive to a zone is quite a quick simple process.
- Add the device to the zone configuration from the global zone:
[devon:~] # zonecfg -z myzone
zonecfg:myzone> add device
zonecfg:myzone:device> set match=/dev/rmt/0n
zonecfg:myzone:device> end
zonecfg:myzone> verify
zonecfg:myzone> commit
zonecfg:myzone> exit
[devon:~] # - Reboot the zone:
[devon:~] # zoneadm -z myzone rebootYou need to reboot the zone, because
devfsadmdoesn’t work in a local zone:[myzone:~] # devfsadm
devfsadm: open failed for /dev/.devfsadm_dev.lock: Permission denied
[myzone:~] # mt status
/dev/rmt/0n: No such file or directory
[myzone:~] #
Once the local zone has rebooted, you should now have access to your tape drive and be able to use it as normal:
[myzone:~] # mt status
HP DDS-4 DAT (Sun) tape drive:
sense key(0×0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
[myzone:~] # tar -cvf /dev/rmt/0n var
a var/ 0 tape blocks
a var/sadm/ 0 tape blocks
a var/sadm/system/ 0 tape blocks
a var/sadm/system/logs/ 0 tape blocks
a var/sadm/system/logs/install_log 115 tape blocks
a var/sadm/system/logs/sysidtool.log 37 tape blocks
[...]
[myzone:~] # mt rewind
[myzone:~] # tar -tvf /dev/rmt/0n
drwxr-xr-x 0/3 0 Feb 14 16:53 2007 var/
drwxr-xr-x 0/3 0 Sep 28 12:46 2006 var/sadm/
drwxr-xr-x 0/3 0 Apr 18 09:27 2006 var/sadm/system/
drwxr-xr-x 0/3 0 Feb 14 16:45 2007 var/sadm/system/logs/
-rw-r–r– 0/0 58510 Feb 14 16:35 2007 var/sadm/system/logs/install_log
[...]
[myzone:~] #Just remember, you can only backup filesystems accessible from this zone.
2 Responses to “HOWTO: Add and Use a Tape Drive in a Zone”
Speak Your Mind 
Search
Related Entries
- Solaris 10 8/07 (aka update 4) is Now Available.
- Links for 3 August 2007
- Thumper From Sun is A Beast
- Compiling GAIM 2 / Pidgin On Solaris 10
- Sun Back In Supercomputers
- Links for 9 May 2007 - 13 May 2007
- Links for 1 April 2007 - 8 April 2007
- IP Instances Integrated into Nevada
- Solaris 10 Just Got Better
- Thunderbird May Be Set Free


I following as your instruction but it still not to see tape device under the zone.
I try to add device and reboot as instruction and then I tried to run devfsadm but it shown error “devfsadm: open failed for /dev/.devfsadm_dev.lock: Permission denied”
There should be no need to run devfsadm in the zone. As you will see in the notes above, I state that you won’t be able to. You should have the tape device in the zone after rebooting the zone.