LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-04-2013, 09:45 AM   #1
threevolve
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Rep: Reputation: Disabled
Permission denied as root to a root-owned directory


I'm trying to do a mysqldump to an external USB hard disk on Ubuntu 10.04 LTS Server

The directory on the disk has the following permissions:
drwxrwxr-x 2 root root 39 Jun 4 09:13 mysql/

Here is the command I am attempting to run (logged in as root):
mysqldump -u root -p********* database_name | gzip > /backup/mysql/database_name_`date '+%m-%d-%Y'`.sql.gz

And here is the output:
bash: /backup/mysql/database_name_06-04-2013.sql.gz: Permission denied
mysqldump: Got errno 32 on write

It also fails the same way if I take gzip out of the equation and just do:
mysqldump -u root -p********* database_name > /backup/mysql/database_name_`date '+%m-%d-%Y'`.sql

I can touch files, copy files into the directory, delete, rename, etc as root, but when I try to run this, I get permission denied. If I run the same command to a directory not on this external disk, it works fine. I don't understand what's going on here. Please help

Here's some more info:

fstab line: /dev/sdc1 /backup xfs rw 0 0
The drive is connected via USB. It's a 1TB Western Digital RE4, formatted as XFS.

Thanks guys, any ideas would be much appreciated!

Last edited by threevolve; 06-06-2013 at 07:36 AM.
 
Old 06-06-2013, 01:22 AM   #2
rigor
Member
 
Registered: Sep 2011
Posts: 282

Rep: Reputation: Disabled
The way you have worded things, I am not sure whether or not you have effectively already considered all FOUR sets of permissions that appear to be involved.

1) The permissions on the / directory.
2) The permissions on the /backup directory.
3) The permissions on the /backup/mysql directory.
4) Whether or not the specific file to which you are trying to write, might already exist, and if it does, what are that file's permissions?

HTH.
 
1 members found this post helpful.
Old 06-06-2013, 01:26 AM   #3
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
run below command and after this try your stuff.

chown -R root:root /backup


sunil
 
1 members found this post helpful.
Old 06-06-2013, 07:27 AM   #4
threevolve
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sunilpopaliya View Post
run below command and after this try your stuff.

chown -R root:root /backup


sunil
Even though all files and directories were already root:root, I tried this, and it resolved the problem. This was very strange.

Thank you both for your help, I greatly appreciate it!
 
  


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
[SOLVED] Permission denied to root trying to remove directory 7kaltoid Linux - Newbie 10 08-22-2011 01:51 AM
Installing as non-root in a root owned directory sunny8107 Linux - Newbie 2 03-08-2011 09:14 AM
Cannot write to /misc directory - permission denied as root etuhs Fedora 4 06-01-2007 07:20 AM
Permission denied existing directory root/user BDHamp Linux - General 5 04-10-2006 09:41 AM
root gets 'Permission denied' to directory mikemrh9 Linux - Security 2 11-18-2005 04:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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