After creating an instance, any data volumes that were attached to the instance must be mounted on the instance. To mount a storage volume, after logging in to the instance using SSH, do the following:
- List the devices available on the instance:
- ls /dev/xvd*
- Device names start from
/dev/xvdb
and are determined by the index number that you assigned while attaching a storage volume. 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. - Determine the device name corresponding to the disk index number that you want to mount.
- For example, if you want to mount the storage volume that you had attached at index 2, the device name would be
/dev/xvdc
. - 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/xvdc
, enter the following command: - sudo mkfs -t ext3 /dev/xvdc
- Note: If the Extended File System utilities are not available on your instance, you’ll see a message such as the following:
- mkfs.ext3: No such file or directory
- To install the Extended File System utilities, enter the following command:
- sudo yum install e4fsprogs
- Create a mount point directory on your instance.
- For example, to create the mount point
/mnt/store
, enter the following command: - sudo mkdir /mnt/store
- Mount the storage volume on the mount point that you just created.
- For example, to mount the device
/dev/xvdc
at the /mnt/store
directory, enter the following command: - sudo mount /dev/xvdc /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, use the
blkid
command. - To make the mount persistent across instance restarts, edit the
/etc/fstab
file and add the mount as an entry in that file, as shown in the following example: - /dev/xvdc /mnt/store ext3 defaults 0 0