Mount a Volume

To access a storage volume, you must attach it to your instance and mount it.

Note:

When an instance is deleted and re-created or shut down and restarted, storage volumes that were attached manually (that is, not attached automatically through the orchestration that was used to create the instance) must be attached again.

To prevent the boot issue, either do not add entries for manually attached volumes or use the 'nofail' option and set the last field to zero (don't fsck) in /etc/fstab for any manually attached volume, such as:.

/dev/xvdd /mnt/store ext3 defaults,nofail 0 0
  1. Connect to the instance using ssh. See Log In to a VM Using SSH.
  2. List the devices available on your instance:
    ls /dev/xvd*
    Device names start from /dev/xvdb and are determined by the index number that you assigned when you attached the storage volumes. For example, if you attached a storage volume at index 1, the volume gets the device name, /dev/xvdb. The storage volume at index 2 would be /dev/xvdc, the storage volume at index 3 would be /dev/xvdd, and so on.
  3. Identify the device name corresponding to the disk number that you want to mount.

    For example, if you want to mount the storage volume that you had attached at index 3, the device name would be /dev/xvdd.

  4. When mounting a storage volume for the first time, after formatting the storage volume, use a tool such as mkfs to create a file system on the storage volume. For example, to create an ext3 file system on /dev/xvdd, run the following command:
    sudo mkfs -t ext3 /dev/xvdd

    Note:

    If the Extended File System utilities aren’t available on your instance, a message such as the following is displayed:

    mkfs.ext3: No such file or directory

    To install the Extended File System utilities, run the following command:

    sudo yum install e4fsprogs

  5. Create a mount point on your instance. For example, to create the mount point /mnt/store, run the following command:
    sudo mkdir /mnt/store
  6. Mount the storage volume on the mount point that you created on your instance. For example, to mount the device /dev/xvdd at the /mnt/store directory, run the following command:
    sudo mount /dev/xvdd /mnt/store

    If you prefer, you can specify the disk UUID instead of the device name in the mount command. To find out the UUID of the disks attached to your instance, run the blkid command.

  7. To make the mount persistent across instance restarts, edit the /etc/fstab file and add the mount as an entry in that file.

Note:

When an instance is deleted and re-created, or shut down and restarted, storage volumes that were attached manually (that is, not attached automatically through the orchestration used to create the instance) are not attached automatically. To prevent the boot issue, either do not add entries for manually attached volumes or use the 'nofail' option and set the last field to zero (don't fsck) in /etc/fstab for any manually attached volume, such as:

/dev/xvdd /mnt/store ext3 defaults,nofail 0 0
For information about unmounting a storage volume, see Unmounting a Storage Volume from a Linux Instance in Using Oracle Cloud Infrastructure Compute Classic.