Question: Mounting A File System On Amazon Web Services
2
gravatar for Peter
8.5 years ago by
Peter170
Peter170 wrote:

Hi,

I'm trying to use an Amazon Web Server linux instance to do some bioinformatics work. I believe I have setup an attached storage area that I'd like to work directly off of, but for some reason it requires I use "sudo" to write anything to the mounted drive. Is there any way to overcome this?

Also, I am trying to run Maq commands, but I get the following error if I type "sudo maq" vs. "maq" at the command line:

sudo: maq: command not found

vs.

Program: maq (Mapping and Assembly with Qualities) Version: 0.7.1 Contact: Heng Li lh3@sanger.ac.uk

Usage: maq <command/> [options]

Key commands: fasta2bfa convert FASTA to BFA format fastq2bfq convert FASTQ to BFQ format

etc.

The later indicates to me that maq is properly installed...so why can't I just prepend the commands with sudo to get my script to work?

Thanks for any help you all can provide.

linux • 1.7k views
ADD COMMENTlink modified 8.5 years ago by Giovanni M Dall'Olio26k • written 8.5 years ago by Peter170

Can you describe how the storage area is attached? Is there an entry in /etc/fstab? If mounted as root, then you can only write as root by default, unless you make some configuration changes.

ADD REPLYlink written 8.5 years ago by Neilfws48k

That would imply the problem is present when run as normal user, absent when run as root. Peter describes the reverse situation, which suggests to me maq is on the normal user's path but not the root path.

ADD REPLYlink written 8.5 years ago by David Quigley11k

Well there appear to be two issues: can't write to location unless root, maq not in path for root. I assumed the only reason for running maq as sudo was the need to write as root.

ADD REPLYlink written 8.5 years ago by Neilfws48k

This question is more related to mounting a file system and to file permissions on unix than to the maq software. I would change the title.

ADD REPLYlink written 8.5 years ago by Giovanni M Dall'Olio26k
2
gravatar for David Quigley
8.5 years ago by
David Quigley11k
San Francisco
David Quigley11k wrote:

Check this thread on StackOverflow. Sudo on ubuntu handles the path differently from execution as a regular user:

http://stackoverflow.com/questions/257616/sudo-changes-path-why

Most likely you wouldn't see this if you execute maq in the directory where it is locally installed.

ADD COMMENTlink written 8.5 years ago by David Quigley11k
0
gravatar for Darked89
8.5 years ago by
Darked894.2k
Barcelona, Spain
Darked894.2k wrote:

As a regular user execute:

which maq

That will point you to the location of the executable file. Most likely /path/to/your/maq/executable is not included in root's PATH environmental variable.

ADD COMMENTlink written 8.5 years ago by Darked894.2k
0
gravatar for Giovanni M Dall'Olio
8.5 years ago by
London, UK
Giovanni M Dall'Olio26k wrote:

This is a problem of Unix permissions.

Do a ls -l on your folder to see which is your username and group:

$: ls -l ~
total 60
-rw-r--r--  1 gioby gioby    0 2010-11-15 18:37 file1
drwxr-xr-x  2 gioby gioby 4096 2010-11-16 12:03 Desktop
drwxr-xr-x  2 gioby gioby 4096 2010-11-16 12:55 Documents
drwxr-xr-x  3 gioby gioby 4096 2010-11-15 16:57 Downloads

(here, my username is gioby and my group is gioby)

then check the owner and group of the folder which is giving you problems:

$: ls -l /mnt
total 60
-rw-r--r--  1 gioby gioby    0 2010-11-15 18:37 file1
drwxr-xr-x  2 gioby gioby 4096 2010-11-16 12:03 Desktop
drwxr-xr-x  2 gioby gioby 4096 2010-11-16 12:55 Documents
drwxr-xr-x  3 gioby gioby 4096 2010-11-15 16:57 Downloads

if it is different from your username and password, change it with the chown command:

$: sudo chown -R gioby:gioby /mnt

if you still are having problems, change the permissions to make it writeable to group:

$: sudo chmod g+w -R /mnt

Also, it is probable that the cause of this is that you are using a wrong command to mount the partition. Be sure that you are using the -w and -o user=youruser flags.

$: sudo mount /dev/??? /mnt -w -o user=yourusername
ADD COMMENTlink modified 8.5 years ago • written 8.5 years ago by Giovanni M Dall'Olio26k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1622 users visited in the last hour