LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-31-2005, 02: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

Rep: Reputation: 15
Lightbulb Transparent (or semi-transparent) mounts


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
 
Old 03-31-2005, 02:35 PM   #2
HenchmenResourc
Member
 
Registered: Mar 2004
Location: SLC, Utah
Distribution: OpenSUSE 12.2
Posts: 246

Rep: Reputation: 30
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.
 
Old 03-31-2005, 03:21 PM   #3
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 48
Not in UNIX. Plan9 was to be different in this way, but...
 
Old 03-31-2005, 04:46 PM   #4
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
mount -bind
 
Old 04-01-2005, 03: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

Original Poster
Rep: Reputation: 15
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).
 
Old 04-01-2005, 04:08 AM   #6
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
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.
 
Old 04-01-2005, 04:15 AM   #7
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
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.
 
Old 04-01-2005, 04:37 AM   #8
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
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?
 
Old 04-01-2005, 07: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

Original Poster
Rep: Reputation: 15
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?
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:08 PM.

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
Open Source Consulting | Domain Registration