Mounting A File System On Amazon Web Services
3
2
Entering edit mode
14.0 years ago
Peter ▴ 170

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 • 3.2k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
2
Entering edit mode
14.0 years ago

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

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

ADD COMMENT
0
Entering edit mode
14.0 years ago
Darked89 4.7k

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 COMMENT
0
Entering edit mode
14.0 years ago

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 also 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 COMMENT

Login before adding your answer.

Traffic: 1649 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6