Connecting to Volumes With Consistent Device Paths
Oracle Cloud Infrastructure supports consistent device paths for block volumes that are attached to compatible Linux-based instances. When you attach a block volume to an instance, you can select a device path that remains consistent between instance reboots. This enables you to use a consistent device path when you refer to the volume to perform tasks such as:
-
Creating partitions.
-
Creating file systems.
-
Mounting file systems.
-
Specifying options in the
/etc/fstab
file to ensure that volumes are mounted properly when automatically mounting volumes on instance boot. For more information, see fstab Options for Block Volumes Using Consistent Device Paths.
When you use consistent device paths on compatible Linux-based instances, the boot volume's device path is:
/dev/oracleoci/oraclevda
Device paths are required when attaching a volume configured for the Ultra High Performance level.
Device paths are not available when you attach a boot volume as a data volume to a second instance.
Images that Support Consistent Device Paths
Consistent device paths are supported and enabled by default on instances when all of the following things are true:
- The instance was created using a platform image.
- The image is a Linux-based image.
- The image was released in November 2018 or later. For specific version numbers, see Image Release Notes.
- The instance was launched after January 11, 2019.
For instances launched using the image OCID or an existing boot volume, if the source image supports consistent device paths, the instance supports device paths.
Consistent device paths are not enabled by default for Linux-based partner images and custom images created from other sources. You can enable consistent device paths for these images by editing the image capabilities for the custom image using the steps described below. This feature does not apply to Windows-based images.
- Open the navigation menu and click Compute. Under Compute, click Custom Images.
-
Click the custom image that you want to enable consistent device paths for.
-
Click Edit image capabilities.
-
In the Consistent volume naming section select Enabled.
-
Click Save changes.
Device Paths in the Console
You select a device path when you attach a block volume to an instance.
If you specify a device path, the path appears in the Attached Block Volumes list for an instance, in the Device Path field.
Device Paths on the Instance
Use the following sample commands to perform various configuration tasks on the attached volume. Commands are provided for volumes that use consistent device paths and for volumes that don't.
-
No device path specified:
fdisk /dev/sdb
-
Device path specified:
fdisk /dev/oracleoci/oraclevdb
-
No device path specified:
/sbin/mkfs.ext3 /dev/sdb1
-
Device path specified:
/sbin/mkfs.ext3 /dev/oracleoci/oraclevdb1
-
No device path specified:
UUID=84dc162c-43dc-429c-9ac1-b511f3f0e23c /oradiskvdb1 xfs defaults,_netdev,noatime 0 2
-
Device path specified:
/dev/oracleoci/oraclevdb1 /oradiskvdb1 ext3 defaults,_netdev,noatime 0 2
-
No device path specified:
mount /dev/sdb1 /oradiskvdb1
-
Device path specified:
mount /dev/oracleoci/oraclevdb1 /oradiskvdb1