Introduction to Oracle® Solaris Zones

Exit Print View

Updated: December 2014
 
 

Removable lofi Device in Non-Global Zones

A removable loopback file lofi device, which works like a CD-ROM device, can be configured in a non-global zone. You can change the file that the device maps to and create multiple lofi devices to use the same file in readonly mode. This type of lofi device is created by using the lofiadm command with the –r option. A file name is not required at creation time. During the lifecycle of a removable lofi device, a file can be associated with an empty device, or dissociated from a device that is not empty. A file can be associated with multiple removable lofi devices safely at the same time. A removable lofi device is read-only. You cannot remap a file that has been mapped to either a normal read-write lofi device or to a removable lofi device. The number of potential lofi devices is limited by the zone.max-lofi resource control, which can be set by using zonecfg(1M) in the global zone.

Once created, a removable lofi device is read-only. The lofi driver will return an error on any write operation to a removable lofi device.

The lofiadm command is also used to list removable lofi devices.

Example 2-2  Create a Removable lofi Device With an Associated File
# lofiadm -r /path/to/file 
/dev/lofi/1
Example 2-3  Create an Empty Removable lofi Device
# lofiadm -r 
/dev/lofi/2
Example 2-4  Insert a File Into a Removable lofi Device
# lofiadm -r /path/to/file /dev/lofi/1
/dev/lofi/1

For more information, see the lofiadm (1M) , zonecfg (1M) , and lofi (7D) man pages. Also see Table 2–2.