Gentoo Archives: gentoo-catalyst

From: Chris Gianelloni <wolf31o2@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: Unionfs (was: Re: [gentoo-catalyst] Keeping a test environment using catalyst)
Date: Wed, 25 May 2005 17:33:39
Message-Id: 1117042404.14290.170.camel@cgianelloni.nuvox.net
In Reply to: Unionfs (was: Re: [gentoo-catalyst] Keeping a test environment using catalyst) by Paul Smith
1 On Thu, 2005-05-19 at 11:37 -0400, Paul Smith wrote:
2 > What they do, basically, is this (I've stripped out a lot of detail of
3 > course):
4 >
5 > mkdir /ramdisk /UNIONFS
6 >
7 > mount -o tmpfs /ramdisk /ramdisk
8 > mount -o unionfs -o dirs=/ramdisk=rw:/cdrom=ro /UNIONFS /UNIONFS
9 >
10 > Now they have a unionfs filesystem at /UNIONFS, which has at the top a
11 > ramdisk (really located in /ramdisk) and underneath that the cdrom
12 > contents (really located in /cdrom).
13 >
14 > They then proceed to, essentially, make everything in / be a symlink
15 > pointing into /UNIONFS (obviously there are various complexities
16 > involved here).
17 >
18 > Then they just exec the real init.
19 >
20 > I don't know why they don't use pivot_root; that seems cleaner to me.
21 > But, maybe something about unionfs doesn't allow pivot_root to work.
22 > I'll keep poking at this.
23
24 I'm just curious why this needs to be done within the initrd, at all. I
25 guess it could be, but I could also see it working outside the initrd.
26
27 Anyway, if we were to do it, we would allow for mounting a USB key or
28 other such device. Most likely, it would be via a unionfs=/dev/$blah
29 option, that would mount that device, along with the CD, as a unionfs.
30 One thing I probably would *not* do is make the entire CD a unionfs, as
31 I just think it would be a waste of energy and would make
32 troubleshooting much harder. Things like /var, /etc, /root, and /home
33 would definitely be cool to not only be writable, but also survivable
34 from a reboot.
35
36 > I _thought_ that Knoppix allowed you to make the top of the unionfs an
37 > actual device, like a USB keydisk or something, instead of a ramdisk,
38 > but offhand I don't see anything in their initrd that does anything like
39 > that: it seems hardcoded to go to a ramdisk as far as I can tell. I'll
40 > make sure of this; to me that's the real benefit of unionfs: to use it
41 > to customize/personalize a generic livecd, and make those customizations
42 > persistent. If you don't have this I'm not sure what the advantage of
43 > unionfs is over the more traditional methods, like Gentoo's. I guess
44 > the only real advantage is that the entire disk is modifiable rather
45 > than just specific areas.
46
47 Having the entire disk modifiable, in many cases, isn't a good idea.
48
49 I would prefer that only certain parts be writable. After all, who
50 really needs to write to /usr or /bin on a CD?
51
52 --
53 Chris Gianelloni
54 Release Engineering - Strategic Lead/QA Manager
55 Games - Developer
56 Gentoo Linux

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies