[SOLVED] Make mounting Windows partition not need sudo

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
metroid_maniac

[SOLVED] Make mounting Windows partition not need sudo

Post by metroid_maniac »

I dual-boot Linux Mint 9 KDE and Windows. Whenever I try to mount the Windows partition, it asks me for my password ( I can use sudo). Is there a way to turn this off?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
viking777

Re: Make mounting Windows partition not need sudo

Post by viking777 »

If I wanted to be cynical I would say it is because you choose to use KDE, but I want to be a bit more constructive than that, so the only thing I can think of is to run the terminal command:

Code: Select all

cat /etc/fstab
And post the output here.

I have serious doubts as to whether that will give an answer, but at least it is something to look at.

You see for most of us the question is not "how do you turn this off?" but more "how did you turn it on?"
oobetimer

Re: Make mounting Windows partition not need sudo

Post by oobetimer »

metroid_maniac wrote:I dual-boot Linux Mint 9 KDE and Windows. Whenever I try to mount the Windows partition, it asks me for my password ( I can use sudo). Is there a way to turn this off?
1. Make a folder

sudo mkdir /media/Windows

2. Make a mount-point

gksudo gedit /etc/fstab

....add to the list's end. An example windows partition is sda1

/dev/sda1 /media/Windows ntfs rw,user,noauto,exec,utf8 0 0

....save and quit

sudo mount -a

sudo chown -R your_username: /media/Windows

metroid_maniac

Re: Make mounting Windows partition not need sudo

Post by metroid_maniac »

metroid_maniac wrote:I dual-boot Linux Mint 9 KDE and Windows. Whenever I try to mount the Windows partition, it asks me for my password ( I can use sudo). Is there a way to turn this off?



1. Make a folder

sudo mkdir /media/Windows

2. Make a mount-point

gksudo gedit /etc/fstab

....add to the list's end. An example windows partition is sda1

/dev/sda1 /media/Windows ntfs rw,user,noauto,exec,utf8 0 0

....save and quit

sudo mount -a

sudo chown -R your_username: /media/Windows
When I tried to run gksudo gedit /etc/fstab it didn't work (because I am using mint KDE?) so I used dolphin to go to that directory and edit it with gedit anyway.

I added the line /dev/sda1 /media/Windows ntfs rw,user,noauto,exec,utf8 0 0 to the end of the file (My Windows Partition is on /dev/sda1), and I saved my changes

I ran sudo mount -a and sudo chown -R jaime: /media/Windows

I'll finish this after I restart...

EDIT: Whenever I click on my Windows partition in dolphin now it says "An error occurred while accessing 298.1 GiB Hard Drive, the system responded: Unpribileged user can not mount NTFS block devices using the external FUSE library. Either mount the volume as root or rebuild NTFS-3G with integrated FUSE support and make it setuid root. Please see more information at http://ntfs-3g.org/support.html#unprivileged"

and when I go to /media/Windows/ it says I am in the partition but it is completely empty
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Make mounting Windows partition not need sudo

Post by altair4 »

Change this:
/dev/sda1 /media/Windows ntfs rw,user,noauto,exec,utf8 0 0
To this
/dev/sda1 /media/Windows ntfs defaults,umask=000,nls=utf8 0 0
This will mount the ntfs partition automatically to /media/Windows

BTW, you can't chown a windows file system. You can chown the mountpoint when the partition is not mounted but once it mounts ownership is is control of however it's set in fstab.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
StanTheMan

Re: Make mounting Windows partition not need sudo

Post by StanTheMan »

Instead of chowning a mount point , you can set up a group permissions.
Mint and most Ubuntu types by default make the UserName a member of the group ' plugdev '.
If you create a mount point directory to mount an NTFS partition , make that directory Group=plugdev with read and write permissions .
For example, if you want to mount an NTFS partrition on /media/Windows - -
Terminal
cd /media
sudo mkdir Windows
sudo chgrp plugdev Windows
sudo chmod g+rw Windows

Now you will have a directory point that is owned by Root , but any User who is a member of the group 'plugdev' can read and write to that partition.
sylvainsjc

Re: Make mounting Windows partition not need sudo

Post by sylvainsjc »

Hello,

An easy way to manage those partition that you wants to automaticaly mount : apt://pysdm

Information about this helpfull program : http://www.ubuntugeek.com/pysdm-graphic ... nager.html

It's available for Xfce, gnome or Kde :wink:
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Make mounting Windows partition not need sudo

Post by altair4 »

StanTheMan wrote:Instead of chowning a mount point , you can set up a group permissions.
Mint and most Ubuntu types by default make the UserName a member of the group ' plugdev '.
If you create a mount point directory to mount an NTFS partition , make that directory Group=plugdev with read and write permissions .
For example, if you want to mount an NTFS partrition on /media/Windows - -
Terminal
cd /media
sudo mkdir Windows
sudo chgrp plugdev Windows
sudo chmod g+rw Windows

Now you will have a directory point that is owned by Root , but any User who is a member of the group 'plugdev' can read and write to that partition.
You cannot chown, chmod or chgrp a windows filesystem. NTFS is a windows filesystem. If you create a mountpoint at /media/Windows and do chgrp to plugdev the resulting mountpoint will have ownership / permissions of:
root:plugdev 0775
If you then add a line in fstab that looks like this:
/dev/sda1 /media/Windows ntfs defaults,umask=000,nls=utf8 0 0
It will change the ownership / permissions of /media/Windows to this:
root:root 0777
In order to achieve what you want the line in fstab should look like this:
/dev/sda1 /media/Windows ntfs defaults,umask=002,gid=46,nls=utf8 0 0
Ownership and permissions on any windows file system is determined by an explicit mount or by the configurations in fstab. This is just the opposite of how a Linux filesystem is handled.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Make mounting Windows partition not need sudo

Post by altair4 »

sylvainsjc wrote:Hello,

An easy way to manage those partition that you wants to automaticaly mount : apt://pysdm

Information about this helpfull program : http://www.ubuntugeek.com/pysdm-graphic ... nager.html

It's available for Xfce, gnome or Kde :wink:
I personally would caution against the use of pysdm, mountmanager, or any of the rest of these utilities. They offer too many options, are not very reliable, and not very intelligent. I installed mountmanger recently to see what all the fuss was about and it completely erased one of my entries:
bindfs#/DATA /home/Shared fuse perms=0666:+x 0 0
Apparently, it had no idea what that was so it simply removed it.

I prefer a simpler approach. Mounting in fstab is really just a set of three templates based on the filetype of the partition you are trying to mount. All of this and more is available in this how to:

Auto Mount Partitions on Boot (also Windows partitions):
http://forums.linuxmint.com/viewtopic.php?f=42&t=22093
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
metroid_maniac

Re: Make mounting Windows partition not need sudo

Post by metroid_maniac »

altair4's method worked perfectly. Thanks everyone!
viking777

Re: Make mounting Windows partition not need sudo

Post by viking777 »

WOW!

I never realised that mounting windows partitions could be so difficult. It makes me wonder how my fstab entry:

Code: Select all

LABEL=ACER /mnt/ACER ntfs-3g defaults 0 0
Has given me full read/write access as a normal user on a dozen or more different distros for many years? (ever since they invented ntfs-3g anyway).
metroid_maniac

Re: Make mounting Windows partition not need sudo

Post by metroid_maniac »

...Well, don't take the piss out of the n00b.
viking777

Re: Make mounting Windows partition not need sudo

Post by viking777 »

metroid_maniac wrote:...Well, don't take the piss out of the n00b.
I would vehemently deny that I am taking the piss out of anybody, certainly not the newbie. But I would question the 'experts' as to whether all the umask=this and gid=that are really necessary because they aren't for me.
metroid_maniac

Re: Make mounting Windows partition not need sudo

Post by metroid_maniac »

I don't understand any of that, but OK
If I add that line to the end of any future installations, assuming that /media/Windows exists and the Windows Partition is on /dev/sda1 will it work?
viking777

Re: Make mounting Windows partition not need sudo

Post by viking777 »

metroid_maniac wrote:I don't understand any of that, but OK
If I add that line to the end of any future installations, assuming that /media/Windows exists and the Windows Partition is on /dev/sda1 will it work?
I can only repeat what I said before, It works for me and has done for a long time. The only way you will know if it works for you is to try it.
DrHu

Re: Make mounting Windows partition not need sudo

Post by DrHu »

viking777 wrote:
metroid_maniac wrote:...Well, don't take the piss out of the n00b.
I would vehemently deny that I am taking the piss out of anybody, certainly not the newbie. But I would question the 'experts' as to whether all the umask=this and gid=that are really necessary because they aren't for me.
I agree that you aren't disparaging anyone, you did provide an /etc/fstab line that works for you
--and maybe others can try it as well

I can't since I don't even bother with multiboots: if I need a windows OS for other than games, I use a VM, such as vitrualbox
--if I needed a windows game machine, I would probably be using an XBox or an on-line gaming subscription service

A description of ntfs mount and permissions, for those interested
http://opensuse.swerdna.org/susentfs.html
oobetimer

Re: Make mounting Windows partition not need sudo

Post by oobetimer »

viking777 wrote:WOW!

I never realised that mounting windows partitions could be so difficult. It makes me wonder how my fstab entry:

Code: Select all

LABEL=ACER /mnt/ACER ntfs-3g defaults 0 0
Has given me full read/write access as a normal user on a dozen or more different distros for many years? (ever since they invented ntfs-3g anyway).
For a perfect soap, Windows XP and Mint 7 .. :lol:
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Make mounting Windows partition not need sudo

Post by altair4 »

viking777 wrote:
metroid_maniac wrote:...Well, don't take the piss out of the n00b.
But I would question the 'experts' as to whether all the umask=this and gid=that are really necessary because they aren't for me.
Ah, that's the viking777 I remember. It's good to have you back. I don't know If I would consider myself an expert but I can tell you why I always include umask.

Your way of relying on "defaults" depends on an implicit umask=000. My way is in fact redundant and unnecessary. It's there so that I can quickly look at the line and know what permissions I've set it at and to make sure that it stays that way. Do you remember the good old days - say 7 months ago - when you could plug in an external, ntfs formatted, usb drive and it would automatically mount to root:root 777. It doesn't do that any more. Somebody's always playing with the defaults.

And as for the gid, etc... stuff ....... If you where to use the manual partitioning routine during the initial install of Mint and had these non-system partitions mounted for you it would ask you two questions: where do you want it mounted and how is it formatted. What it produces is a line that looks a little like this:
UUID=1EF42FA9F42F81DF /media/Windows ntfs defaults,nls=utf8,umask=007,gid=46 0 0
This is pretty much old school stuff here. Root and all local login users will have read / write access and everyone else will have no access at all.

I'll admit though that my recommendations always reflect my prejudices.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
viking777

Re: Make mounting Windows partition not need sudo

Post by viking777 »

Thanks altair4 - a very good answer.
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Make mounting Windows partition not need sudo

Post by altair4 »

oobetimer, the mistake you made in your original response was the use of "noauto":
/dev/sda1 /media/Windows ntfs rw,user,noauto,exec,utf8 0 0
Can't have the user / noauto combo with ntfs - it's a fuse thing.

As for you current setup:
/dev/sda1 /media/Windows ntfs rw,user,auto,exec,utf8 0 0
Your use of the "user" option is equivalent to my use of the "umask" option. It's not doing what you think it's doing because the only user at the time fstab is executed is root. If you had used "users" instead then it might be different.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Beginner Questions”