You are not logged in.

#1 2011-11-15 09:40:32

killgriff
Member
Registered: 2011-07-24
Posts: 37

[SOLVED] HD Partition Permissions

Hello, I have a /data partition where I store my dropbox folder. The first issue with this was mounting manually, so I set it in fstab to automount the /data partition (/dev/sda3). Now it auto-mounts and connects to dropbox on login, but my user does not have write permissions on the dropbox folder, only root. I've tried sudo chmod 770 but it doesn't seem to work.

Here's my ls -l
drwxr-xr-x 9 root root     8192 Nov 11 06:05 Dropbox

Last edited by killgriff (2011-12-21 09:37:04)

Offline

#2 2011-11-15 11:18:55

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

What filesystem?  What's the line in fstab?

Offline

#3 2011-11-15 11:54:12

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

Filesystem is fat32, fstab line is:
/dev/sda3 /media/data auto rw,auto,user,sync 0 1

Offline

#4 2011-11-15 12:16:32

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

Offline

#5 2011-11-15 12:28:09

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

All I could do is change auto to vfat (which shouldn't really matter) and change the order of operations to user,rw,auto,sync (which again shouldn't matter).

Forgiive me, but I don't see how the fstab should be changed.

Offline

#6 2011-11-15 13:57:28

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

Add the umask option to create the default permissions.

Offline

#7 2011-11-15 23:15:20

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

Ok, I don't understand how, but it worked. Thanks!


My user now as rw access, but cannot mount/unmount even though it is stated in fstab. I get the error saying only root can unmount /dev/sda3 to /media/data.

Last edited by killgriff (2011-11-15 23:18:44)

Offline

#8 2011-11-15 23:41:46

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

Here you go, from man mount:

Only the user that mounted a filesystem can unmount it again.  If any user should be able to unmount, then use users instead of user in the fstab line.

Don't feel bad about not understanding file and directory permissions.  It took me a good while to get a half-way-there understanding.  I read and read again about permissions whenever I have a problem, because it just doesn't come easily to me.

Last edited by thisoldman (2011-11-15 23:52:26)

Offline

#9 2011-11-16 00:22:25

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

Alright, thanks again just adding the s to user worked.

The thing I didn't understand is the umask option. From what I read, umask deletes the permissions you set for it, so I don't see how setting umask=770 adds those permissions.

Offline

#10 2011-11-16 11:27:13

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

Glad it's working.

I can see why your umask works, but I wouldn't think you would want umask=770.  You may want to Google "umask examples".  'umask' doesn't exactly delete permissions, I think of it as subtracting from 777 for directory or from 666 for file permissions.

 ~/tmp $ umask
0022
~/tmp $ mkdir dir1
~/tmp $ touch file1
~/tmp $ umask 770
~/tmp $ mkdir dir2
~/tmp $ touch file2
~/tmp $ ls -ld {dir,file}*
drwxr-xr-x 2 casey users 1 Nov 16 05:36 dir1     # umask 0022
d------rwx 2 casey users 1 Nov 16 05:37 dir2     # umask 0770
-rw-r--r-- 1 casey users 0 Nov 16 05:37 file1    # umask 0022
-------rw- 1 casey users 0 Nov 16 05:38 file2    # umask 0770

You can see both octal and rwx forms of a file's permissions with the 'stat' command:

$ stat file1        # Permissions are returned on the 4th line.
  File: `file1'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 807h/2055d      Inode: 82082       Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   casey)   Gid: (  100/   users)
Access: 2011-11-16 05:37:11.361928321 -0500
Modify: 2011-11-16 05:37:11.361928321 -0500
Change: 2011-11-16 05:37:11.361928321 -0500

Or, to print just the wanted lines:

$ stat file1 | egrep 'File|Access: \('
  File: `file1'
Access: (0644/-rw-r--r--)  Uid: ( 1000/   casey)   Gid: (  100/   users)

Last edited by thisoldman (2011-11-16 12:20:44)

Offline

#11 2011-11-27 01:52:37

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

I thought I had this figured out, but my dropbox won't sync (permission denied error). What do I need to do?

Offline

#12 2011-11-27 08:31:58

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

Check the wiki, and if that doesn't give you a solution, start a new forum thread.

Offline

#13 2011-12-16 04:54:41

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

Ok, I still haven't figured everything out... I submitted a ticket to dropbox and found out that the partition should have been in Linux filesystems (ext3 was suggested) rather than fat32. I finally got around to reformatting the partition, but now my permissions are screwed up again. I now have dropbox syncing as root, but my user can't even see the partition.

[killian@archlinux ~]$ ls -l /dev/sda3
brw-rw---- 1 root disk 8, 3 Dec 15 21:36 /dev/sda3
[killian@archlinux ~]$ ls -l /media/data
ls: cannot open directory /media/data: Permission denied
[killian@archlinux ~]$ sudo ls -l /media/data
total 4
drwx------ 9 root root 4096 Dec 15 21:43 Dropbox
[killian@archlinux ~]$ sudo chmod 770 /media/data
[killian@archlinux ~]$ sudo ls -l /media/data
total 4
drwx------ 9 root root 4096 Dec 15 21:43 Dropbox

Last edited by killgriff (2011-12-16 04:56:28)

Offline

#14 2011-12-16 12:40:28

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] HD Partition Permissions

I think you may want to start a new thread for this problem: the directory permissions and dropbox daemon are a co-mingled problem.

People will need to know:

  • What steps you have followed in the wiki article on Dropbox.

  • How are you starting Dropbox?

  • How are you currently mounting the partition?  The exact line of code from 'fstab' and the output of the 'mount' command will help.  From what you have given we don't know for sure that /media/data is the mountpoint for /dev/sda3.

Offline

#15 2011-12-21 09:50:31

killgriff
Member
Registered: 2011-07-24
Posts: 37

Re: [SOLVED] HD Partition Permissions

I finally figured everything out. Of course, it was a simple mistake but I'll post my findings in case someone else has the same problem and overlooked it as I did.

To use a partition (would work for external drive as well) for dropbox, it must be formatted as a Linux file system (I used ext3). /etc/fstab must be edited to add

/dev/sda3 /media/data auto defaults,users,rw 0 1

or something similar...

After syncing with dropbox, unmount the partition (this was my mistake- as changing permissions while mounted will not work even as root), chmod the mount-to location (/media/data), then remount and chmod the dropbox folder. I then used nautilus as root to set permissions on the dropbox folder to "apply permissions to enclosed folders."

I am now happily syncing and have full permissions in dropbox just as if it was in my home folder. Thanks again @thisoldman for all your help!

Last edited by killgriff (2011-12-21 09:51:46)

Offline

Board footer

Powered by FluxBB