LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-21-2003, 04:54 PM   #1
Festiz
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware 9.0
Posts: 8

Rep: Reputation: 0
Post Mounting NTFS-partitions and getting readingrights for users.


Hi guys an gals.
I have a little problem with my ntfs-disks. When I try to mount it as my ordinary user (festiz) , it complains about me not beeing root. Although my /etc/fstab looks like this:

Code:
/dev/hda3 	/mnt/c		 ntfs	     users,noauto     0   0
/dev/hdb1       /mnt/h		 ntfs        users,noauto     0   0
/dev/hdd1       /mnt/d           ntfs        users,noauto     0   0
/dev/hde1       /mnt/g           ntfs        users,noauto     0   0
/dev/hdf1       /mnt/i           ntfs        users,noauto     0   0
Now when I try running my little nice mounting script it says - You have to be root to do that.
My Script:

Code:
#/bin/bash
mount -t ntfs /dev/hda3 /mnt/c 
mount -t ntfs /dev/hdb1 /mnt/h
mount -t ntfs /dev/hdd1 /mnt/d
mount -t ntfs /dev/hde1 /mnt/g
mount -t ntfs /dev/hdf1 /mnt/i
I'd be very happy for all help I could get.
btw. I'm sitting on a slackware 9.0 installation.
 
Old 10-21-2003, 05:20 PM   #2
kc8tbe
Member
 
Registered: Feb 2003
Location: Cleveland, Ohio (USA)
Distribution: Gentoo, Kubuntu 6.06
Posts: 179

Rep: Reputation: 30
You could use sudo, although I've been having a little trouble getting sudo to work myself.

http://www.peakpeak.com/~jallen/howtos/sudo-howto.html
 
Old 10-22-2003, 06:19 AM   #3
Festiz
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware 9.0
Posts: 8

Original Poster
Rep: Reputation: 0
When I try to run my script modified for sudo this happens:
Code:
bash-2.05b$ /./montera 
Password:
Sorry, user festiz is not allowed to execute '/bin/mount -t ntfs /dev/hda3 /mnt/c' as root on festiz.
The Script now looks like this:
Code:
#/bin/bash
sudo mount -t ntfs /dev/hda3 /mnt/c && mount -t ntfs /dev/hdb1 /mnt/h && mount -t ntfs /dev/hdd1 /mnt/d && mount -t ntfs /dev/hde1 /mnt/g && mount -t ntfs /dev/hdf1 /mnt/i
And my /etc/sudoers look like this:
Code:
# sudoers file.
....
root    ALL=(ALL) ALL
 %users  ALL=/bin/mount /dev/hda3 ,/bin/umount
I also tested with the sudoers like this:
Code:
# sudoers file.
....
root    ALL=(ALL) ALL
 %users  ALL=/bin/mount ,/bin/umount
But then it just said - u have to be root to run mount
 
Old 10-22-2003, 08:39 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 4,023

Rep: Reputation: Disabled
Long shot:

you didn't specify read only in your /etc/fstab like
/dev/hda3 /mnt/c ntfs ro,users,noauto 0 0

Same in mount. Now, usually the kernel supports only reading, not writing to ntfs. Maybe your distro is crying foul?

Also, after reboot and those lines in fstab there should be no reason to mount the partitions, since they are already mounted and you'd get an error.

Does sudo work from scripts? How is it passed the password?
 
Old 10-22-2003, 05:29 PM   #5
Festiz
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware 9.0
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by JZL240I-U
Long shot:

you didn't specify read only in your /etc/fstab like
/dev/hda3 /mnt/c ntfs ro,users,noauto 0 0

Same in mount. Now, usually the kernel supports only reading, not writing to ntfs. Maybe your distro is crying foul?

Also, after reboot and those lines in fstab there should be no reason to mount the partitions, since they are already mounted and you'd get an error.

Does sudo work from scripts? How is it passed the password?
Well since it says noauto in fstab it doesnt mount it automatically
The Password I have to put in manually. As it is now the discs get mounted when I log in with my festizuser from my .bash_profile.
I'd like them to automatically be mounted without me doing anything. But how do I do this? if I just let fstab do it it get rootrights.. If i place my script to be run from rc.local it still is root that runs the script and mounts. what preferences can I use so that ANY user can access the mounted partitions? If i need to specify the userid or groupid in fstab and thats the only way - how do I find these out without installing webmin?
 
Old 10-22-2003, 05:32 PM   #6
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
Quote:
Originally posted by Festiz
Well since it says noauto in fstab it doesnt mount it automatically
The Password I have to put in manually. As it is now the discs get mounted when I log in with my festizuser from my .bash_profile.
I'd like them to automatically be mounted without me doing anything. But how do I do this? if I just let fstab do it it get rootrights.. If i place my script to be run from rc.local it still is root that runs the script and mounts. what preferences can I use so that ANY user can access the mounted partitions? If i need to specify the userid or groupid in fstab and thats the only way - how do I find these out without installing webmin?
change noauto to auto then they will be mounted when you boot up. and since you have listings in fstab you don't need to do mount with any flags. su into root and issue this command:

mount /dev/hda3
mount /dev/hdb1
etc...
 
Old 10-22-2003, 05:54 PM   #7
Festiz
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware 9.0
Posts: 8

Original Poster
Rep: Reputation: 0
Well that doesnt give me the right rights now does it? It is still only root who can read it!! are you guys not reading my message clear enough?

I Want my nonsuperuserusers to be able to read a couple of NTFSpartiitons.
 
Old 10-22-2003, 05:57 PM   #8
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
Quote:
Originally posted by Festiz
Well that doesnt give me the right rights now does it? It is still only root who can read it!! are you guys not reading my message clear enough?

I Want my nonsuperuserusers to be able to read a couple of NTFSpartiitons.
it should. the default mount permissions for mounting windows partitions is rwx-r-x-r-x.

try a line like this then if slack is doing things differently:

/dev/hda1 /mnt/c ntfs auto,owner,umask=0222,ro 0 0

and then mount.

edit: change the device block and mountpoints to yours. the above is just an example.

Last edited by megaspaz; 10-22-2003 at 05:58 PM.
 
Old 10-25-2003, 12:23 PM   #9
Festiz
LQ Newbie
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware 9.0
Posts: 8

Original Poster
Rep: Reputation: 0
I solved it so that my at the moment only local user (festiz) can access it by putting in the uid and gid preferences in fstab. Do you btw know how I get hold of those numbers without using webmin?
 
Old 10-28-2003, 08:34 AM   #10
apepost
Member
 
Registered: Oct 2003
Distribution: Fedora core 4
Posts: 113

Rep: Reputation: 15
You can make all users run mount as root by logging into root and type "chmod u+s <full path to the mount file>"

I think the path is "/usr/bin/mount" or "/sbin"

i hope this helps
 
Old 10-28-2003, 10:45 AM   #11
Wonderer
Member
 
Registered: Oct 2003
Location: London, UK
Distribution: Slackware 9.0
Posts: 58

Rep: Reputation: 15
Quote:
Originally posted by Festiz
Do you btw know how I get hold of those numbers without using webmin?
# id username

 
  


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
Mounting NTFS partitions question danritter Linux - Newbie 2 09-12-2005 02:14 AM
Mounting NTFS Partitions on Ubuntu vivekian Ubuntu 2 08-01-2005 10:34 AM
non-root users accessing NTFS partitions? Jaymz87 Slackware 11 06-14-2005 07:13 AM
Mounting NTFS Partitions in RH9 smevans Red Hat 26 11-09-2003 02:47 PM
Mounting NTFS Partitions TheMad Slackware 8 01-21-2003 05:16 PM


All times are GMT -5. The time now is 08:43 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