LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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
 
Thread Tools
Old 03-31-2005, 03:06 PM   #1
systemparadox
Member
 
Registered: Jul 2004
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, Mandrake 9.0/9.1/10.0, LFS 6.0, Knoppix 3.1/3.3
Posts: 73
Thanked: 0
Lightbulb Transparent (or semi-transparent) mounts


[Log in to get rid of this advertisement]
Sounds kinda wierd I know, but lemme explain...

I have a filesystem tree (could be one partition on /, or several partitions making up the whole filesystem). Now I want to mount another partition somewhere on top of it (like we can do already- sorta), say on /usr. Instead of hiding the entire contents of /usr with the new mount, I want to be able to see (and possibly modify) the would-be-hidden files, IF there is no corresponding file on the new mount. All new files should be added to the last mounted drive.

This would be most useful for the current setup with the Sharp Zaurus (linux pda). It's only got 32mb on board memory, so most ppl add apps to their sd card. Rather than having to link all these files and therefore overwrite exisiting files on board which are upgraded (and make the sd umountable- very inconvienient), we could transparently mount the sd on top of the on board memory.

Does anyone know if this is already possible? I did find a couple of messages on the kernel mailing list, but thats all. It doesn't help that I don't really know what to call this.

Thanks
Simon
systemparadox is offline     Reply With Quote
Old 03-31-2005, 03:35 PM   #2
HenchmenResourc
Member
 
Registered: Mar 2004
Location: SLC, Utah
Distribution: OpenSUSE 10.3 / 11rc1, PC-BSD 0.7.8, Centos 4.5,
Posts: 245
Thanked: 0
at this point to the best of my knowledge there is no way to do this, when you mount a drive/memcard that is all you will see at that mount point if there is something in that folder before you mount, once you mount that drive, as far as the kernel/system is concerned those files that were originally in the folder do not exist.
HenchmenResourc is offline     Reply With Quote
Old 03-31-2005, 04:21 PM   #3
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Slackware & Slax
Posts: 443
Thanked: 2
Not in UNIX. Plan9 was to be different in this way, but...
alienDog is offline     Reply With Quote
Old 03-31-2005, 05:46 PM   #4
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Thanked: 0
mount -bind
chbin is offline     Reply With Quote
Old 04-01-2005, 04:46 AM   #5
systemparadox
Member
 
Registered: Jul 2004
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, Mandrake 9.0/9.1/10.0, LFS 6.0, Knoppix 3.1/3.3
Posts: 73
Thanked: 0

Original Poster
Doesn't bind just mount the same part in two places? There is no indication that this gives any different behaviour from normal mounts, so it would still hide the existing contents (or it would have to be mounted somewhere else- which is back to square 1).
systemparadox is offline     Reply With Quote
Old 04-01-2005, 05:08 AM   #6
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Thanked: 0
read the man page again. you can mount on top of an already mounted partition and effectivly bind the two into one collective mount. I mount bind multi mounts into /dev/shm all the time.
chbin is offline     Reply With Quote
Old 04-01-2005, 05:15 AM   #7
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Thanked: 0
you can do a lot with bind mounts. u could say bind the file /usr/tammy into /jammy and then bind the file /opt/wammy into /jammy. Then go into /jammy and see tammy and wammy in there.

Of course you have to write a script to weed out what files already exist in wammy so you wont overwrite jammy or tammy if it is already in there.
chbin is offline     Reply With Quote
Old 04-01-2005, 05:37 AM   #8
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379
Thanked: 0
You are thinking forwards. bind can mount a filesystem in to two places like it says in the man page.

Think backwards. or the reverse. bind two filesystems into one. Why not?
chbin is offline     Reply With Quote
Old 04-01-2005, 08:51 AM   #9
systemparadox
Member
 
Registered: Jul 2004
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, Mandrake 9.0/9.1/10.0, LFS 6.0, Knoppix 3.1/3.3
Posts: 73
Thanked: 0

Original Poster
I gave it a try, but it seems that it doesn't work.
Firstly, it won't let me bind a file somewhere else (not that that is what I want to do anyway). I just says:
mount: Not a directory

Secondly, if I bind a directory on top of another directory it hides the previous contents, just like I thought it would before.

Just how do _you_ use bind?
systemparadox is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
transparent TranceDude Linux - Software 7 08-12-2005 05:36 PM
Squid Transparent win32sux Linux - Networking 2 08-05-2005 12:57 PM
Transparent PNGs show up as transparent in Firefox - opaque in IE? hs123 General 10 01-11-2005 07:54 AM
transparent windows where/how watashiwaotaku7 Linux - Software 6 06-29-2003 05:33 PM
SEmi-transparent windows managers?? nutshell Linux - General 4 03-04-2002 06:17 PM


All times are GMT -5. The time now is 01:30 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration