Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (4) </ 1 [2] 3 4 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: unionfs examples, using unionfs for a variety of things< Next Oldest | Next Newest >
JB4x4 Offline





Group: Members
Posts: 77
Joined: Oct. 2005
Posted: April 17 2006,23:04 QUOTE

I was messing with unionfs, and came up with something.  First I created XFree86.uci, it mounts as /opt/XFree86/usr.  Then I ran...

mount -t unionfs -o dirs=/usr=ro:/opt/XFree86/usr=ro unionfs /usr

What I have ended up with is a working XFree86 without having to make /usr writeable.  This saves alot of memory, but I was wondering if there are there any adverse effects.  (I am running a frugal install.)  The only thing I noticed is that I had to add "umount unionfs" to powerdown.sh to umount /usr so that XFree86.uci properly un-mounts.
Back to top
Profile PM 
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: April 17 2006,23:43 QUOTE

That's EXACTLY what I was wondering about :)

Thanks for experimenting.
Back to top
Profile PM MSN YIM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: April 17 2006,23:57 QUOTE

That totally blew my mind.  I didn't know that a union could contain the directory it points to.  You might want to make the /usr directory rw (read write) instead of ro (read only).

I think /usr became writeable when you loaded the unionfs.dsl.  Loading dsl files runs mkwriteable which makes that directory and others writeable, but their contents are still links into /KNOPPIX.  The fact that you could modify the files that were from your uci's usr directory is really nice, though.

Just out of cuiousity, did you run free at all to check the amounts of memory at various points in the process compared to the traditional way?  Like loading XFree86.dsl and running free, then restarting and running it with your uci and running free again to check the difference?

Like clivesay said, thanks for experimenting.

EDIT:

I don't think that works.  It's a nice idea but I don't believe the union can contain its own contents.  I also found out it's really easy to mess things up when your changing the /usr directory and where it's link points.
Back to top
Profile PM 
JB4x4 Offline





Group: Members
Posts: 77
Joined: Oct. 2005
Posted: April 18 2006,02:57 QUOTE

Clacker, I actually didn't tell you the whole story, I took your .dsl extension, and remade it into a .uci extension :D.  It mounts in opt and loads the module with "insmod", leaving /usr read-only.  I didn't check free on the old setup (XFree86.dsl), but I know it was using 30-50 meg of swap as soon as X started.  Running frugal now, after just loading unionfs.uci and xfree86.uci, free shows Mem:  78164 total, 61984 used, 16180 free - Swap 156200 total, 0 used 156200 free.

I have even managed to shave about 30 seconds off of the boot time from the old debian styled install I ran before trying frugal, and probably close to a min when I first started using frugal and having to load XFree86.dsl at boot.

As far as I can tell when looking through /usr, it seems unionfs made a seemless integration between /usr and /opt/XFree86/usr (the mount of XFree86.uci).  I even tried going to the console running "umount unionfs", "startx", and there were errors, "No X server found".  Re-run the "mount -t unionfs ........" command, and everything works fine again.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: April 18 2006,03:07 QUOTE

That's pretty awesome

--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
19 replies since April 17 2006,02:50 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (4) </ 1 [2] 3 4 >/
reply to topic new topic new poll
Quick Reply: unionfs examples

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code