fstab entry on ubuntu - mounting an NTFS drive

slag

Lifer
Dec 14, 2000
10,473
81
101
I loaded unbuntu on an intel NUC to run kodi on and its working great. I had to connect an external drive to the machine where all my movies are stored, and then edit the fstab entry to auto mount it on server reboot. That part works fine.

The part i'm having a problem fixing is the file permissions. The entire disk and all files are owned by root:root and I can't chown them to the kodi user. I read up on the fstab man page and thought I had it figured out, but after spending a couple hours last night, am very frustrated with it. How can I set up an external drive that was formatted in windows and change the owner on everything and keep it that way on boot up?

My mount is /external/movies1, so my fstab entry looks something like
UUID=XXXXXXXXXXXX ntfs defaults,user,rw 0 0

Obviously this is incorrect. I mean, I can now see the drive and read the movies but I'm unable to copy movies over with sftp as they are all owned by root and sudo chown -R kodi:kodi /external/movies1 doesn't do anything
 
Last edited:

slag

Lifer
Dec 14, 2000
10,473
81
101
Might be as simple as putting this in the options field.. hmm

rw,auto,user,fmask=0111,dmask=0000


*If you want write access to your file system, you should set the filesystem type to 'ntfs-3g' instead of 'ntfs'. You may need to install the package 'ntfs-3g' for this to work, so make sure it is installed before you use ntfs-3g.
 

Cr0nJ0b

Golden Member
Apr 13, 2004
1,141
29
91
Generally, I just put in something very generic.

Start with just the mount point and target with defaults

Find out the device name for the drive and partition you are mounting. You can do this with any number of tools if you don't know already. fdisk is my favorite. Say it's sdc1...


Fstab line:

/dev/sdc1 /movies1/ ext4 defaults 0 0

something like that.

then test with the mount command:

mount /dev/sdc1

should mount fine.

then go set the permissions on the drive to whatever you need. I generally set 777 because I'm not worried about intruders in my LAN.

At least if you start with this you can then lock things down from there.
 

slag

Lifer
Dec 14, 2000
10,473
81
101
I found out I can read and write to the drive fine, I just cant chown from root over to the kodi user.

any idea why?
 

LoveMachine

Senior member
May 8, 2012
491
3
81
Take a look at this. I'm not at my Linux box atm to post my entry, but I finally got fstab configured properly to allow chown using that page, trying to mount an NTFS external usb hard drive. I forget the specific entries I ended up making, though.
 
Thread starter Similar threads Forum Replies Date
ultimatebob Open Source 5

ASK THE COMMUNITY