0

I created an EC2 instance (Ubuntu 64 bit) and attached a volume from a publicly available snapshot to the instance. I successfully mounted the volume. I am supposed to be able to run a script from this attached volume using the following steps as explained in the tutorial:

Log in to your virtual machine. 
mkdir /space 
mount /dev/sdf1 /space 
cd /space 
./setup-script

The problem is that, when I try: ./setup-script I got the following message: -bash: ./setup-script: No such file or directory

What is the problem ? How can I search for the ./setup-script in the whole machine ? I'm not very familiar with linux system. Please, help.

For more details about the issue: Look at my previous post: Error when mounting drive

Community
  • 1
  • 1
Jury A
  • 19,192
  • 24
  • 69
  • 93
  • mkdir /space; mount /dev/sdf1 /space; cd /space; ./setup-script – Nick Maroulis Sep 22 '12 at 20:23
  • This is what i did exactly. I will edit the port. It was a typing mistake. – Jury A Sep 22 '12 at 20:39
  • ls -la /space what does this say – Nick Maroulis Sep 22 '12 at 20:43
  • @marabutt: I get the following list: . ; .. ; bin ; boot ; dev ; etc ; home ; initrd.img -> /boot/initrd.img-3.2.0-29-virtual ; lib ; lib64 ; lost+found ; media ; mnt ; opt ; proc ; root ; run ; sbin ; selinux ; space ; srv ; sys ; tmp ; usr ; var ; vmlinuz -> boot/vmlinuz-3.2.0-29-virtual. NOTE: the directory space seems like a loop, whenever I type: cd space, I then type: ls , I find the directory again and again. – Jury A Sep 22 '12 at 21:34
  • I don't find any directory named setup-script. But this is what is written in the tutorial, see step 5 in: https://www.eff.org/pages/howto-using-ssl-observatory-cloud. How can I search about this setup-script everywhere in the machine ?? – Jury A Sep 22 '12 at 21:37

2 Answers2

0
# Is it a script or an executable ?
file /space/setup-script
# Show us it is readable and marked executable
ls -l /space/setup-script
# Mark it executable
chmod a+x /space/setup-script
# Then try running it again?  If you know it is shell script you can:
bash /space/setup-script

If still not working, then we get into why it wont execute.

grep space /proc/mounts

Does the options it have noexec ?

Try mount -o remount,exec /space now try your instructions again.

NOTE: All commands presume you are 'root' user or you can 'sudo' each command.

Darryl Miles
  • 4,576
  • 1
  • 21
  • 20
  • The problem is that I get: ls: cannot access /space/setup-script: No such file or directory. I have attached a volume from a public snapshot and the tutorial says that I am supposed to find setup-script and be able to run the script. See step 5 at: https://www.eff.org/pages/howto-using-ssl-observatory-cloud . I have made mount but using the following command instead of what they wrote: sudo mount /dev/xvda1 /space. Then, I am not able to find continue step 5 due to the fact that I can't find such file or directory (setup-script). How can I search for it ? – Jury A Sep 22 '12 at 21:42
  • but you are able to `cd /space` and then `ls -l` and you can see the files you expect, including `setup-script` ? The command `df` shows the volumes mounted, your /space should be listed there (if it is mounted). – Darryl Miles Sep 22 '12 at 21:50
  • No. I can't see the `setup-script` when I `ls -l`. – Jury A Sep 22 '12 at 22:35
  • 1
    But a volume is mounted in /space ? Then you mounted the wrong volume, or the data you expected has been deleted from it. – Darryl Miles Sep 22 '12 at 22:36
  • It is v. low probability that the data has been moved. But, my question is: the tutorial is saying that: mount /dev/sdf1 /space but I performed: sudo mount /dev/xvda1 /space. Could this be a reason or there is nothing wrong with this? – Jury A Sep 23 '12 at 02:19
  • it sounds like you're not mounting the proper device. If you assigned your EBS to sdf than you need to do "mount /dev/xvdf1 /space" or add that to your fstab file. – Kevin Willock Sep 23 '12 at 09:02
0

It is possible that you have mounted the wrong device. I've just recalled a trick you can use to find the device name of an EBS volume in Linux, since it is often different from the device name reported in the AWS console. First unmount the device in Linux, then detach it from the instance using the AWS console, so we go back to the original state. Now run this command in Linux:

cat /proc/partitions

The command will show the volumes currently attached. The next step is to attach the volume to the instance using the AWS console, and then to run that same command again in Linux. You should see an additional line appear. This line will tell you the name of the device to mount. For example, I get this output in my Ubuntu instance:

major minor  #blocks  name

 202        1    8388608 xvda1
 202       80    8388608 xvdf

The first line was already there before I attached the volume, so I know this is my root volume. The second line is the one that appeared, so in this case, the device to mount would be /dev/xvdf.

David Levesque
  • 22,181
  • 8
  • 67
  • 82
  • For the unmount, I'm facing a problem. I mounted using the following command: `sudo mount /dev/xvda1 /space` , I unmount using the following: `sudo umount /dev/xvda1` and I get: `umount: /: device is busy.(In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))`. I also tried: `sudo umount /space` and `got: umount: /space: not mounted`. What should I do to unmount it? – Jury A Sep 23 '12 at 10:04
  • I could unmount by using `sudo umount -l /dev/xvda1`. But, when trying to `cat /proc/partitions`, I get: `cat: proc/partitions: No such file or directory`. I am in the root, I could list and found a directory names proc but it does not contain anything. I tried to list proc but it shows total 0. please, advise. – Jury A Sep 23 '12 at 10:22
  • Sorry I don't understand why you don't have /proc/partitions. It is usually standard in Ubuntu. I'm puzzled. – David Levesque Sep 23 '12 at 13:44
  • It worked now. Before attach, I got: `202 1 8388608 xvda1 202 16 880737792 xvdb`. After attach, I got: `202 1 8388608 xvda1 202 16 880737792 xvdb 202 80 94371840 xvdf 202 81 85979848 xvdf1`. To which one should I mount? there are two volumes added ? – Jury A Sep 23 '12 at 14:13
  • I got: mount: unknown filesystem type 'jfs'. Do you think I should change the instance type from Ubuntu to something else? – Jury A Sep 23 '12 at 14:18
  • Try installing the jfsutils package: `sudo apt-get install jfsutils`. If it still doesn't work, try running `sudo depmod -a` before mounting. – David Levesque Sep 23 '12 at 14:42