Previous page

Next page

Locate page in Contents

Print this page

new_mount

Summary:

Mounts a Hardware Node device on the Hardware Node or inside a Virtuozzo Container.

Request specification:

Name

Min/Max

Type

Description

new_mount

 

mount_deviceType

 

{

 

 

 

eid

1..1

eid_type

Server ID.

}

 

 

 

Returns:

OK/Error

Description:

Linux 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.

WindowsOn Windows, the new_mount call allows to do the following:

Linux 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>

Linux 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>

Linux 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>

WindowsExample 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>

WindowsExample 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>

Please send us your feedback on this help page