You are not logged in.

#1 2012-05-30 19:47:21

muzzel
Member
Registered: 2012-05-30
Posts: 9

[Solved] Non-root user cannot access mounted ntfs filesystem

Hi -,
i have a dualboot system (arch/xfce + win7) and i use a ntfs partition /dev/sda2 to store files i use with both operating systems. I added the partition to fstab and it gets mounted, but i cannot access it with my non-root user. With root it works fine...
My fstab:

# cat /etc/fstab 
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
LABEL=home /home ext4 defaults 0 1
LABEL=root / ext4 defaults 0 1
LABEL=swap swap swap defaults 0 0
/dev/sda2 /media/sda2 ntfs defaults 0 2

Is there any option that allows all users to use the mounted device? Or how is this usually done ...

Last edited by muzzel (2012-05-30 20:39:58)

Offline

#2 2012-05-30 19:53:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Non-root user cannot access mounted ntfs filesystem

muzzel wrote:

Or how is this usually done ...

Welcome to the boards. It is usually done by consulting the Fine Wiki: https://wiki.archlinux.org/index.php/Ntfs


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2012-05-30 19:55:26

headkase
Member
Registered: 2011-12-06
Posts: 1,983

Re: [Solved] Non-root user cannot access mounted ntfs filesystem

See: NTFS-3G for important setup information.

My fstab line looks like:

/dev/sdb1 /media/Win_USB ntfs-3g uid=1000,gid=users,fmask=113,dmask=0022 0 0

This sets up some important parameters which the NTFS-3G Wiki Page covers.  Basically, "ntfs" is only a basic driver and is built into the kernel.  "ntfs-3g" is a much better, and less disk-eating, driver that you should install and use if you need the drive in Linux any more than occasionally.  My fstab line makes my user (1000) the owner and the masks lets me write and etc to it.  When you install NTFS-3G it is automatically used when you use the mount command to mount NTFS drives.  In fstab, as above, you would specify it explicitly.

You can find your own user number by entering "id" at a terminal.

Offline

#4 2012-05-30 20:01:36

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,412
Website

Re: [Solved] Non-root user cannot access mounted ntfs filesystem

NTFS doesn't support permissions, so these are fake-set at mount time. You can specify desired permissions with the uid=, gid=, and umask= fstab options.

uid = user ID
gid = group ID
umask = octal umask for all the files (e.g. 002 = permissions of rwxrwxr-x)

Also, the ntfs driver will only allow you to read from the mounted partition. Use ntfs-3g instead.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2012-05-30 20:39:37

muzzel
Member
Registered: 2012-05-30
Posts: 9

Re: [Solved] Non-root user cannot access mounted ntfs filesystem

Thanks headkase, that really helped, works perfectly now. I thought its a problem with mounting in general, didnt think about ntfs tongue
Also thx @ others.

Offline

#6 2012-05-30 20:40:53

headkase
Member
Registered: 2011-12-06
Posts: 1,983

Re: [Solved] Non-root user cannot access mounted ntfs filesystem

Right on, you're welcome. smile

Offline

Board footer

Powered by FluxBB