> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmo/how-to/mount-cinder-volumes-to-instances-by-uuid.md).

# Mount Cinder Volumes to Instances by UUID

## Problem

When attaching multiple Cinder Volumes to an instance, it is possible that the mount points will be jumbled on reboot. Mounting the volumes by UUID ensures the proper volumes are reattached to the correct mount points in the event the instance requires a power cycle.

## Environment

* Platform9 Managed OpenStack - All Versions

## Procedure

1\. Once you have mounted the volume(s) to the instance in the UI per the instruction provided in the article, [Cinder Block Storage Integration in Platform9](https://docs.platform9.com/support/cinder-block-storage-integration/), SSH to the instance and verify the disk has been attached properly.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# fdisk -lDisk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x55bca5c1Device Boot Start End Sectors Size Id Type/dev/vda1 * 2048 41943006 41940959 20G 83 LinuxDisk /dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
```

{% endtab %}
{% endtabs %}

Notice disk ***/dev/vdb*** does not yet have any partitions configured.

2\. Start the\*\*`fdisk`\*\* utility to format and partition the new disk.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# fdisk /dev/vdbWelcome to fdisk (util-linux 2.27.1).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition table.Created a new DOS disklabel with disk identifier 0x27c730b0.Command (m for help):
```

{% endtab %}
{% endtabs %}

3\. Make the following selections at the "Command (m for help):" prompt:

* n - to create a new partition
* p - to make the new partition a primary partition
* 1 - to make this the first partition

{% tabs %}
{% tab title="None" %}

```none
root@host:~# fdisk /dev/vdbWelcome to fdisk (util-linux 2.27.1).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition table.Created a new DOS disklabel with disk identifier 0x27c730b0.Command (m for help): nPartition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions)Select (default p): pPartition number (1-4, default 1): 1First sector (2048-10485759, default 2048):Last sector, +sectors or +size{K,M,G,T,P} (2048-10485759, default 10485759):Created a new partition 1 of type 'Linux' and of size 5 GiB.Command (m for help):
```

{% endtab %}
{% endtabs %}

To use the default first and last sectors of the disk, simply press "Enter" with no value entered.

4\. Proceed with the following selections:

* t - to change the partition type
* 83 - to change the partition type to 'Linux'

{% tabs %}
{% tab title="None" %}

```none
Command (m for help): tSelected partition 1Partition type (type L to list all types): 83Changed type of partition 'Linux' to 'Linux'.
```

{% endtab %}
{% endtabs %}

5\. Complete partitioning with these selections:

* p - to print the partition table
* w - to write the table to disk and exit the utility

{% tabs %}
{% tab title="None" %}

```none
Command (m for help): pDisk /dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x27c730b0Device Boot Start End Sectors Size Id Type/dev/vdb1 2048 10485759 10483712 5G 83 LinuxCommand (m for help): wThe partition table has been altered.Calling ioctl() to re-read partition table.Syncing disks.
```

{% endtab %}
{% endtabs %}

6\. You will now see your new ( */dev/vdb1*) partition in the \*\*`fdisk -l`\*\*output.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# fdisk -lDisk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x55bca5c1Device Boot Start End Sectors Size Id Type/dev/vda1 * 2048 41943006 41940959 20G 83 LinuxDisk /dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x27c730b0Device Boot Start End Sectors Size Id Type/dev/vdb1 2048 10485759 10483712 5G 83 Linux
```

{% endtab %}
{% endtabs %}

7\. Create a filesystem on the new partition.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# mkfs.ext4 /dev/vdb1mke2fs 1.42.13 (DD-MON-YYYY)Creating filesystem with 1310464 4k blocks and 327680 inodesFilesystem UUID: c70e880a-5702-4b5c-92fe-ccadcc3614caSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
```

{% endtab %}
{% endtabs %}

8\. Collect the UUID of the new volume.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# blkid/dev/vda1: LABEL="cloudimg-rootfs" UUID="5c615711-516f-4eb1-bca9-592288a14b59" TYPE="ext4" PARTUUID="55bca5c1-01"/dev/vdb1: UUID="c70e880a-5702-4b5c-92fe-ccadcc3614ca" TYPE="ext4" PARTUUID="27c730b0-01"
```

{% endtab %}
{% endtabs %}

9\. Determine what directory you will mount your volume and create it if necessary.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# mkdir /dataroot@host:~# mkdir /data/goeshere
```

{% endtab %}
{% endtabs %}

10\. Mount the volume.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# mount /dev/disk/by-uuid/c70e880a-5702-4b5c-92fe-ccadcc3614ca /data/goeshere
```

{% endtab %}
{% endtabs %}

11\. Edit the */etc/fstab* file with your preferred text editor to add the mount point to persist after a reboot.

{% tabs %}
{% tab title="None" %}

```none
/dev/disk/by-uuid/c70e880a-5702-4b5c-92fe-ccadcc3614ca /data/goeshere auto defaults,nofail 0 3
```

{% endtab %}
{% endtabs %}

12\. Verify the volume was mounted properly.

{% tabs %}
{% tab title="None" %}

```none
root@host:~# df -hFilesystem Size Used Avail Use% Mounted onudev 994M 0 994M 0% /devtmpfs 201M 3.1M 197M 2% /run/dev/vda1 20G 861M 19G 5% /tmpfs 1001M 0 1001M 0% /dev/shmtmpfs 5.0M 0 5.0M 0% /run/locktmpfs 1001M 0 1001M 0% /sys/fs/cgrouptmpfs 201M 0 201M 0% /run/user/1000/dev/vdb1 4.8G 10M 4.6G 1% /data/goeshere
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://platform9.com/kb/pmo/how-to/mount-cinder-volumes-to-instances-by-uuid.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
