Tuxera. Com Community Ntfs- 3g- Faq Unprivileged

View unanswered posts View active topics It is currently Sun Apr 12, 2020 02:23

Can't mount immutable image

Moderators: d242, szaka



Page 1 of 1
[ 1 post ]
Previous topic Next topic
AuthorMessage

Joined: Wed Jun 16, 2010 20:21
Posts: 3
Can't mount immutable image
I ddrescue'd an HDD and marked the image immutable by `chattr +i`. Now I tried to mount it with ntfs-3g, and it complains that permission is denied. Here's how to reproduce this:
fallocate -l 512M test.img
mkfs.ntfs -F test.img
mkdir testdir
sudo ntfs-3g test.img testdir # this works OK
sudo umount testdir
sudo chattr +i -V test.img
sudo ntfs-3g test.img testdir # this fails
The last command of the above code code says:
Error opening '/home/ruslan/tmp/test.img': Permission denied
Failed to mount '/home/ruslan/tmp/test.img': Permission denied
Please check '/home/ruslan/tmp/test.img' and the ntfs-3g binary permissions,
and the mounting user ID. More explanation is provided at
http://tuxera.com/community/ntfs-3g-faq/#unprivileged

At the same time, using kernel 'ntfs' driver works without any problems both with and without the immutable flag on the image, automatically mounting in read-only mode.
Setting `-o ro` explicitly works around this, but it would be much more user-friendly to fallback to this mode automatically — as most (all?) of kernel filesystems do (at least vfat, ntfs, iso9660 do so).


Sun May 21, 2017 12:48
Page 1 of 1
[ 1 post ]


Who is online

Users browsing this forum: Google [Bot] and 8 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

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.

Tuxera Ntfs 2019

Tuxera ntfs mac
View unanswered posts View active topics It is currently Sun Apr 12, 2020 02:23

Can't mount ntfs partitions, 'Permission denied'

Moderators: d242, szaka



Page 1 of 1
[ 22 posts ]
Previous topic Next topic
AuthorMessage

Joined: Sun Nov 09, 2008 20:52
Posts: 14
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:
# /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:
chown root $(which ntfs-3g)
chmod 4755 $(which ntfs-3g)
and it didn't make a difference.
I also tried
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

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
What are the full outputs of the below commands?
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
Here:
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
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

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
/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
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

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


Sun Nov 09, 2008 22:01
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
anyone?


Sun Nov 09, 2008 23:10
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

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Hi,
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),
or do I want to add myself to the 'root' group?

No, you should add yourself to the group 'disk' which owns the partition.
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
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
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
Ok I tried:
# 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

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
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
chmod 775 /media/XP /media/Acer

Regards
Jean-Pierre


Wed Nov 12, 2008 23:26

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Oops,
You might need changing the group of the mount points, or give access to anybody by
chmod 777 /media/XP /media/Acer

Regards
Jean-Pierre


Wed Nov 12, 2008 23:33
Oops,
You might need changing the group of the mount points, or give access to anybody by
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
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

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
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
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
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

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
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
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
Page 1 of 1
[ 22 posts ]


Who is online

Users browsing this forum: No registered users and 5 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

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.
  • What exactly did I modify when I followed your FAQ instructions and did 'chmod 4750 $(where ntfs-3g)'? I am assuming it modded every file with ntfs-3g in the name to 4750. If this is the case, what was the default value in case I ever need to revert to it? Oh, and since I did that modification, will ntfs-3g still honor the 'noexec' parameter in.
  • Jun 21, 2013  我们都知道,linux本身是不支持nfts硬盘挂载的,不过在工具ntfs-3g的支持下,可以实现这个功能。1. 安装ntfs-3g第一种方式:yum install ntfs-3g如果安装失败,则采用. 博文 来自: 锦小年的博客.

Http://tuxera.com/community/ntfs-3g-faq/#unprivileged

Dec 28, 2015  # chmod 4755 /usr/local/bin/ntfs-3g # exit $ ntfs-3g /dev/da4s1 /mnt/usb Mount is denied because setuid and setgid root ntfs-3g is insecure with the external FUSE library. Either remove the setuid/setgid bit from the binary or rebuild NTFS-3G with integrated FUSE support and make it setuid root. Below is an example how this can be done for users in the ntfsuser group to be able to mount any NTFS volume if they have also the needed volume access rights. Chown root.ntfsuser $(which ntfs-3g) chmod 4750 $(which ntfs-3g) The setuid-root ntfs-3g driver applies the principle of least privilege during its lifetime as a safety measure. Blog about Debian and other GNU/Linux distributions, configurations, scripsts, desktop environments and similar things. If the NTFS-3G driver uses close to 100% CPU time then it’s usually a driver issue, though not always. Please see the details and explanation here. If the NTFS-3G driver doesn’t use close to 100% CPU time then the problem is typically not directly related to and not caused by the NTFS-3G driver. The most likely explanations are.