LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-31-2011, 05:20 PM   #1
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Rep: Reputation: 24
chown won't


I've been using linux as my OS for a year now. But today I am no closer to understanding file permissions and ownership than I was 18 months ago when I downloaded my first linux flavor to try it out. The reason: chown; sometimes it works, and sometimes it doesn't. Here's the latest example where it doesn't. Chown declares that it has changed the ownership of every single file and folder, immediately after ls declares that it hasn't. And ls isn't kidding, because vim still refuses to write a file to one of these folders. Yet mplayer/mencoder don't care about permissions and ownership, they'll write files into these folders without a murmur.

Why? Why has chown failed in this case, yet other times, under identical circumstances, it works?
Code:
root@a:~# chown -vR g:users /media/500gb/Films
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VIDEO_TS.BUP' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VIDEO_TS.IFO' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VIDEO_TS.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_0.BUP' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_0.IFO' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_0.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_1.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_2.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_3.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_4.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS/VTS_01_5.VOB' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)/VIDEO_TS' to g:users
changed ownership of `/media/500gb/Films/A Man Escaped (1956) (French with English Subtitles)' to g:users
changed ownership of `/media/500gb/Films/Blood Simple  (1984)/BLOOD_SIMPLE.iso' to g:users

...

changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_07_4.VOB' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_07_5.VOB' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_07_6.VOB' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_07_7.VOB' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_08_0.BUP' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_08_0.IFO' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_08_0.VOB' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS/VTS_08_1.VOB' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow/VIDEO_TS' to g:users
changed ownership of `/media/500gb/Films/TheRockyHorrorPictureShow' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VIDEO_TS.BUP' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VIDEO_TS.IFO' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VIDEO_TS.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_0.BUP' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_0.IFO' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_0.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_1.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_2.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_3.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_4.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_5.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS/VTS_01_6.VOB' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)/VIDEO_TS' to g:users
changed ownership of `/media/500gb/Films/Watership Down (1978)' to g:users
changed ownership of `/media/500gb/Films/Who_s Afraid of Virginia Woolf (1966)/Virginia Woolf.iso' to g:users
changed ownership of `/media/500gb/Films/Who_s Afraid of Virginia Woolf (1966)' to g:users
changed ownership of `/media/500gb/Films' to g:users
root@a:~# ls -l /media/500gb/Films
total 8280072
drwxrwxrwx 1 root root          0 Dec 29 16:54 A\ Man\ Escaped\ (1956)\ (French\ with\ English\ Subtitles)/
drwxrwxrwx 1 root root          0 Dec 24 06:49 Blood\ Simple\ \ (1984)/
drwxrwxrwx 1 root root       4096 Dec 29 12:35 Butch\ Cassidy\ and\ the\ Sundance\ Kid\ (1969)/
drwxrwxrwx 1 root root      24576 Dec 28 16:43 Dorm2006/
-rwxrwxrwx 1 root root 7011001155 Nov  4  2009 Heathers\ 1989\ 720p\ BluRay\ DTS\ x264-EbP.mkv*
drwxrwxrwx 1 root root       4096 Dec 18 12:07 Performance/
drwxrwxrwx 1 root root          0 Dec 31 13:54 Pickpocket\ (1959)\ (French\ with\ English\ Subtitles)/
drwxrwxrwx 1 root root          0 Dec 31 04:45 Psycho\ (1960)/
drwxrwxrwx 1 root root          0 Dec 22 14:28 Sophie_s\ Choice\ (1982)/
drwxrwxrwx 1 root root          0 Dec 30 04:48 The\ Damned\ (La\ Caduta\ degli\ dei)\ (1969)/
drwxrwxrwx 1 root root       4096 Dec 18 11:52 The\ Harder\ They\ Come\ (1972)/
drwxrwxrwx 1 root root       4096 Dec 18 11:53 The\ Misfits\ (1961)/
drwxrwxrwx 1 root root          0 Dec 29 06:17 The\ Mist\ (2007)/
drwxrwxrwx 1 root root          0 Dec 26 09:04 The\ Reader\ (2008)/
drwxrwxrwx 1 root root       4096 Dec 18 11:54 The\ Tragedy\ of\ Macbeth\ (1971)\ DVD9/
-rwxrwxrwx 1 root root 1461784042 Dec 14 10:07 TheGodsMustBeCrazy1980.avi*
drwxrwxrwx 1 root root          0 Dec 13 13:56 TheRockyHorrorPictureShow/
drwxrwxrwx 1 root root          0 Dec 28 05:37 Watership\ Down\ (1978)/
drwxrwxrwx 1 root root          0 Dec 23 05:22 Who_s\ Afraid\ of\ Virginia\ Woolf\ (1966)/
-rwxrwxrwx 1 root root      83191 Dec 29 11:55 movie.idx*
-rwxrwxrwx 1 root root    5873664 Dec 29 11:55 movie.sub*
root@a:~#
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-31-2011, 05:39 PM   #2
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 334

Rep: Reputation: 60
What file system is /media/500gb? FAT32 does not support permissions or ownership.http://ubuntu.swerdna.org/ubufat32.html

Regards,
Stefan
 
2 members found this post helpful.
Old 12-31-2011, 05:44 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Code:
chown -vR g:users /media/500gb/Films
That means to change the ownership to a user named "g" and a group named "users". Do you actually have a user named "g"?
 
Old 12-31-2011, 06:42 PM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,141
Blog Entries: 6

Rep: Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828
http://linux.die.net/man/1/chown
http://linux.die.net/man/1/chgrp
http://linux.die.net/man/1/chmod
 
Old 12-31-2011, 06:50 PM   #5
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by propofol View Post
What file system is /media/500gb? FAT32 does not support permissions or ownership.http://ubuntu.swerdna.org/ubufat32.html

Regards,
Stefan
ntfs.
Code:
root@a:~# mount
/dev/root on / type ext4 (rw,relatime,barrier=1,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdb1 on /media/500gb type fuseblk (rw,noexec,nosuid,nodev,allow_other,blksize=4096)

root@a:~# cat /etc/fstab
/dev/sda5        swap             swap        defaults         0   0
/dev/sda1        /                ext4        defaults         1   1
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
/dev/sdb1        /media/500gb     ntfs-3g     rw,user,auto     0   0
#/dev/sdb1        /media/500gb     ntfs-3g     rw,user,auto     0   0

Last edited by porphyry5; 12-31-2011 at 07:35 PM.
 
Old 12-31-2011, 06:52 PM   #6
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by ntubski View Post
Code:
chown -vR g:users /media/500gb/Films
That means to change the ownership to a user named "g" and a group named "users". Do you actually have a user named "g"?
Yes, I am user "g", the only user on the system
 
Old 12-31-2011, 07:06 PM   #7
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by propofol View Post
What file system is /media/500gb? FAT32 does not support permissions or ownership.http://ubuntu.swerdna.org/ubufat32.html

Regards,
Stefan
This.
 
Old 12-31-2011, 07:13 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Why do you want to change ownership?
Have you changed permissions also?
If you can post the result of
Code:
ls -l
before and after running this command then it may help us to see what happened.
 
Old 12-31-2011, 07:17 PM   #9
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
I've read the man pages to these 3 instructions many times. If you check the output of ls -l that I included in my first post you'll see that I am not interested in chmod here, as the permissions are already set the way I need them. And I'm not interested in chgrp, as I need to change the owner as well as the group. My usage of chown is correct for what I want to do here, and you can see, from its partial output that I included in my first post, that it claims to have made the appropriate changes to every file and sub-folder. But manifestly, it did not.

I hate this damned chown with a passion. Every time I go to use it, its a crap shoot whether it works or not. And there is nothing anywhere that I can find from anyone else reporting similar behaviour. So it has to be something about the setup of my system, which is quite unremarkable, stock slackware 13.37 + about 6-7 other apps.
 
Old 12-31-2011, 07:23 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I apologise for not reading your post and, thus, asking you to repeat yourself.
Which filesystem are you using? I have no doubt I will not be able to help you but I am curious.
 
Old 12-31-2011, 08:04 PM   #11
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by snowpine View Post
This.
/dev/sdb1 /media/500gb ntfs-3g rw,user,auto 0 0
 
Old 12-31-2011, 08:05 PM   #12
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by 273 View Post
I apologise for not reading your post and, thus, asking you to repeat yourself.
Which filesystem are you using? I have no doubt I will not be able to help you but I am curious.
See above, twice.
 
Old 12-31-2011, 08:12 PM   #13
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by porphyry5 View Post
I hate this damned chown with a passion. Every time I go to use it, its a crap shoot whether it works or not. And there is nothing anywhere that I can find from anyone else reporting similar behaviour. So it has to be something about the setup of my system, which is quite unremarkable, stock slackware 13.37 + about 6-7 other apps.
chown works flawlessly with linux filesystems.
 
Old 12-31-2011, 08:21 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by porphyry5 View Post
See above, twice.
I am very slow tonight and apologies. It seems I made the same error you did -- assuming that you were using a file system which was compatible with the commands you were using.
snowpine has the answer.
 
Old 12-31-2011, 08:37 PM   #15
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by snowpine View Post
chown works flawlessly with linux filesystems.
In your experience, perhaps so. In mine, not so.
 
  


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
chown ! noony123 Linux - Newbie 2 03-01-2011 08:17 AM
chown bkcreddy17 Linux - Newbie 1 04-22-2008 08:59 AM
chown strycnine Slackware 5 12-07-2006 09:39 AM
chown loopoo Linux - Newbie 5 08-09-2005 09:38 AM
chown -R ujotne Programming 3 02-25-2004 12:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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