You are not logged in.

#1 2011-05-18 18:30:18

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

[SOLVED]Getting write permission to a mounted partition

I bought a new hard drive and created two ext4 partitions on it. I created two folders at '/mnt/storage/{DATA1,DATA2}' and added the following to /etc/fstab:

#/dev/sdb1: LABEL="DATA1" UUID="896e2fd6-6211-49fc-a9a5-d82e9596d2ca" TYPE="ext4"
#/dev/sdb2: LABEL="DATA2" UUID="443318de-01e6-4a52-b8c4-fc26fcbb5421" TYPE="ext4"
#
UUID=896e2fd6-6211-49fc-a9a5-d82e9596d2ca /mnt/storage/DATA1 ext4 defaults,rw 0 2
UUID=443318de-01e6-4a52-b8c4-fc26fcbb5421 /mnt/storage/DATA2 ext4 defaults,rw 0 2

I though adding the `rw` flag would give me write access to the drives? They are mounted, as can be seen from `df -h`:

[jonny@jonny-arch ~]$ df -h
Filesystem                                              Size  Used Avail Use% Mounted on
udev                                                     10M     0   10M   0% /dev
run                                                      10M  244K  9.8M   3% /run
/dev/disk/by-uuid/493719fa-50eb-4402-ba4b-c073d40765fd   74G  4.7G   65G   7% /
shm                                                     2.0G  1.4M  2.0G   1% /dev/shm
tmpfs                                                   2.0G   24K  2.0G   1% /tmp
/dev/sdb1                                               193G  188M  183G   1% /mnt/storage/DATA1
/dev/sdb2                                               193G  188M  183G   1% /mnt/storage/DATA2

So what is the best way to get write access to the partitions?
Thanks, Jonny

Last edited by jonnybarnes (2011-05-18 21:29:32)

Offline

#2 2011-05-18 19:27:21

nybegynner
Member
From: Norway
Registered: 2010-02-07
Posts: 36

Re: [SOLVED]Getting write permission to a mounted partition

are they mounted as root or as user? if mounted as root, try adding the option 'users' to grant mount permissions to members of users group.

Last edited by nybegynner (2011-05-18 19:27:52)

Offline

#3 2011-05-18 19:40:53

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [SOLVED]Getting write permission to a mounted partition

I've added both `user` and `users` after `defaults,rw`, both to no avail.

Offline

#4 2011-05-18 19:41:15

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: [SOLVED]Getting write permission to a mounted partition

Could you post the output of mount  and of ls -l /mnt/storage


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2011-05-18 19:45:03

nybegynner
Member
From: Norway
Registered: 2010-02-07
Posts: 36

Re: [SOLVED]Getting write permission to a mounted partition

try

sudo chmod 0700 /mnt/storage/{DATA1,DATA2}

to change permissions of the mount point

Offline

#6 2011-05-18 19:56:01

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [SOLVED]Getting write permission to a mounted partition

From mount:

[jonny@jonny-arch DATA1]$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=498774,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k)
/dev/disk/by-uuid/493719fa-50eb-4402-ba4b-c073d40765fd on / type ext4 (rw,noatime,discard,commit=0)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,mode=1777)
/dev/sdb1 on /mnt/storage/DATA1 type ext4 (rw,noexec,nosuid,nodev,commit=0)
/dev/sdb2 on /mnt/storage/DATA2 type ext4 (rw,noexec,nosuid,nodev,commit=0)
//192.168.2.12/jonnys_mac on /mnt/nas type cifs (rw)
gvfs-fuse-daemon on /home/jonny/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=jonny)

and from ls -l

[jonny@jonny-arch DATA1]$ ls -l /mnt/storage
total 8
drwxr-xr-x 3 root root 4096 May 18 18:39 DATA1
drwxr-xr-x 3 root root 4096 May 18 18:39 DATA2

Offline

#7 2011-05-18 20:05:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: [SOLVED]Getting write permission to a mounted partition

Well the partitions are mounted as read/write.  As expected, the owner is root, and there are no write permissions for anyone else.

You could add write permissions for everyone by doing:
chmod o+w /mnt/storage/DATA1  (same for DATA2)

But... I don't suggest that for the top directory.  I prefer to create subdirectories as root on the partitions and then grant permissions to the subdirectories.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2011-05-18 20:13:05

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [SOLVED]Getting write permission to a mounted partition

so I should do `sudo mkdir /mnt/storage/DATA1/music` then `sudo chmod o+w /mnt/storage/DATA1/music`, and the same for any other sub-directories I want?

Offline

#9 2011-05-18 20:55:30

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: [SOLVED]Getting write permission to a mounted partition

That would be my opinion, yes.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#10 2011-05-18 21:29:07

jonnybarnes
Member
From: Manchester, UK
Registered: 2011-05-11
Posts: 129
Website

Re: [SOLVED]Getting write permission to a mounted partition

This worked, thank you.

Offline

Board footer

Powered by FluxBB