LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   permission problems with mounted device (https://www.linuxquestions.org/questions/linux-software-2/permission-problems-with-mounted-device-609161/)

fakie_flip 12-26-2007 04:00 AM

permission problems with mounted device
 
Why is the ownership changing after mounting the filesystem? I never had this problem before.

Code:

chris@ubuntu:~$ sudo chown -c chris:root /media/sdc1/
chris@ubuntu:~$ ll /media/
total 40K
lrwxrwxrwx 1 root  root    6 2007-11-26 13:05 cdrom -> cdrom1
drwxr-xr-x 2 root  root 4.0K 2007-11-26 13:03 cdrom0
drwxr-xr-x 2 root  root 4.0K 2007-05-31 22:31 cdrom1
drwxr-xr-x 2 chris root 4.0K 2007-07-20 08:38 iso
drwxrwxrwx 1 root  root 8.0K 2007-12-25 10:51 sdb1
drwxrwxrwx 1 root  root  12K 2007-12-25 13:11 sdb2
drwxr-xr-x 5 chris root 4.0K 2007-12-24 03:23 sdb3
drwxr-xr-x 2 chris root 4.0K 2007-12-26 03:41 sdc1
chris@ubuntu:~$ sudo mount /dev/sdc1 /media/sdc1/
chris@ubuntu:~$ ll /media/
total 40K
lrwxrwxrwx 1 root  root    6 2007-11-26 13:05 cdrom -> cdrom1
drwxr-xr-x 2 root  root 4.0K 2007-11-26 13:03 cdrom0
drwxr-xr-x 2 root  root 4.0K 2007-05-31 22:31 cdrom1
drwxr-xr-x 2 chris root 4.0K 2007-07-20 08:38 iso
drwxrwxrwx 1 root  root 8.0K 2007-12-25 10:51 sdb1
drwxrwxrwx 1 root  root  12K 2007-12-25 13:11 sdb2
drwxr-xr-x 5 chris root 4.0K 2007-12-24 03:23 sdb3
drwxr-xr-x 4 root  root 4.0K 1969-12-31 18:00 sdc1
chris@ubuntu:~$


shadowsnipes 12-26-2007 08:50 AM

You can do whatever you want to that /media/sdc1 directory and when you mount something on top of it it will get clobbered, so of course the perms change.

Look into using udev to set your perms when the filesystem is mounted.

Here is a link to get you started...
http://reactivated.net/writing_udev_rules.html

KnightHawk 12-26-2007 07:52 PM

when you mount a drive in linux, it assumes the permissions of the one who mounted it. In your case its root.

Other permissions such as read and write, are also set by mounting options.


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