Mounting A File System On Amazon Web Services
3
2
Entering edit mode
11.9 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:

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?

linux • 2.5k views
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.

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.

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.

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.

2
Entering edit mode
11.9 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.

0
Entering edit mode
11.9 years ago
Darked89 4.2k

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.

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


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