Summary:
Mounts a Hardware Node device on the Hardware Node or inside a Virtuozzo Container.
Request specification:
Name |
Min/Max |
Type |
Description |
|
|
|
|
|
|
|
|
|
|
Server ID. |
|
|
|
|
|
Returns:
OK/Error
Description:
The
device
parameter specifies the name of the device that you would like to mount. The point
parameter is used to specify the name of the directory where you would like to mount the device. If the specified directory does not exist, it will be created. Once the device is mounted, the mount point will refer to the root of the file system on the device.
If the filesystem
element is absent or set to auto
, the system will attempt to detect the file system type automatically. It is not always possible to recognize some file systems due to differences in implementations. That's why you might want to specify the file system type via the filesystem
option.
If the permanent
parameter is set to true
, the device will be mounted permanently, which means that the device will be mounted automatically every time the server is started or restarted. If the parameter is set to false
or omitted, the device will be mounted temporarily, i.e. the mount point will exist for the duration of the current session only. You can change the status of the mount point to "permanent" later if you wish. In order to do that, execute the new_mount
call again passing the same parameters and values as when you created the mount point except the permanent
parameter which should be set to true
, and the active
parameter which should be omitted from the call (see code examples below). Please note that when mounting a device on the Hardware Node, the mount information is written into the /etc/fstab
file. However, when mounting a Hardware Node device inside a Virtuozzo Container, the mount information is written into one of the internal Virtuozzo script files, which are executed at the time a specific Container is started. Do not attempt to modify the fstab
file inside the Container manually as it will not work.
If the active
element is included, the command will make an attempt to attach the file system on the device to the mount point at the end of the operation. If this option is omitted or set to false
, the mount point will still be created but it will remain in the "inactive" state, in which case you will have to activate it before it can be used. To activate a mount point (to attach the filesystem on the device to it), use the new_mount
call again passing the same parameters and values as when you created the mount point except the active
parameter which should be set to true
, and the permanent
parameter which should be omitted from the call (see code examples below). If the device doesn't contain a valid file system (e.g. the CD drive is empty), the mount point will be created but will also remain in the "inactive" state. Note that temporary mounts cannot exist in the "inactive" state. If you specify the permanent
parameter and the active
parameter both set to false (or if you omit both parameters), the mount point will not be created.
To retrieve the list of the available filesystems, partitions, and devices, use the get_info
call.
On Windows, the
new_mount
call allows to do the following:
device
parameter is used to specify the physical drive letter. The point
parameter is used to specify the drive letter representing the mount point. For example, if a CD-ROM drive is assigned the letter D:
on the Hardware Node and you would like to mount it to drive letter F:
on a Virtuozzo Container, the device
parameter should contain the D:
value and the point
parameter should contain the F:
value.device
parameter to specify the image file name and path. The point
parameter must contain the drive letter that you want to use for this mount. The interface
parameter must be omitted from the request. Please note that you cannot mount the same image in more than one Container. You can create EFD images using the create_drive
call.device
parameter to specify the image file name and path on the Hardware Node. The point
parameter must contain the drive letter that you would like to use for the mount. The value of the interface
parameter must be SCSI
, which indicates that you are mounting an image as an emulated shared SCSI storage device. Before you can use the new drive inside the Container, you will have to initialize it (see the create_drive
call for more information on how to initialize the new drive in Windows and for more info Windows Cluster Server support in Virtuozzo Containers). Example 1:
Temporarily mounting a Hardware Node partition inside a Container.
<packet version="4.0.0" id="2">
<target>vzadevm</target>
<data>
<vzadevm>
<new_mount>
<device>/dev/sda2</device>
<point>/mydrive</point>
<eid>107d1f60-841e-8c43-8152-3c368ef3c366</eid>
<active>true</active>
</new_mount>
</vzadevm>
</data>
</packet>
Example 2:
Changing the status of the existing mount point from "temporary" to "permanent".
<packet version="4.0.0" id="2">
<target>vzadevm</target>
<data>
<vzadevm>
<new_mount>
<permanent>true</permanent>
<device>/dev/sda2</device>
<point>/mydrive</point>
<eid>107d1f60-841e-8c43-8152-3c368ef3c366</eid>
</new_mount>
</vzadevm>
</data>
</packet>
Example 3:
Changing the state of the existing mount point from "inactive" to "active", i.e. attaching the filesystem on the device to the mount point.
<packet version="4.0.0" id="2">
<target>vzadevm</target>
<data>
<vzadevm>
<new_mount>
<device>/dev/sda2</device>
<point>/mydrive</point>
<active>true</active>
<eid>107d1f60-841e-8c43-8152-3c368ef3c366</eid>
</new_mount>
</vzadevm>
</data>
</packet>
Example 4:
Mounting the CD-ROM drive D:
installed on the Hardware Node inside the specified Container. Assigning the drive letter F:
to the new mount inside the Container.
<packet version="4.0.0" id="2">
<target>vzadevm</target>
<data>
<vzadevm>
<new_mount>
<device>C:\</device>
<point>F:</point>
<eid>b85f10fc-e42b-4e1c-a18b-85c6a25501b8</eid>
</new_mount>
</vzadevm>
</data>
</packet>
Example 5:
Mounting an EFD filesystem image inside a Container.
<packet version="4.0.0" id="2">
<target>vzadevm</target>
<data>
<vzadevm>
<new_mount>
<device>C:\img005.efd</device>
<point>M:</point>
<eid>715d6510-b7f1-4eda-98e2-3c6b6ee1f608</eid>
</new_mount>
</vzadevm>
</data>
</packet>