LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-11-2010, 01:10 PM   #1
gskidmor
LQ Newbie
 
Registered: Jul 2006
Location: Cleveland OH
Distribution: Ubuntu, CentOS
Posts: 12

Rep: Reputation: 0
/bin/mount mounts point as a different user?!


I have a directory, /root/backup, that I mount and run a bunch of rysnc scripts against to backup my box. I'm running into a very recent problem where when I run this command:

/bin/mount -o username=user,password=password //192.168.0.6/centos_server /root/backup

a directory that once looked like this:

drwx------ 2 root root 4096 Dec 11 10:03 backup

goes to this:

drwxrwxrwx 9 www www 0 Dec 11 10:38 backup

It changes from root to www (another user on my system) and I have no idea why. When I look at the /mount/procs file, I see this:

//192.168.0.6/centos_server /root/backup cifs rw,mand,unc=\\192.168.0.6\centos_server,username=user,uid=0,noforceuid,gid=0,noforcegid,addr=192.168 .0.6,posixpaths,acl,rsize=16384,wsize=57344 0 0

so it looks like the uid is correct...

I believe this is what is causing my rsync scripts to fail (they only copy over directories and not the files in those directorys and I get a lot of permissions failed errors)

All of this is run as root in cron jobs

as a note, here is a sample rsync command:

/usr/bin/rsync -xahP --delete --exclude=backup/ --exclude=*.class --link-dest=/root/backup/root /root/ /root/backup/root


Any help would be greatly appreciated
 
Old 12-11-2010, 01:22 PM   #2
gskidmor
LQ Newbie
 
Registered: Jul 2006
Location: Cleveland OH
Distribution: Ubuntu, CentOS
Posts: 12

Original Poster
Rep: Reputation: 0
sorry to reply to my own post - I have figured out the rsync issue - for some reason, centos didn't like the -xahP (works on my ubuntu laptop) but changing it to -xr copies the files (before the 'r', it still copied the entire directory structure recursively, just not the files).

So the mount showing up as a different user doesnt seem to affect this, but I am still curious why it changes owners when mounted...
 
Old 12-11-2010, 02:35 PM   #3
sys64738
Member
 
Registered: May 2008
Location: NRW/Germany
Posts: 105

Rep: Reputation: 30
Hi
I think you could try the option uid=0 like:
Code:
/bin/mount -o username=user,password=password,uid=0 //192.168.0.6/centos_server /root/backup
but be aware do you really want to do that as root?
Maybe you better setup a "backup" user with less power.
 
1 members found this post helpful.
Old 12-11-2010, 03:16 PM   #4
gskidmor
LQ Newbie
 
Registered: Jul 2006
Location: Cleveland OH
Distribution: Ubuntu, CentOS
Posts: 12

Original Poster
Rep: Reputation: 0
I had thought about setting up one with less power, but then I ran into the issue that that user still needed a lot of power so that I can back up all of the users, root (I have some scripts I want preserved), and parts of some directories like rc, etc, httpd, etcetera...

But as the /mount/procs showed, it has the correct uid (0) but the mount ownership per the ls command is showing up as a different user, which had me concerned.
 
Old 12-12-2010, 09:45 AM   #5
sys64738
Member
 
Registered: May 2008
Location: NRW/Germany
Posts: 105

Rep: Reputation: 30
IMHO
Quote:
//192.168.0.6/centos_server /root/backup cifs rw,mand,unc=\\192.168.0.6\centos_server,username=user,uid=0,noforceuid,gid=0,noforcegid,addr=192.168 .0.6,posixpaths,acl,rsize=16384,wsize=57344 0 0
is the problem.
I think your system is choosing a different uid. I don't know why "www" is used as you posted before.
You should give "uid=0,gid=0,forceuid,forcegid".

Last edited by sys64738; 12-12-2010 at 09:49 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 11:03 AM
Creating a new user in a mount point other than / rajesh_bu2001 Linux - Newbie 7 10-20-2010 09:54 AM
How to mount a Windows shared directory and have mount point be owned by nonroot user Arodef Linux - Software 3 09-14-2009 01:23 AM
user cant mount after chmod 777 /bin/mount misterwiddle Linux - General 2 04-06-2005 06:36 PM


All times are GMT -5. The time now is 10:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration