3

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.

Community
  • 1
  • 1
Jury A
  • 19,192
  • 24
  • 69
  • 93

2 Answers2

1

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

mount -t <fs_type> /dev/xvdf /path/to/your/directory
j0nes
  • 8,041
  • 3
  • 37
  • 40
  • The problem is that I don't know to which device I mount. In your command, how did you know that I have to mount to /dev/xvdf ?? – Jury A Sep 23 '12 at 11:48
  • In the "Attach Volume" dialogue from the Amazon Console, you can specify which device your volume should be - in your case /dev/sdf (which gets translated to /dev/xvdf). – j0nes Sep 23 '12 at 12:11
  • How can I find the approperiate ? – Jury A Sep 23 '12 at 12:36
  • You said you were using a public snapshot. According to the [Amazon Public Dataset docs](http://aws.amazon.com/en/publicdatasets/), these should be in ISO9660 or EXT3 filesystem types. So your fs_type for the mount command should be `iso9660` or `ext3`. – j0nes Sep 23 '12 at 12:53
  • Still not able to.. `$ sudo mount -t iso9660 /dev/xvdf /space` , I get: `mount: wrong fs type, bad option, bad superblock on /dev/xvdf, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. – Jury A Sep 23 '12 at 13:32
  • Then I tried: `$ sudo mount -t ext3 /dev/xvdf /space`, and I got: `mount: wrong fs type, bad option, bad superblock on /dev/xvdf, missing codepage or helper program, or other error. In some cases useful info is found in syslog - try dmesg | tail or so. I am following a tutorial, specifically, stuck in step 5, this might help: https://www.eff.org/pages/howto-using-ssl-observatory-cloud – Jury A Sep 23 '12 at 13:52
  • Well this is a custom dataset - but the filesystem type is given in the link: `provided it can mount JFS filesystems.` Therefore try `mount -t jfs` – j0nes Sep 23 '12 at 14:07
1

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?

mblackwell8
  • 3,065
  • 3
  • 21
  • 23
  • 1
    Just noticed a helpful explanation on the AWS dialog box, duh... Note: Newer linux kernels may rename your devices to /dev/xvdf through /dev/xvdp internally, even when the device name entered here (and shown in the details) is /dev/sdf through /dev/sdp. – mblackwell8 Nov 19 '12 at 04:08