Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fstab: mounting a drive in 2 places at the same time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Sat Feb 23, 2008 7:42 pm    Post subject: fstab: mounting a drive in 2 places at the same time Reply with quote

Code:

/dev/sr0      /mnt/cdrom      auto      user,auto,ro      0 0
/dev/sr0      /home/gabriel/@CD   auto      user,auto,ro      0 0

/dev/sdf1      /mnt/usb      vfat      user,rw,noauto      0 0
/dev/sdf1      /home/gabriel/@USB   vfat      user,rw,noauto      0 0


This is a part of my fstab. As you can see I mount my pendrive and my dvd in both /mnt and my user home directory. I'd like to make both directories "connected". I mean... when I mount /dev/sdf1 in /mnt/usb it will also mount in /home/gabriel/@USB and vice versa. I've read the man pages and I think that can be done by adding "bind" to the options, but I don't know how to do it properly.

Help appreciated :)
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Feb 23, 2008 7:45 pm    Post subject: Reply with quote

Why a simple symlink is not good?
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Sat Feb 23, 2008 9:17 pm    Post subject: Reply with quote

NO :) I'm using ROX as my gui file manager and It has some visual issues when the mounted directory is accessed through a symlink. So is there any way to do it not using a symlink ?? :)
Back to top
View user's profile Send private message
gundelgauk
n00b
n00b


Joined: 01 Oct 2007
Posts: 40

PostPosted: Sat Feb 23, 2008 9:36 pm    Post subject: Reply with quote

You would mount manually like this:
# mount -t auto /dev/sr0 /mnt/cdrom
# mount -o bind /mnt/cdrom /home/gabriel/CD

The corresponding fstab entries should look like this:
Code:
/dev/sr0      /mnt/cdrom      auto      user,auto,ro   0 0
/mnt/cdrom      /home/gabriel/CD   auto      bind      0 0


It works with partitions but I haven't tried it with removable media (CDROM, USB drives). You might get mixed results with these.
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Sun Feb 24, 2008 11:30 am    Post subject: Reply with quote

Nope... doesn't work :/ The problem is that I don't want to mount it manually... ROX mounts the drive when I enter the @CD or @USB directory. And I want it to work properly.

Maybe there's another way ?? If not than I guess my problem is unsolved :/
Back to top
View user's profile Send private message
gundelgauk
n00b
n00b


Joined: 01 Oct 2007
Posts: 40

PostPosted: Sun Feb 24, 2008 11:36 am    Post subject: Reply with quote

Then I guess you would have to change the way ROX mounts your drives. Maybe there's a way to configure the mount commands it uses. If not, you would have to change it in the program's source code.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6069
Location: Removed by Neddy

PostPosted: Sun Feb 24, 2008 11:49 am    Post subject: Reply with quote

bind mount
_________________
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum