LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-31-2007, 08:19 PM   #1
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Rep: Reputation: 15
Can I mount a device onto two different points with different options?


I'd like Windows to be accessible from my two Linux OSs (on the same computer). There will be children using the computer. I was thinking about mounting Windows onto a directory in my home directory with rw privileges and then to the general system (available to all users) with ro privileges. That way the kids wouldn't be able to mess around with Windows system files...

So I was going to do (and please correct me on the syntax here, I've never done this on my own...):

.../home/linux $ mkdir windows
... # mount -t ntfs -o rw,umask=0000 /dev/hda1 /home/linux/windows (my home directory)

.../media # mkdir win_c
mount -t ntfs -o ro,umask=0077 /dev/hda1 /media/win_c (available to all users)

Will this do the trick? I'll be doing this on Debian.

The second command/part is based on my Mandriva setup, which is a default setup and I'm quite happy with it, although, it isn't possible to write to the windows partition using Mandriva.

Will this let me write and edit files in Windows, saving them there? Or only transfer files? Does this work? Has anybody out there already tried it??

Many thanks.

P.S. - I just noticed another problem. On Debian, I mounted separate a partition onto my home directory, and a "DATA" icon appeared on the desktop of all users (not my doing!). Everyone has access to my files! The fstab line reads "/dev/hda5 /home/linux/lindata ext3 user,auto,rw,exec 1 2" How can I make it so that user 'linux' is the only one who has access to this directory and its contents? I'd like to get rid of that default DATA icon too, that is, without manually deleting it everytime I create a new user...

Last edited by fc6_user; 05-31-2007 at 08:31 PM.
 
Old 06-01-2007, 12:14 AM   #2
wartstew
Member
 
Registered: Apr 2002
Location: Albuquerque, NM USA
Distribution: Slackware, Ubuntu, Debian, Maemo
Posts: 464

Rep: Reputation: 30
Try it!

I know you can mount the same file system in more than one place (as long as you are running a somewhat modern kernel) because I've done it. I've just never tried setting them up with different permissions.

On the magically appearing icons. This is a feature of either your "window manager" and/or an add-on service program running with it. I'm sure it is configurable in that you could probably tell it NOT to auto display certain hard drive mounts. Which WM are you running (Gnome, KDE, XFCE, IceWM, etc)? Give us the output of "ps -a" (ps -a > file.txt) and maybe someone can identify the offending program.
 
Old 06-01-2007, 12:28 AM   #3
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
It's all in the umask. If you use 0000, you are giving everyone all permissions. If you use 0077, however, only the owner of the directory will have access.

You can prevent mounts from appearing on your desktop by Following Applications > Configuration Editor > Apps > Nautilus & disabling the relevant option. That is, if you are using Gnome.
 
Old 06-01-2007, 02:20 AM   #4
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
There are two stumbling blocks that I can see.
First,
The default umask of a user is 022, which is equal to 755 permissions, and this will more than likely be the umask applicable to a directory in a user's /home. You won't get read/write access to the partition.
Second,
Just like Mandriva, Debian will not allow writing to ntfs by default, to do so you should install ntfs-3g, which is available through Debian repositories and can be installed via Synaptic.

For yourself:
You should change directory to / and make a directory as such:
Code:
mkdir windows
This directory will be located at /windows, you can mount it manually (after installing ntfs-3g and unmounting it), with command:
Code:
mount -t ntfs-3g /dev/hda1 /windows
You can also add a line to /etc/fstab to have it auto-mounted using your user ID so it is only mounted in rw when you log in. And change permissions as administrator to that directory to only allow your user to have write/execute access.

For the other users:
Go ahead and make the win_c directory in /media, then add a line in /etc/fstab similar to the line in Mandriva's /etc/fstab without the "ntfs-3g" to avoid write access.

This is assuming, you log in as your user, all other users log into their own sessions, meaning, you're not all logging into the same session.

Last edited by Junior Hacker; 06-01-2007 at 02:22 AM.
 
Old 06-05-2007, 05:38 AM   #5
jlluis
LQ Newbie
 
Registered: Sep 2003
Location: Barcelona, Spain - Catalan
Posts: 5

Rep: Reputation: 0
No. As far as I know you cannot mount the same device twice with different options, like
mount -o opt_A /device_x /first/mount/point && mount -o opt_B /device_x /second/mount/point.

Even if you try "bind" mount:
mount -o bind,ro /first/mount/point /second/mount/point
taking a look at /proc/mounts (prompt$ cat /proc/mounts) will show you that (only) the first options apply.

Good luck
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mount one device to two mount points secretlydead Linux - General 3 03-28-2007 05:30 AM
USB Device Mount Points & proc flower.Hercules Linux - Hardware 4 05-16-2006 09:58 PM
help with mount points rmanocha Linux - Software 12 10-26-2003 01:32 PM
SCRIPT: check if auto-mount mount-points are still mounted markus1982 Linux - Software 0 05-25-2003 05:48 AM
Mount Points? Mr_Floppy4 Linux - General 2 10-14-2002 10:03 PM


All times are GMT -5. The time now is 05:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration