LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 05-04-2011, 12:20 PM   #1
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Rep: Reputation: 5
Trouble with permissions


Hello,

I'm starting to get a little frustrated with this

I have a usb stick that I use on all of my computers and I'm having some permission trouble.

I can only write to the usb with root. I tried chmod 777 but its not changing the permissions.

The other problem is that all of my files are owned by my normal login so root cant copy them over
Quote:
mv: failed to preserve ownership for `/devices/usb/The.Mentalist.S01E08.avi': Operation not permitted
and my normal login cant copy them over
Quote:
mv: cannot create regular file `/devices/usb/The.Mentalist.S01E07.avi': Permission denied
I cannot reformat the memory because its also an mp3 player and I have some very old songs on it that I don't have on my drives anymore. If I format I lose everything. Also, I have too many files to change the permission for each one.

What can I do?

Any ideas?
 
Old 05-04-2011, 12:47 PM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 115Reputation: 115
You're confused. You have two separate issues.

1. Only root can write to the USB stick.
2. When writing to the stick by 'mv'ing a file to it, you get the message: "mv: failed to preserve ownership for `/devices/usb/The.Mentalist.S01E08.avi': Operation not permitted".


Issue 2 is not an error, it's a warning. It's telling you that because the filesystem on the USB stick is FAT it is unable to keep the information about who is the owner of the file, but it doesn't mean it hasn't successfully written the file.

Issue 1 is an issue with the configuration of your system. Probably that udev or hal or however else you're mounting the stick isn't mounting it with permissions that let anyone else but root write to it. In order to resolve this you need to tell us what distribution and version you are using and whether, for example, you are mounting the stick manually or whether it's being automatically mounted by your system.
 
Old 05-04-2011, 07:55 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,482
Blog Entries: 16

Rep: Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206Reputation: 3206
What procedure are you using the mount the USB stick?

I ask because, if you are mounting it as root, user will not able able to add files to it because root will be the owner.
 
Old 05-04-2011, 10:54 PM   #4
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by zordrak View Post
You're confused. You have two separate issues.

1. Only root can write to the USB stick.
2. When writing to the stick by 'mv'ing a file to it, you get the message: "mv: failed to preserve ownership for `/devices/usb/The.Mentalist.S01E08.avi': Operation not permitted".


Issue 2 is not an error, it's a warning. It's telling you that because the filesystem on the USB stick is FAT it is unable to keep the information about who is the owner of the file, but it doesn't mean it hasn't successfully written the file.

Issue 1 is an issue with the configuration of your system. Probably that udev or hal or however else you're mounting the stick isn't mounting it with permissions that let anyone else but root write to it. In order to resolve this you need to tell us what distribution and version you are using and whether, for example, you are mounting the stick manually or whether it's being automatically mounted by your system.
Thank you for your reply. Honestly I am confused on this.

I'm using Gentoo. Kernel version linux-2.6.37-gentoo-r4.

I am manually mounting the usb stick as root(How else can I mount it?):
Code:
mount /dev/sdh1 /devices/usb
I'm going to look into udev and hal now to see what that's about.

The reason I thought it wasn't working as root is because after copying or moving the file it doesn't work on another computer. I know the file works because when its done with my Windows pc it works.
 
Old 05-05-2011, 03:46 AM   #5
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
I re-installed udev.

Also, I set a kde applet to automount all removable media.

Now my problem is that when I insert my usb my system freezes.

?
 
Old 05-05-2011, 05:27 AM   #6
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
I'm going to start another thread about my problem because I think its bigger than I initially thought.

It seems that my usbs are not being initialized when I insert them. Its like the system doesn't know they are there.

I may be missing a configuration step.
 
Old 05-05-2011, 05:33 AM   #7
spazticclown
Member
 
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
You can also try mounting the USB drive using the command:
Code:
mount /dev/sdh1 /devices/usb -o uid=nnn
Where "nnn" is your uid (found with 'echo $UID' in console).

This should grant you permission to use the USB drive from that user.

Hope this helps in the short run.
 
Old 05-05-2011, 05:57 AM   #8
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Your problem is not related to udev or hal. Using the mountcommand as spazticclown suggests in post #7 will solve you copying problem for the normal user.

Another problem is that the FAT-filesystem on an USB-device doesn't support permissions. So any permissions of your files are lost in the moment when the files are on the USB-device. If you use the USB-storage only with Linux-systems, I'd recommend to format it with ext2.

Note that it may be a good idea (enough space provided) to partition the USB-device and create a small partition for Linux formatted with ext2. So you can preserver the permissions if it is necessary (maybe for Linux-configurationfiles which you'll never need with Windows).

Markus
 
Old 05-05-2011, 05:58 AM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by Adol View Post
...
It seems that my usbs are not being initialized when I insert them. Its like the system doesn't know they are there.

I may be missing a configuration step.
Probably you're running a self-built kernel and are missing the modules which support the USB-devices.

Markus
 
Old 05-05-2011, 09:11 AM   #10
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
Thank you very much markush and spazticclown.

I can now use your command to mount the usb drive for my user account.

Now I just need to get it to automount but that is a different issue.

Thank you
 
Old 05-05-2011, 09:19 AM   #11
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by Adol View Post
...
Now I just need to get it to automount but that is a different issue.
...
put a line in /etc/fstab. You may find a solution in this thread: http://www.linuxquestions.org/questi...-flash-449377/

Markus
 
  


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
Trouble assigning permissions staph Linux - Newbie 8 02-05-2007 07:00 PM
trouble changing permissions 0perat0r Linux - Newbie 20 07-29-2005 05:32 AM
Having trouble with write permissions fleuh Linux - General 2 05-18-2004 12:35 PM
Trouble with file permissions daekpon Linux - General 8 03-15-2004 10:57 AM
Permissions trouble in Apache neubeigh Linux - Newbie 2 11-25-2003 10:43 PM

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

All times are GMT -5. The time now is 10:28 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