LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-03-2011, 08:45 PM   #1
chadwick
Member
 
Registered: Apr 2005
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105

Rep: Reputation: 17
Same fs type and fstab line gives different automount permissions for different disks


I have two usb drives. Both are Western Digital. One is maybe a couple years older than the other. The older uses USB 2 and is 300 GB while the newer one uses USB 3 and is 500 GB.

The thing I'm trying to understand is why they would automount with different permissions and ownerships. They are both formatted as a single partition with ext3fs. fdisk -l says:
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60798   488352768   83  Linux
for the newer one and
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       38914   312569856   83  Linux
for the older one.

Aside from the UUID, the fstab entries for the two are identical:
Code:
UUID=91ea837a-e675-4989-bc8c-0efeff31486a       /media/disk1        auto            noauto,user,noexec              0       0
UUID=936bcef4-7817-4911-a9e4-8f1cdc257a1b       /media/disk2           auto            noauto,user,noexec              0       0
where disk1 is the older disk.

Without neither one mounted, ls /media/* -ld reports:

Code:
drwxr-xr-x 2 root root 4096 Jan 16  2011 /media/disk1/
drwxr-xr-x 2 root root 4096 Aug  3 21:03 /media/disk2/
Then if I plug them in it says:
Code:
drwxr-xr-x 33 fred fred 4096 Aug  2 17:27 /media/disk1/
drwxrwxrwx  4 root root 4096 Aug  3 15:05 /media/disk2/
If I unmount them and mount them both with the mount command with username fred then the same thing happens.

If I switch the directories in the fstab file to:
Code:
UUID=91ea837a-e675-4989-bc8c-0efeff31486a  	/media/disk2		auto    	noauto,user,noexec     		0       0
UUID=936bcef4-7817-4911-a9e4-8f1cdc257a1b  	/media/disk1		auto    	noauto,user,noexec     		0       0
i.e., just reverse the names of the directories, then the same thing happens. The difference in permissions still exists, and with the directory names reversed,. So it seems that the permissions and user are dependent on what kind of disk it is:
Code:
drwxr-xr-x 33 fred fred 4096 Aug  2 17:27 /media/disk2
drwxrwxrwx  4 root root 4096 Aug  3 15:05 /media/disk1
I'm curious if anyone can explain what's going on and what the better way to go about configuring the mounting of these disks is.

Last edited by chadwick; 08-03-2011 at 08:48 PM.
 
Old 08-03-2011, 09:55 PM   #2
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
I don't know how to check this exactly, but you need to check the ownership of the drives! The one that is mounting correctly is owned by the logged in user when you mount it while the one that is mounting with read-only is not. (probably owned by root)
I've had this with flash drives and sd cards, it's a common problem after installing a new system. (or using ext2/3/4 file systems between different computers!)
 
Old 08-04-2011, 09:55 AM   #3
chadwick
Member
 
Registered: Apr 2005
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105

Original Poster
Rep: Reputation: 17
Thanks for pointing that out. It turns out I just had to use chown and chmod to change the ownership and permissions of the directory that gets mounted. Funny that here I thought it was something unpredictable and mysterious about the automatic mounting process.

Last edited by chadwick; 08-04-2011 at 09:56 AM.
 
Old 08-04-2011, 10:21 AM   #4
chadwick
Member
 
Registered: Apr 2005
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105

Original Poster
Rep: Reputation: 17
I guess my confusion arose from the fact that it's not really a directory that gets mounted but a partition. The directory itself stays on the local machine but shows different permissions depending on the partition that you mount on it. It makes sense then that a Linux partition would be designed to be mounted at a directory so would have all of these settings that a directory has and that you would change them by applying them to the directory that it's mounted at.

Last edited by chadwick; 08-04-2011 at 10:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is it possible to automount usb disks with acl enabled? nokangaroo Ubuntu 4 05-11-2011 09:43 PM
NFS automount using fstab priyarao Linux - Newbie 1 08-05-2008 10:13 AM
CentOS 5.2 Automount isos in fstab \other methods that work?automount iso Frankly3D Linux - General 6 07-13-2008 12:34 PM
automount vs fstab Walter Sobchek Linux - Networking 10 08-16-2004 09:23 AM
Automount - releases disks but drives stay mounted JohnKFT Slackware 8 04-19-2004 05:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration