Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounting ext3 partition for storage
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
marsbt
n00b
n00b


Joined: 18 Sep 2004
Posts: 53

PostPosted: Sat Jan 08, 2005 6:00 am    Post subject: Mounting ext3 partition for storage Reply with quote

Hi,

I added another disk (old 20G) disk to my system and formatted it with ext3. I plan to use it to edit my home videos as I don't have space for that in my /home. Now the problem is that even though I was able to mount it as user(earlier I couldn't even mount as a normal user), I can't write on that partition. Here are my relevant /etc/fstab entries:
Code:
/dev/hdb9    /media/disk-video   ext3   noauto,user,rw   0 0

when I try to make a directory after mounting, I get the following:
Code:
sam@earth:/media/disk-video$ ls -al
total 21
drwxr-xr-x  3 root root  4096 2004-11-08 16:05 .
drwxr-xr-x  7 root root  1024 2005-01-07 23:39 ..
drwx------  2 root root 16384 2004-07-05 22:14 lost+found
sam@earth:/media/disk-video$ mkdir movies
mkdir: cannot create directory `movies': Permission denied

I know I don't have permissions to write. Its only the root who has write permissions. To permitting users for writing, I thought the user option in /etc/fstab entry should have been enough. But I think its not. Am I missing something??

Can someone help?
Back to top
View user's profile Send private message
rfdonnelly
n00b
n00b


Joined: 31 Dec 2004
Posts: 68
Location: Riverside, CA USA

PostPosted: Sat Jan 08, 2005 7:19 am    Post subject: Reply with quote

It is because of your permissions on /media/disk-video. As root try a
# chmod 777 /media/disk-video
Back to top
View user's profile Send private message
marsbt
n00b
n00b


Joined: 18 Sep 2004
Posts: 53

PostPosted: Sat Jan 08, 2005 7:35 am    Post subject: Reply with quote

Wouldn't that be kind of brute force? I was expecting a solution so that the permissions are set from /etc/fstab

I also tried using the umask option but I think it doesn't work with ext3 filesystem!

UPDATE: Using chmod 777 /media/disk-video does not help. The reason being that at mount time the permission are changed back to drwxr-xr-x
Back to top
View user's profile Send private message
rfdonnelly
n00b
n00b


Joined: 31 Dec 2004
Posts: 68
Location: Riverside, CA USA

PostPosted: Sat Jan 08, 2005 8:06 am    Post subject: Reply with quote

You should issue the chmod after you mount.

Before mount, /media/disk-video is a directory but after mount it is a mount point. After mount, /media/disk-video represents the root of the disk and thus takes on the permissions of the disk's root.
Back to top
View user's profile Send private message
marsbt
n00b
n00b


Joined: 18 Sep 2004
Posts: 53

PostPosted: Sat Jan 08, 2005 8:09 am    Post subject: Reply with quote

Will I have to do it everytime I mount the partition?
Back to top
View user's profile Send private message
rfdonnelly
n00b
n00b


Joined: 31 Dec 2004
Posts: 68
Location: Riverside, CA USA

PostPosted: Sat Jan 08, 2005 8:52 am    Post subject: Reply with quote

No because when the disk is mounted you are changing the permissions for the root of the disk, not the permissions of the directory on the main disk. The permissions for the root of the disk are stored just like any other directory. Therefore, when you remount the disk the permissions will be as you left them.
Back to top
View user's profile Send private message
marsbt
n00b
n00b


Joined: 18 Sep 2004
Posts: 53

PostPosted: Sat Jan 08, 2005 5:18 pm    Post subject: Reply with quote

Thanks a lot. Tried that and its working fine.

Another question is with chmod 777 everyone has access to all files in that partition. How can I make the permissions like they are for /tmp? I mean, only the the user who created the file can remove or move it, etc.
Back to top
View user's profile Send private message
rfdonnelly
n00b
n00b


Joined: 31 Dec 2004
Posts: 68
Location: Riverside, CA USA

PostPosted: Sat Jan 08, 2005 7:39 pm    Post subject: Reply with quote

When you chmod 777 a directory it just means other users can create files in it. If you create a file in that directory the permissions for that file is 644 (read/write for owner and read only for everyone else). Since no one else but you can write to the file, no one else but you can delete it (except for root of course).

Here is a decent articles on *nix file permissions: http://www.freeos.com/articles/3127/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum