bonjurkes
Posts: 14
Joined: Sun Jul 29, 2012 10:44 pm

chown not effective on external usb

Fri Mar 11, 2016 2:20 am

I am auto mounting usb hard drive with ntfs-3g to rasp pi on boot via /etc/fstab. I am using "root" account instead of "pi".

The problem is TransmissionBT can't write to target folder because of permission error on download folder. Even though it's another problem, I tried to create a new folder or chown current download folder with username TransmissionBT runs. I can't change owner of the folder, I try chown root:root or debian-transmission:debian-transmission but there is no luck.

All folders are owned by pi:pi and I can't change them no matter what.

What can be the cause of this problem?

klricks
Posts: 6789
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: chown not effective on external usb

Fri Mar 11, 2016 2:54 am

chown etc does not work with NTFS or FAT formatted drives. The permissions have to be set in FSTAB instead.

The best solution however would be to format the drive with a Linux format EXT4. You will then be able to use chown and you won't be dogged by the extra CPU hog ntfs driver.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: chown not effective on external usb

Fri Mar 11, 2016 2:57 am

klricks wrote:The best solution however would be to format the drive with a Linux format EXT4.
Making the assumption that that USB drive does not need to be directly used on a Windows machine.

User avatar
thagrol
Posts: 2229
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: chown not effective on external usb

Fri Mar 11, 2016 9:36 pm

Add umask=000 to the mount options of the ntfs drive. It won't change the owner or group but will give full read/write/execute permission on everything to everyone.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

lenoryndweemjarkpree
Posts: 2
Joined: Sat Mar 12, 2016 11:11 am

Re: chown not effective on external usb

Sat Mar 12, 2016 12:05 pm

bonjurkes wrote:I am auto mounting usb hard drive with ntfs-3g to rasp pi on boot via /etc/fstab. I am using "root" account instead of "pi"
bonjurkes wrote:All folders are owned by pi:pi
This shows that the fstab entry is mounting the external drive partition as pi:pi,
contrary to your claim that you are using the "root" account
bonjurkes wrote:The problem is TransmissionBT can't write to target folder because of permission error on download folder
Because the entire external partition is owned by pi:pi, as above
bonjurkes wrote:I tried to create a new folder or chown current download folder with username TransmissionBT runs. I can't change owner of the folder, I try chown root:root or debian-transmission:debian-transmission but there is no luck
Windows partitions (FAT or NTFS) do not have any provision for Unix ownership or permissions
chown will not work
As already suggested by another person, the best solution is to use a Unix file system on your external drive

If you must use a Windows partition:
run Transmission as pi

or:
change the fstab entry so that the owner of the partition is the same as the user that runs Transmission
(look for mount options uid=xxx,gid=xxx in fstab examples in any Linux forum)

Do not mount the external partition as root
Do not run Transmission as root
Do not set promiscuous permissions on the external partition (Re: umask=000 suggestion elsewhere in this thread)

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: chown not effective on external usb

Sat Mar 12, 2016 1:17 pm

bonjurkes wrote:I am auto mounting usb hard drive with ntfs-3g to rasp pi on boot via /etc/fstab. I am using "root" account instead of "pi".
All folders are owned by pi:pi and I can't change them no matter what.
If you mount it with fstab it would default to root:root since it's an ntfs filesystem. In order for it to be pi:pi you'd have to specify "uid=pi" and "gid=pi" in the fstab line (or uid=1000 and gid=1000). If that's the case then remove those two entries.

But I don't quite understand the situation. It currently belongs to pi:pi and you can't access it, but changing it to root:root will allow you to access it? That doesn't seem to make sense.

Return to “Raspbian”