This procedure uses the lofi file driver, which exports a file as a block device.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Change directories to /usr/tmp.
global# cd /usr/tmp |
Create a new UFS file system.
global# mkfile 10m fsfile |
Attach the file as a block device.
The first available slot, which is /dev/lofi/1 if no other lofi devices have been created, is used.
global# lofiadm -a `pwd`/fsfile |
You will also get the required character device.
Import the devices into the zone my-zone.
global# zonecfg -z my-zone zonecfg:my-zone> add device zonecfg:my-zone:device> set match=/dev/rlofi/1 zonecfg:my-zone:device> end zonecfg:my-zone> add device zonecfg:my-zone:device> set match=/dev/lofi/1 zonecfg:my-zone:device> end |
Reboot the zone.
global# zoneadm -z my-zone boot |
Log in to the zone and verify that the devices were successfully imported.
my-zone# ls -l /dev/*lofi/* |
You will see a display that is similar to this:
brw------- 1 root sys 147, 1 Jan 7 11:26 /dev/lofi/1 crw------- 1 root sys 147, 1 Jan 7 11:26 /dev/rlofi/1 |
For more information, see the lofiadm(1M) and lofi(7D) man pages.