unionfs help corner


Forum: Other Help Topics
Topic: unionfs help corner
started by: Zucca

Posted by Zucca on Sep. 05 2006,07:34
Ok. I've read some information about unionfs.
But some open questions still remain.

Creating a tmpfs partition and merging it with another partition that already exist and contains files:
Ok. I have a tmpfs mount mounted to /tmpbin and also a root mount (mounted to / ofcourse) formatted to... let's say reiserfs (doesn't really matter what format).
Now I want that my /bin directory could be writeable but not permanently.
So I decide to mount /tmpbin over /bin using unionfs.

I wonder if it is possible?
Code Sample
mount -t unionfs -o dirs=/tmpbin=rw:/bin=ro unionfs /bin

Ok. Let's assume it worked just fine.
What if I delete a file that was originally on /bin? Does some special file on /tmpbin tell that the file is deleted (until reboot)? More simplier: How does my system know that the file is deleted while it still exists in ro area physically but invisible to system.

I'll be posting more questions later and also some anvers if I happen to find them.

Any urls refering to basic unionfs quide are very velcome.  :)

Posted by Zucca on Sep. 11 2006,14:28
Quote
Unionfs is a stackable filesystem, allowing you to "merge" several different filesystems together.


Ok. So it seems that unionfs is not actually a filesystem (?). I is just a mount that combines different filesystems together.

Posted by dmizzel on Sep. 12 2006,00:12
This link is for unionfs as it is used in mac osx. I found it informative in a general overview sort of way. I don't know if it applies, or is what you're looking for.

< http://rentzsch.com/macosx/unionFilesystems >

Posted by Zucca on Sep. 18 2006,14:36
Thanks. That document has few intresting points. =)
Posted by Zucca on Sep. 18 2006,14:47
Quote
In FreeBSD/NetBSD, deleting a file in the base system should not really delete this file, but rather add a 'whiteout' file to the overlay. If the file system of the overlay does not support whiteout files, deleting files in the base system should not be possible at all.

Ok. Then I'll like to know what filesystems support these whiteout files?

Posted by Zucca on Sep. 19 2006,10:24
I tried to create a tmpfs partrtion over /bin using unoinfs:
Code Sample
$ sudo mkdir /tmpbin && sudo mount -t tmpfs /tmpbin -o rw,size=256M,nouser,exec /tmpbin && sudo mount -t unionfs -o dirs=/tmpbin=rw:/bin=ro unionfs /bin

Last command gave me some errors:
Quote
mount: wrong fs type, bad option, bad superblock on unionfs,
      missing codepage or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

And dmesg | tail showed me only two revelant lines:
Quote
[4296879.137000] unionfs: hidden directory '/bin' is not a valid branch
[4296879.137000] unionfs_read_super: error while parsing options (err = -22)


But as I do this:
Code Sample
sudo mkdir /mount1
sudo mount -t tmpfs tmpfs -o rw,size=512k,nouser,exec /mount1
sudo mkdir /mount2
sudo mount -t tmpfs tmpfs -o rw,size=1024k,nouser,exec /mount2
sudo mkdir /unionmount
sudo mount -t unionfs -o dirs=/mount2=rw:/mount1=ro unionfs /unionmount
It works just fine. And when doing df -h it really worked.

See where I'm going? Yes. I want to 'lock' my system even if someone installs a program to my computer it will be there only until next reboot.

I tried this with my Xubuntu Live-CD.
Any help?

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.