Go to main content

Securing Systems and Attached Devices in Oracle® Solaris 11.4

Exit Print View

Updated: July 2019
 
 

How to Mount an Allocated Device

Devices mount automatically if you are granted the appropriate privileges. Follow this procedure if the device fails to mount.

Before You Begin

You have allocated the device. You are assigned the privileges that are required for mounting the device, as described in How to Authorize Users to Allocate a Device.

  1. Assume a role that can allocate and mount a device.
    $ su - role-name
    Password: <Type role-name password>
    $
  2. Create and protect a mount point in the role's home directory.

    You only need to do this step the first time that you need a mount point.

    $ mkdir mount-point ; chmod 700 mount-point
  3. List the allocatable devices.
    $ list_devices -l
    List of allocatable devices
  4. Allocate the device.

    Specify the device by device name.

    $ allocate device-name
  5. Mount the device.
    $ mount -o ro -F filesystem-type device-path mount-point
    –o ro

    Indicates that the device is to be mounted read-only. Use–o rw to make the device writable.

    –F filesystem-type

    Indicates the file system format of the device. Typically, a CD-ROM is formatted with an HSFS file system.

    device-path

    Indicates the path to the device. The output of the list_devices -l command includes the device-path.

    mount-point

    Indicates the mount point that you created in Step 2.

Example 17  Allocating a CD-ROM Drive

In this example, a user assumes a role that can allocate and mount a CD-ROM drive, sr0. The drive is formatted as an HSFS file system.

$ roles
devicealloc
$ su - devicealloc
Password: <Type devicealloc password>
$ mkdir /home/devicealloc/mymnt
$ chmod 700 /home/devicealloc/mymnt
$ list_devices -l
...
device: sr0 type: sr files: /dev/sr0 /dev/rsr0 /dev/dsk/c0t2d0s0 ...
...
$ allocate sr0
$ mount -o ro -F hsfs /dev/sr0 /home/devicealloc/mymnt
$ cd /home/devicealloc/mymnt ; ls
List of the contents of CD-ROM

Troubleshooting

    If the mount command cannot mount the device, the mount: insufficient privileges error message is displayed: Check the following:

  • Verify that you are executing the mount command in a profile shell. If you have assumed a role, the role has a profile shell. If you are a user who has been assigned a profile with the mount command, you must create a profile shell. For the list of available profile shells, see the pfexec(1) man page.

  • Verify that you own the specified mount point. You must have read, write, and execute access to the mount point.

Contact your administrator if you still cannot mount the allocated device. See How to Troubleshoot Rights Assignments in Securing Users and Processes in Oracle Solaris 11.4 is a starting point.