LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Knoppix 3.8 and UnionFS. Wow. Just Wow.

   Print.Print
Email.Email weblog link
Discuss.Discuss
Blog this.Blog this
Kyle Rankin

Kyle Rankin
Mar. 14, 2005 11:18 AM
Permalink

Atom feed for this author. RSS 1.0 feed for this author. RSS 2.0 feed for this author.

URL: http://www.heise.de/english/newsticker/news/56987...

Klaus has released the latest version of Knoppix, 3.8, to the crowd at CeBIT 2005. This version includes the normal round of updates including the 2.6.11 kernel by default, KDE 3.3.2, and Firefox and Thunderbird instead of Mozilla. The exciting news, however, is the addition of UnionFS. UnionFS stacks your Knoppix ramdisk on top of the read-only filesystem on the CD, the effect being that you can apt-get install, and otherwise modify all of the files on the system as though they were all writeable. Here I'll go over why I think this is going to change Knoppix in a major way.

One of the struggles with using Knoppix day-to-day as a portable distribution has always been the fact that the majority of the CD was read-only. You had a nice ramdisk sandbox that let you write within the /home directory, and tinker in /etc if you changed some of the symlinks. If you wanted persistence, there was a nice script that created a small filesystem on writeable media like a usb thumbdrive and used it to store your home directory.

The Problem

The problem, of course, is that you couldn't install new programs with this method. All of /usr is read-only. Over time various methods have been introduced to try to hack around this by redirecting binaries into the /home directory and changing various system paths. The live software installer that came with previous versions of Knoppix is one example, and klik is another. These worked okay, depending on the program, but in some cases relied on hacks such as using scripts to search and replace file paths within binaries.

The Solution

Enter UnionFS. With this system, basically every segment of the filesystem is read-write. UnionFS keeps track of which files you have modified (which are modified and stored within the ramdisk) and which are unmodified, all on the fly. When you access a file in the filesystem that has been modified, UnionFS points you to the copy in ramdisk instead of the copy on the CD-ROM. This means that if you, say, want to install the enlightenment window manager all you would need to do is:

knoppix@2[knoppix]$ sudo apt-get update
knoppix@2[knoppix]$ sudo apt-get install enlightenment

You can install programs just like with Debian. They all get installed to their regular locations, and if you check out the /ramdisk directory on the CD, you will see a mirror of the root directory structure (or at least the directories that have been modified) and can see all of the files that you have changed. You can even use your favorite graphical packaging program (if you have one) to install packages.

This also means that if you set up a persistent home directory, you can potentially back up all of these changes and restore them at boot. In fact, Knoppix 3.8 already has a modified persistent home script that does just this (although it's still a beta feature so expect to see bugs here and there). Knoppix can even detect when you have done this on a drive when it boots, and will let you choose what features to restore from this image (if any). If you let it time out, Knoppix does the safe thing and doesn't load any of the settings.

The latest persistence script also automates the process of setting up an AES256-encrypted home directory, so if you are concerned about the security of your persistent image you can enable this option, type in a passcode, and Knoppix does the rest.

I really think UnionFS is going to take Knoppix to a whole new level of ubiquitous computing. You can truly use the CD just like any other installed CD, and with the prices of usb thumbdrives continuing to drop, you can basically install anything you would like. Major changes, such as replacing KDE with Gnome, probably will still work better if you do a full remaster, but I expect all of the Knoppix-based live CDs (if they are smart) will incorporate this technology into future releases.

Can you tell that I'm excited about this? Like I said, currently it seems to be a bit buggy (on a few of my machines I seem to get some instability after I restore from an image), but I imagine that sort of thing will be ironed out once the "download version" of Knoppix 3.8 hits http://www.knoppix.org.

Kyle Rankin is a system administrator who enjoys troubleshooting, problem solving, and system recovery. He is also the author of Knoppix Hacks, Knoppix Pocket Reference, Linux Multimedia Hacks, and Ubuntu Hacks for O'Reilly Media.

Comment on this weblog
You must be logged in to the O'Reilly Network to post a comment.
Post Comment
Full Threads Oldest First

Showing messages 1 through 13 of 13.

  • Yawn
    2005-03-20 08:19:25  ojsimpson [Reply | View]

    Damn Small Linux (DSL) livecd has been using a writable file system for almost a year now where you can apt-get stuff with little effort. If you have a decent swapfile or swap partition, you can apt-get almost anything even large size downloads.

    I am happy that KNOPPIX is heading in this direction but the functionality is not groundbreaking for a livecd distro.
  • Unionfs
    2005-03-19 12:01:09  lilsirecho [Reply | View]

    From some of the details, it seems that Unionfs uses the feature ..copy-on-write which is the COWLOOPfs.
  • Unionfs
    2005-03-19 11:40:00  lilsirecho [Reply | View]

    What happens if the install is corrupted?
  • Unionfs
    2005-03-19 11:37:46  lilsirecho [Reply | View]

    What effect does use of the UNIONFS have on the storage requirements for persistent home in view of the added installs with Unionfs?
  • Unionfs
    2005-03-19 09:29:30  lilsirecho [Reply | View]

    Should the user use TORAM mode and install programs via Unionfs, can the DVD+RW recorder be used to advantage in recording what has been added? Maybe even the CDRW recorder?
  • Unionfs
    2005-03-19 08:58:54  lilsirecho [Reply | View]

    What effects will the use of TORAM mode have on the use of Unionfs?

  • Unionfs
    2005-03-19 08:52:26  lilsirecho [Reply | View]

    Please advise the limitations that accompany the use of Unionfs.

    Does Unionfs allow exceeding the limits of the CD of ~700MB?

    If applied to a DVD of Knoppix, will the Unionfs extend the usefulness of the DVD format from the present limit of 2.1GB on disc to the full 4.4GB of storage capacity by allowing the loading thru Unionfs of an additional 2.3GB of compressed files(assuming all of Unionfs is compressed, or is it?).?? If it isn't compressed, can it be?

    Correct answers to these queries should be helpful to all users, stupid questions or no.
  • :(
    2005-03-15 08:53:08  Saiyine [Reply | View]

    I thought the new knoppix 3.8 could save the changed files! Writing them in ram is a minor enhancement.
    • Kyle Rankin photo :(
      2005-03-15 10:12:39  Kyle Rankin | O'Reilly Author [Reply | View]

      As I said in the blog entry, if you set up a persistent home directory, you can save any changes from the ramdisk to a usb drive or the like.
      • Persistant Home Directory
        2005-05-20 14:36:14  williamselden [Reply | View]

        I would like to edit files on my harddrive and can't seem to get the permissons worked out to read/write.

        If a persistant home directory is the answer, how is one set up?

        I am using the Knoppix disc.

        Bill Selden
  • 3.8 Remastering
    2005-03-14 18:28:54  AI9NL [Reply | View]

    A "bit torrent" of the CeBIT version is now downloading on my other machine. Any re-master tips peculiar to this version you'd care to pass along?

    Maybe as an online addendum to your book?

    Thanks

    Harv
  • Ubuntu Hoary LiveCD
    2005-03-14 17:32:46  jdub [Reply | View]

    Hey, did you know that the Ubuntu Hoary LiveCD provides the same functionality as UnionFS in the new Knoppix, only it uses standard, shipping components of the Linux kernel? :-)
    • Ubuntu Hoary LiveCD
      2005-10-10 05:43:14  angrykeyboarder [Reply | View]

      Apparently he didn't.... ;-)

Showing messages 1 through 13 of 13.

Return to weblogs.oreilly.com.



Weblog authors are solely responsible for the content and accuracy of their weblogs, including opinions they express, and O'Reilly Media, Inc., disclaims any and all liabililty for that content, its accuracy, and opinions it may contain.

Creative Commons License This work is licensed under a Creative Commons License.



Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com