LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 12: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, 12: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, 01: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, 02: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, 08: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 08:49 AM.
 
1 members found this post helpful.
  


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 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 10:03 AM
Creating a new user in a mount point other than / rajesh_bu2001 Linux - Newbie 7 10-20-2010 08: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 12:23 AM
user cant mount after chmod 777 /bin/mount misterwiddle Linux - General 2 04-06-2005 05:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:15 PM.

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