LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-10-2010, 12:28 PM   #1
ianp5a
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Rep: Reputation: 0
NTFS Mount Permission problems


I am trying to set up fstab to automatically mount my NTFS partitions.
I have used various Mount managers to create the entries in fstab.
The fstab seems fine, but when mounting at boot or even via Nautilus I get the error message that I do not have permission to mount the disk.

1) Can this permission be set in the fstab file? If so what is the syntax of the fstab entry?
2) If not, is there a tool i.e. GUI to set the mount permissions?
 
Old 02-10-2010, 04:24 PM   #2
dadrunamok
Member
 
Registered: Dec 2009
Location: Maryland, USA
Distribution: Ubuntu 11.04, that alternative OS from Washington State
Posts: 33

Rep: Reputation: 16
What distro are you using? Also, what do the fstab entries say for the partition(s) in question? Those two items will help you to get your problem solved.
 
Old 02-10-2010, 04:54 PM   #3
orangesky
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 17
Are you using the ntfs-3g?

try using force to see if you can mount it once.
Code:
cd /mnt/
mkdir drive2

mount -t ntfs-3g /dev/sda2 /mnt/drive2 -o force
fstab would be

Code:
/dev/sda2     /mnt/drive2     ntfs-3g     defaults     0     0
 
Old 02-10-2010, 05:37 PM   #4
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Rep: Reputation: 90
What might do the most good in the long run is for you to study the fstab manual. I don't usually tell people to read a manual but in this case it's better than just copying what someone gives you. You'll have a better understanding then for future problems when they occur.
 
Old 02-11-2010, 07:31 AM   #5
ianp5a
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Oops. Distro Yes Karmic Ubuntu 9.1 (Gnome) and I don't think I'm using ntfs-3g?
And the fstab is looking similar to this:
Code:
/dev/sda2       /media/Windows 7     ntfs     defaults,user     0     0
However I am experimenting with various tools to write in the entries as I believed that the problems lay in the fstab entry. Which is why I asked if the permissions are set in fstab or somewhere else.

I have been able to mount the drives when there are 'no' entries in fstab. But with the entries mount is usually impossible and it has even prevented me booting into Ubuntu.

Quote:
What might do the most good in the long run is for you to study the fstab manual.
OK. Found one now with a google search.
Quote:
in this case it's better than just copying what someone gives you.
You'll have a better understanding then for future problems when they occur.
Yes, I understand your point. But for that very reason I want to find a proper program that will set it up properly. So that at a later date, if there is a problem, I can go back to the program instead of having to trawl through a manual just to find the right syntax. Memorising a syntax is not the same as real learning. And a good program should know what to do and do it correctly. So if anyone knows of a good program to do this it would be a great help.

Last edited by ianp5a; 02-12-2010 at 01:16 AM.
 
Old 02-11-2010, 07:57 AM   #6
dadrunamok
Member
 
Registered: Dec 2009
Location: Maryland, USA
Distribution: Ubuntu 11.04, that alternative OS from Washington State
Posts: 33

Rep: Reputation: 16
Orangesky has the correct answer, I believe. Try changing your fstab entry to use ntfs-3g instead of just ntfs.

I don't have any NTFS-formatted drives anymore, but I don't remember ever having any luck mounting them as just "ntfs".
 
Old 02-11-2010, 08:04 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Ubuntu does come with ntfs support by default. So you do not need to install it explicitly.
In addition, mount command needs root permissions for execution. And that could be the reason for the error.
 
Old 02-11-2010, 08:21 AM   #8
backtolinux
LQ Newbie
 
Registered: Nov 2009
Posts: 20
Blog Entries: 1

Rep: Reputation: 2
try to eliminate the blank between "Windows" and "7". recreate the mount point without blank : i.e. /media/Windows_7 and retry to mount it with this new location (create the mount point and modify the fstab file).

For your skill, ntfs-3g is the tool used by linux to acces in read/write mode the ntfs partition. ANd you have an ntfs partition that can be managed by ntfs-3g tool, installed in linux.
 
Old 02-11-2010, 08:22 AM   #9
backtolinux
LQ Newbie
 
Registered: Nov 2009
Posts: 20
Blog Entries: 1

Rep: Reputation: 2
the problem is in the name of the mount point, eliminate the blank
 
Old 02-11-2010, 08:24 AM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Using ntfs may allow rw mounting in recent kernels. You can change the ownership and permissions of ntfs filesystems using the uid, gid, fmask and dmask mount options. They effect all files and directories respectively. Please read the mount and mount.ntfs manpages for more options you may want or need. If using ntfs-3g, make sure you have the fuse module available and modprobed. "lsmod | grep fuse"

You don't want to use automounting for externel media. It they are unplugged when you boot, you will be dropped into the rescue shell. You want to use the "noauto" option and use the UUID or the path instead of a device node such as /dev/sdb3. The partition might by /dev/sdc3 the next time you plug it in.

Another way is to use the automount system of your desktop. An advanced tab in properties for the drive may have settings to set how the device is mounted. It depends on your desktop. The desktop does this by using HAL and policy kit. You may need to grant a local user polkit authorization to mount fixed media. (partitions on internal drives)

The rule in question is "org.freedesktop.hal.storage.mount-fixed". There is a "polkit-gnome-authorization" program you can run as root to enable permissions to mount a fixed drive. By default, it is granted for removable storage but denied for fixed storage. The desktop has to obey this policy.

The old school method was to use "user" or "users" with "uid=<username>" which the SUID mount program would allow a regular user to mount. If /bin/mount and /bin/umount are still suid programs, this method may still work. The mount program checks that the device is listed in /etc/fstab and checks the mount options before allowing it.

If that user could access the mounted disk depended on the uid=,gid=,fmask and dmask values. Later udev was used which might change the primary group of the raw device node for the filesystem to grant read/write access. Now polkit uses setfacl instead to control access.

Last edited by jschiwal; 02-11-2010 at 08:30 AM.
 
Old 02-11-2010, 08:53 AM   #11
ianp5a
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Original Poster
Rep: Reputation: 0
dadrunamok: Thanks. I'll look into ntfs-3g.
linuxlover.chaitanya: "mount command needs root" Yes. But what setting is that controlled by?
backtolinux: "eliminate the blank" Cripes! Have they not got that sort of crap fixed yet?
jschiwal:
Quote:
"the uid, gid, fmask and dmask mount options".
OK heavy reading.
Quote:
"An advanced tab in properties for the drive may have settings to set how the device is mounted.
I expected to find it there in Nautilus. It seems that is not possible.
Quote:
There is a "polkit-gnome-authorization" program you can run as root to enable permissions to mount a fixed drive.
Aha! I'll study that too.

Thanks everyone. I'm sure developers have worked hard to get all this working. But it seems a very complicated process for a user just to access the internal disks. I'm not going to let it loose on my daughter just yet.
 
Old 02-12-2010, 12:13 AM   #12
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Well you can use sudo command to get the root permissions temporarily. Try

sudo mount <device> </mount/point>.
It will ask you for authorization and you give your password.(Password for the user you are logged in as).
 
Old 02-12-2010, 12:22 AM   #13
pix9
Member
 
Registered: Jan 2010
Location: Kalyan, Mumbai, Maharashtra, India
Distribution: Red Hat (RHEL 6.0)
Posts: 163

Rep: Reputation: 19
well the entry in fstab file is correct
/dev/sda2 /mnt/drive2 ntfs-3g defaults 0 0

you can use that entry, i am using similar entry in my fstab to mount ntfs partitions, but it doesn't mount the ntfs partition at beginning as ntfs-3g module in not loaded at that time of booting when other partitions are loaded so you can make another service which loads after loading modules for ntfs-3g and make it run at end of starting other services on your runlevel []
 
Old 02-12-2010, 12:24 AM   #14
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
If you can't eliminate the space between "Windows" and "7" use this instead
Code:
/dev/sda2       /media/Windows\ 7     ntfs     defaults,user     0     0
 
Old 02-12-2010, 07:09 AM   #15
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
That was a good pick by worm. You need to escape white spaces.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
permission problems with a cifs mount. RichardUK Linux - Server 5 12-19-2009 10:45 AM
Cannot mount ntfs-3g USB dirve with user permission login console PB0711 SUSE / openSUSE 1 03-11-2009 10:45 AM
no write permission on NTFS mount zchoyt Linux - General 1 08-25-2005 10:10 PM
Mount NTFS Windows Drive / Permission Problems allen_p Linux - Newbie 1 08-05-2004 10:16 PM
USB2 NTFS Hard Drive Mount Permission UberMousE Linux - Hardware 10 05-14-2004 06:27 AM


All times are GMT -5. The time now is 10:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration