Jury A
Jury A

Reputation: 20082

The attached volume does not appear

I have an instance that I need to attach and mount a volume to it. I have some unsuccessful attempts, then finally, I unmounted the volume.

Then I performed the following command sudo df -h to know the volumes before I attach the volume from a public snapshot. I got:

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      8.0G  989M  6.7G  13% /
udev             17G  8.0K   17G   1% /dev
tmpfs           6.7G  164K  6.7G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             17G     0   17G   0% /run/shm
/dev/xvdb       827G  201M  785G   1% /mnt

Then, I attached a volume (that I created from a publicly available snapshot) to my instance. See: enter image description here

Then, I made sure that the status for the volume is attached to my instance. I performed the command again. I got the same previous output before I attach the volume.

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      8.0G  989M  6.7G  13% /
udev             17G  8.0K   17G   1% /dev
tmpfs           6.7G  172K  6.7G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             17G     0   17G   0% /run/shm
/dev/xvdb       827G  201M  785G   1% /mnt

The reason that I am doing this is that I need to mount the newly attached volume. There were several unsuccessful attempts in this post if you need more information about my problem: How to search for a file or directory in Linux Ubuntu machine

Please, help me to solve this issue.

Upvotes: 3

Views: 5863

Answers (2)

mblackwell8
mblackwell8

Reputation: 3065

I'm still fairly inexperienced at Unix sysadmin (enough to be dangerous?), but I had exactly this problem - according to the AWS console, the volume should be attached at /dev/sdj, but it wasn't.

Then I noticed that my previous volume (listed as /dev/sda1), wasn't there either, but instead was called /dev/xvda1. Tiny bit of pattern recognition later and I realised that my volume was listed under xvdj

sudo mount /dev/xvdj /path/to/your/directory

... and the mounted volume was the one I was looking for.

Maybe someone can fill me in on why, in the comments?

Upvotes: 1

j0nes
j0nes

Reputation: 8109

After attaching the volume, you still have to mount it:

mount -t <fs_type> /dev/xvdf /path/to/your/directory

Upvotes: 1

Related Questions