LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permissions problem with mount (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-problem-with-mount-806188/)

Bozrdang 05-05-2010 06:54 PM

Permissions problem with mount
 
I am pretty mush a newb with Linux and I'm stuck on something. I have two computers. One runs unRaid NAS software which is built on Linux. The other is running XBMC media center which is built on Ubuntu. XBMC has a local folder (/home/kevin/.xbmc/userdata/Thumbnails/) that it stores thumbnails in. I am essentially trying to move this folder to my server, but XBMC needs to see it as local. I started by deleting the old Thumbnails folder and it's contents. I then created an empty Thumbnails folder on XBMC and I also created one on my unRaid comp (192.168.1.20/disk7/xbmc_thumbs/Thumbnails). On the XBMC comp I run:

Code:

chmod 777 Thumbnails
mount -t cifs //192.168.1.20/disk7/xbmc_thumbs/Thumbnails  Thumbnails

It creates the mount and as long as I'm logged in as root, I can copy files to the XBMC Thumbnails folder and they appear on my unRaid server's Thumbnails folder. The problem is that if I log in as kevin (the user that XBMC runs as) I get permission denied errors. I've tried changing ownership of the XBMC Thumbnails folder to kevin via :

Code:

chown -v kevin Thumbnails
and it says it changed it, but if I check, the ownership and group both still show as root. I'm thinking that may be because now that the mount is made, it's showing the ownership of the Thumbnails folder on the unRaid server? Whatever it's doing I can't seem to change it and XBMC can't write it's thumbnails because of this.

Can anyone show me the light here. I'm dying to get this up and running.

kbp 05-05-2010 07:13 PM

By not providing credentials when you mount the remote drive, you're probably getting authenticated as 'guest' which may not have write access. The mount should look more like:

Code:

mount -t cifs -o user=xxx,password=yyy //192.168.1.20/disk7/xbmc_thumbs/Thumbnails  Thumbnails
or

Code:

mount -t cifs -o credentials=/path/to/credentials //192.168.1.20/disk7/xbmc_thumbs/Thumbnails  Thumbnails
cheers

Bozrdang 05-05-2010 08:05 PM

OK. Whose username and password should that be? An XBMC username/password or an unRaid username/password?

Due to the unRaid being a NAS, all it's shares and stuff were setup "out of the box". I didn't have to set any of that up. The unRaid shares that are available across my network never require any usernames or passwords whenever I copy stuff to them from my Windows machines. The only username/password I'm aware of for it is root which I use once in a blue moon to log into the console.

Bozrdang 05-05-2010 08:10 PM

I've just tried all the users I know of on both machines and every time I try to manually copy a file to that directory while logged in as kevin, I get permission denied.

kbp 05-05-2010 08:58 PM

Ok ... can you try mounting it when logged in as kevin ?

Bozrdang 05-05-2010 08:59 PM

That's how I have been mounting it, but I have to use sudo to do it.

kbp 05-05-2010 09:01 PM

Can you post the output of 'cat /proc/mounts' ?

Bozrdang 05-05-2010 09:04 PM

Code:

kevin@XBMCLive:~$ cat /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev tmpfs rw,relatime,mode=755 0 0
/dev/disk/by-uuid/5abc3f4e-ef7f-465e-b77d-fd44043af391 / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0
none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0
none /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
192.168.1.20:/mnt/user/xbmc /mnt/xbmc nfs rw,relatime,vers=3,rsize=262144,wsize=                                    262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.20,mountvers=3,mountproto=tcp,addr=192.168.1.20 0 0
//192.168.1.20/disk7/xbmc_thumbs/Thumbnails /home/kevin/.xbmc/userdata/Thumbnails cifs rw,mand,relatime,unc=\\192.168.1.20\disk7,username=root,uid=0,noforceuid,                                        gid=0,noforcegid,addr=192.168.1.20,file_mode=0755,dir_mode=0755,prepath=\xbmc_thumbs\Thumbnails,serverino,rsize=16384,wsize=57344 0 0


Bozrdang 05-05-2010 09:18 PM

In looking at that, I think there are some remnants of different attempts to get this working. I know the line where it says '192.168.1.20:/mnt/user/xbmc /mnt/xbmc' was a line someone had me add to fstab to try to do this whole thing a different way. I must have forgot to remove it. Here is the line they had me add to fstab:

Code:

192.168.1.20:/mnt/user/xbmc /mnt/xbmc nfs rw,hard,intr 0 0

kbp 05-05-2010 09:20 PM

Try adding file_mode=0777 and dir_mode=0777 to your mount options

<edit> .. that's your CIFS mount options, not NFS </edit>

Bozrdang 05-05-2010 09:26 PM

Not to be stupid, but how do I do that? Just add them to the end of the mount -t cifs command?

kbp 05-05-2010 09:33 PM

Something like:

Code:

mount -t cifs -o file_mode=777,dir_mode=777 //192.168.1.20/disk7/xbmc_thumbs/Thumbnails  Thumbnails

Bozrdang 05-05-2010 09:35 PM

Not sure if this means anything:

Code:

kevin@XBMCLive:~/.xbmc/userdata$ sudo mount -t cifs -o file_mode=777,dir_mode=777 //192.168.1.20/disk7/xbmc_thumbs/Thumbnails  Thumbnails
WARNING: 'file_mode' not expressed in octal.
WARNING: 'dir_mode' not expressed in octal.
Password:
kevin@XBMCLive:~/.xbmc/userdata$


Bozrdang 05-05-2010 09:36 PM

Here's the resulting permissions:

Code:

kevin@XBMCLive:~/.xbmc/userdata$ ls -l
total 160
-rw-r--r-- 1 root  root    296 2010-04-25 12:28 advancedsettings.xml
drwxr-xr-x 7 kevin kevin  4096 2010-04-25 18:19 bakThumbnails
drwxr-xr-x 3 kevin kevin  4096 2010-05-03 20:16 Database
-rw-r--r-- 1 kevin kevin 114527 2010-05-04 22:07 guisettings.xml
drwxr-xr-x 2 kevin kevin  4096 2010-01-23 22:43 keymaps
-rw-r--r-- 1 kevin kevin    83 2010-05-01 21:03 LastfmScrobbler.xml
-rw-r--r-- 1 kevin kevin  1573 2010-01-23 22:43 LCD.xml
-rw-r--r-- 1 kevin kevin    83 2010-05-01 21:03 LibrefmScrobbler.xml
drwxr-xr-x 5 kevin kevin  4096 2010-01-23 22:43 playlists
-rw-r--r-- 1 kevin kevin    309 2010-05-04 22:07 profiles.xml
-rw-r--r-- 1 kevin kevin    391 2010-01-23 22:43 RssFeeds.xml
-rw-r--r-- 1 root  root    1339 2010-01-23 22:56 sources.xml
dr----x--t 1 root  root      0 2010-05-05 21:41 Thumbnails
drwxr-xr-x 2 kevin kevin  4096 2010-03-10 14:20 visualisations


Bozrdang 05-05-2010 09:40 PM

Now it won't even let me go into the Thumbnails directory let alone write something.

kbp 05-05-2010 09:49 PM

Sorry... for octal you'll need to add leading '0's - file_mode=0777

Bozrdang 05-05-2010 10:02 PM

YES!! That seems to be working now. Thanks so much!


All times are GMT -5. The time now is 07:10 PM.