11

How do I change the ownership of folders on a secondary hard drive using chown to make the folder owner be administrator?

When I use:

chown -R username foldername

I get an error Read Only filesystem

Does anyone have ideas?

Greg
  • 167
  • 4
Gatura
  • 573
  • 3
  • 10
  • 24

1 Answers1

12

The command syntax is:

chown [options] username:groupname filename

if you just want to change the user for a given folder you can leave out the :groupname and also add in a -R to make the command go recursively through all the files in the folder like so:

chown -R username foldername

Unless your main account is called "Administrator" this is probably not the username you want to use on OSX. Do you want to give yourself permissions or root?

In response to "Error: Read Only filesystem":

If the file system is NTFS, Mac OS X does not natively support modifying NTFS file systems but there is third party software available. See:

How-to: Read and Write NTFS Windows Partition on Mac OS X

It's buggy though so I would be careful.

Greg
  • 167
  • 4
einstiien
  • 2,568
  • 18
  • 18
  • When i do this, I get a an error 'Read only filesystem' any ideas – Gatura Jan 27 '10 at 08:28
  • How is the external hard drive connected? Is the hard drive formatted NTFS? If so then you will have problems making changes. Mac OS X does not natively support modifying NTFS file systems but there is third party software available: http://www.lifehack.org/articles/lifehack/how-to-read-and-write-ntfs-windows-partition-on-mac-os-x.html Its buggy though so I would be careful. – einstiien Jan 27 '10 at 08:40
  • in macOS "`sudo chown username folder1/folder2`" or "`sudo chown username folder2`" command works fine to change ownership of "folder2", & folder2's group remains same as earlier. – atErik Jan 18 '23 at 14:14
  • In macOS / OSX, be-careful : when any non-system / general sub-folder's user & group ownership changed with "chown usr2:grp2 D1/D2", then it works on D2 sub-folder, but parent folder D1's user ownership changed into "usr2", & earlier group ownership of parent-D1 remains intact . If "chown usr2:wheel D1/D2" used, then parent D1's group ownership changes into "wheel" (if D1 is non-system folder). – atErik Jan 18 '23 at 14:40