2004/11/21 unionfs


Union mounts for Linux.

There, wasn't that helpful?

Just kidding: So what's a union mount? Imagine you have a directory with files in it, and you then mount some device on that directory. Ordinarily, the original files would no longer be available, but a union mount leaves them visible: you can see both the files from the device you mounted and the files that were originally in the directory you mounted it on.

This mixing raises interesting problems - for example what happens if there are identically named files? I'm not going to go into the details of all this here because it takes a lot of space and it makes my head hurt, but this is where whiteouts come into play. The basic issue is that the "upper" layer is the last thing mounted, and although everything below is visible, if you want to delete something in the lower layer, you really can't; a "whiteout" in the upper layer makes it seem to be deleted.


Hate these ads?

Union mounts have been available in BSD and Mac OS 10, see http://www.fsl.cs.sunysb.edu/project-unionfs.html for Linux. Interestingly, unionfs allows you to create snapshots.

If you really want to know about whiteouts, go read

http://www.google.com/ search?q=cache:dx6PtfUYrKcC:www.usenix.org/ publications/library/proceedings/neworl/ full_papers/mckusick.ps+bsd+whiteouts &hl=en&ie=UTF-8

A common use is in Live Cd's: the read only cd file system is paired with a writeable file system on a hard drive.



Comments


Sun Nov 19 10:43:37 2006: Subject:   drag
Oh, UnionFS is nice. Lots of flexibility.



For instance I wanted to have a Linux install on a USB key. It would operate in similar fasion to 'live linux cdroms' but instead of having the top layer of the stack be in tmpfs it would be writing out to the usb pen drive.

By using Squashfs (read only compressed file system) I was able to make the equivelent of 1.3 or so gigs of disk space compress down to under 700 megs. I don't remember the actual amount. Using Unionfs I was able to make it seems fully writable and have this be persistant through reboots.

Add your comments

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
4438456 3,161

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:
       - Misc.




Unix/Linux Consultants


http://www.schewanick.com SCO Unix, Solaris, Linx (various), PHP, MySQL, Apache, uniBasic, dL4, Perl, System Administration and more....


larryi@ccamedical.com SCO OS5, Debian Linux, RedHat Linux, MySQL, Apache, AJAX development using dXport/dL4/Unibasic, Windows Connectivity, Sharing Resouces, Automation, Shell Scripting


http://echo3.net/ Unix/Linux Custom Applications, Web Hosting, C/C++ Programming Courses



Twitter
  • Nov 23 13:01
    I need coffee before I will even open the door, never mind go out there. That's completely non-negotiable, by the way.
  • Nov 23 12:56
    It's COLD and my wife wants us to go work in the yard. Do you think I can have her arrested for cruelty? Probably not as she's going too.









Change Congress


Related Posts