FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Sat Jan 16, 2021 05:04



Post new topic Reply to topic  [ 22 posts ] 
Can't mount ntfs partitions, 'Permission denied' 
Author Message

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post Can't mount ntfs partitions, 'Permission denied'
I just installed Debian and when I opened fstab, it didn't have sda1 or sda2 listed, so I edited my fstab to look like this:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sda1   /media/Acer   ntfs-3g   user,noauto   0   0
/dev/sda2   /media/XP   ntfs-3g   user,noauto   0   0      
/dev/sda3       /               ext3    errors=remount-ro 0       1
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

but when I tried to mount my XP partition, it said I needed to install ntfs support. So I opened up Synaptic and installed ntfs-3g. But now when I try to mount either partition, i get:
Cannot mount Volume.
Unable to mount the volume 'XP'.
Error opening '/dev/sda2': Permission denied
Failed to mount '/dev/sda2': Permission denied
Please check '/dev/sda2' and the ntfs-3g binary permissions, and the mounting user ID. More information is provided at http://ntfs-3g.org/support.html#unprivileged

I tried what it said:
Code:
chown root $(which ntfs-3g)
chmod 4755 $(which ntfs-3g)
and it didn't make a difference.

I also tried
Code:
chown root:users /dev/sda1
chmod 660 /dev/sda1

which I read on another thread here somewhere but it still made no difference.

I just want to be able to click the icon and mount it even if I'm not in root, how would I do this?


Sun Nov 09, 2008 21:01
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
What are the full outputs of the below commands?
Code:
ls -l /dev/sda2 /media/XP $(which ntfs-3g)
id
ntfs-3g --help
ntfs-3g  /dev/sda2  /media/XP


Sun Nov 09, 2008 21:16
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Here:
Code:
sam@debian:~$ ls -l /dev/sda2 /media/XP $(which ntfs-3g)
brw-rw---- 1 root disk  8, 2 2008-11-09 09:13 /dev/sda2
-rwsr-xr-x 1 root root 35652 2008-10-25 13:27 /usr/bin/ntfs-3g

/media/XP:
total 0
sam@debian:~$ id
uid=1000(sam) gid=1000(sam) groups=20(dialout),24(cdrom),25(floppy),29(audio),44(video),46(plugdev),111(netdev),115(powerdev),1000(sam)
sam@debian:~$ ntfs-3g --help

ntfs-3g 1.2531 integrated FUSE 27 - Third Generation NTFS Driver

Copyright (C) 2006-2008 Szabolcs Szakacsits
Copyright (C) 2005-2007 Yura Pakhuchiy

Usage:    ntfs-3g <device|image_file> <mount_point> [-o option[,...]]

Options:  ro (read-only mount), force, remove_hiberfile, locale=,
          uid=, gid=, umask=, fmask=, dmask=, streams_interface=.
          Please see the details in the manual.

Example:  ntfs-3g /dev/sda1 /mnt/win -o force

Ntfs-3g news, support and information:  http://ntfs-3g.org
sam@debian:~$ ntfs-3g /dev/sda2 /media/XP
Error opening '/dev/sda2': Permission denied
Failed to mount '/dev/sda2': Permission denied
Please check '/dev/sda2' and the ntfs-3g binary permissions,
and the mounting user ID. More explanation is provided at
http://ntfs-3g.org/support.html#unprivileged
sam@debian:~$


Sun Nov 09, 2008 21:20
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Edit: (is there an edit option?) just in case I didn't mention it, I get the same error for both ntfs partitions, sda1 and sda2.


Sun Nov 09, 2008 21:21
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
/dev/sda2 is not own by a group the user belongs. The kernel's 'Permission denied' error message is correct. The user has no read/write access right to the device.


Sun Nov 09, 2008 21:36
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
How can I fix this so I can add myself to that group?

(sorry, I'm a Linux noob)


Sun Nov 09, 2008 21:43
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
Try http://www.cyberciti.biz/faq/howto-linu ... -to-group/


Sun Nov 09, 2008 22:01
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Thanks for the link, but just to clarify:
In my fstab, 'users' is the group allowed to access the partitions, right?
and what I want to do is add myself to the 'users' group? or do I want to add myself to the 'root' group?

And say I log in as root, will I be able to mount the partitons, or will I have to add root to the 'users' group as well?


Sun Nov 09, 2008 22:16
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
anyone?


Sun Nov 09, 2008 23:10
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Ok I tried adding myself to the group 'users' and making a new group named 'user' and adding myself to that, I also tried adding myself to 'root' but I still get the same error.

I can mount the partitions through the terminal using sudo but when I click on an icon link to the partition, then I get the error message - how can I fix this?


Mon Nov 10, 2008 01:15
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post 
Hi,

Quote:
In my fstab, 'users' is the group allowed to access the partitions, right?
and what I want to do is add myself to the 'users' group?

No, the "users" option means a user is allowed to mount the partition (any user, provided other conditions are met),

Quote:
or do I want to add myself to the 'root' group?

No, you should add yourself to the group "disk" which owns the partition.

Quote:
I can mount the partitions through the terminal using sudo but when I click on an icon link to the partition, then I get the error message - how can I fix this?

Did you check your mountpoint (/media/XP) permissions ? What is the output of
Code:
ls -ld /media/XP

However /media/XP is probably recreated with unwanted permissions whenever you boot up. You may want to use a permanent mountpoint instead.

Note : I would suggest you mount as root using sudo, so you do not have to add yourself to the disk group.

Regards

Jean-Pierre


Mon Nov 10, 2008 10:38
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Code:
sam@debian:~$ ls -ld /media/XP
drwxr-xr-x 2 root root 4096 2008-11-09 07:39 /media/XP
sam@debian:~$ ls -ld /media/Acer
drwxr-xr-x 2 root root 4096 2008-11-09 07:36 /media/Acer

There's the output of the command for both of my mount points.

And what do you mean by permanent mount point? i created /media/Acer and XP myself, wouldn't they permissions stay the same?

I guess I'll use sudo, but are there any disadvantages to adding myself to the 'disk' group? Can't I add that group to the list of 'secondary' groups that I belong to?

Thanks.


Wed Nov 12, 2008 18:56
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Ok I tried:
Code:
# usermod -a -G disk sam
as root but it still didn't let me access the partitions through GUI; same error message.


Wed Nov 12, 2008 19:12
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post 
Hi,

If you want mounting as user, you should check ALL conditions described in
http://www.ntfs-3g.org/support.html#useroption

by putting yourself in group disk, you get an access right to /dev/sda2 (actually to any disk, which may be undesirable), but you still do not have write access to the mount points. Try
Code:
chmod 775 /media/XP /media/Acer


Regards

Jean-Pierre


Wed Nov 12, 2008 23:26
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post 
Oops,

You might need changing the group of the mount points, or give access to anybody by
Code:
chmod 777 /media/XP /media/Acer


Regards

Jean-Pierre


Wed Nov 12, 2008 23:33
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
jpa wrote:
Oops,

You might need changing the group of the mount points, or give access to anybody by
Code:
chmod 777 /media/XP /media/Acer


Regards

Jean-Pierre

Ok this fixed it, now I can finally access the partitions through GUI. Thank you so much.

But could you explain what the '777' did? If I understand correctly, 'chmod' changes the file mode. Also, if I removed myself from the 'disk' group, would I lose access to the partitions and get the same error message?


Thu Nov 13, 2008 01:06
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
I just tried editing the group file under /etc/group in nano and took myself out of the disk group and the GUI-way of mounting the partition still works.

So let's say I decided to reformat with the same configuration, all I would have to do for easy access to sda1 and sda2 is:
1. edit my fstab as I did
2. create /media/Acer and /media/XP mount points
3. chmod 777 /media/Acer /media/XP

Is that it?


Thu Nov 13, 2008 01:17
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
The GUI way of mounting works with many recent versions of distributions. If not then it's a distribution problem: http://ntfs-3g.org/support.html#plugandplay

Debian is indeed especially known to have many NTFS related configuration and setup problems. Thankfully recently somebody worked on them quite a lot, so the next Debian version should have better out-of-the box experiences for Debian users.

NTFS-3G development can not solve distribution specific setup and configuration problems. We develop the driver, not how it's integrated and used. That's a distribution issue you should communicate with your distribution.

Also, editing /etc/groups won't change the credentials of a logged in users.


Thu Nov 13, 2008 01:32
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Ya nevermind, I just restarted and figured out that I have to be apart of the disk group. But thanks for all the help anyway - everything is working as I want it to be.


Thu Nov 13, 2008 01:40
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
Sorry to keep bugging you guys, but ever since I added myself back to the 'disk' group after removing myself, my partitions automount at startup even though the fstab configuration file says 'noauto'.


Thu Nov 13, 2008 01:55
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post 
This is indeed again has nothing to do with the NTFS-3G driver itself but what software your distribution uses to launch the mount process, how it's used, how the OS startups, etc.

If Debian says to NTFS-3G to mount a volume then NTFS-3G mounts it (if you have the privilege to do so). If Debian says not to mount then it doesn't mount it. If you say to Debian not to mount and Debian still tells to NTFS-3G to mount then you have a problem with Debian.


Thu Nov 13, 2008 02:02
Profile

Joined: Sun Nov 09, 2008 20:52
Posts: 14
Post 
I understand that - I guess I'll just repeat the entire processes and hope it works out for me.

Again, thanks everyone for all the input.


Thu Nov 13, 2008 02:13
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.