[EMAIL PROTECTED] wrote: > Hey Michael, > > thanks for your quick reply. > >> Hi Philipp, >> >> Yes, something like that should work - it's more or less how most live >> CDs do it (though I can't speak for the details, I haven't used this >> method for a while - I am now using klibc instead of busybox and >> mounting aufs later). >> >> If you need example scripts you could look at linux-live, for example. >> >> As to the active mounts, so long as you don't want to manipulate them >> afterwards, that seems to be no big problem. > > Yes I will have to manipulate the mountpoints I guess. > It is possible that I'll have to unmount aufs, which will > be "one layer below". > Do you/anybody see a way how this could be achieved? >
I think here you need to consider very carefully what you want to achieve. Your situation as I understand it is that you intend to make the aufs your root filesystem (that's what the switch_root does). As far as I know (which, I admit, is not very far!) there is no way back to the initramfs root. But why would you want to get out of the aufs? I did consider several variations on the theme while working on a live CD construction kit (larch) for Archlinux. The current version doesn't use an aufs root but uses separate aufs mounts for all the root directories (/bin, /etc, /usr, and so on). It's quite a bit more complicated than the basic approach, using multistage system initialization and shutdown, but it does allow the aufs mounts to be unmounted in a fairly orderly manner at shutdown. This allows me to add sessions to the boot CD/DVD at shutdown, but - especially in view of the fact that many computers can't boot from multisession CD - I'm not completely convinced that the extra complexity is justified. There may of course be simpler ways to achieve this sort of thing. I, too, would be glad to hear of them! >> Philipp Wehrheim wrote: >>> Hey List, >>> >>> >>> I'm trying to use aufs in combination with initramfs and a mtd-flash >>> device but I can't really figure out how to do it. >>> >>> What I want is: >>> >>> - boot the kernel that starts the initramfs. >>> - the initramfs init checks if it can find a partition on the hd via >>> findfs >>> - and if it finds the partition mounts a squashfs(ro) and the hd >>> partition (rw) to /newroot >>> mount <hd> /aufs >>> cat <mtd> > /squashfs.img >>> mount -n /squashfs.img /squash >>> mount -n -t aufs -o br=/aufs:/squash none /newroot >>> >>> - if the partition is not found it mounts some tmpfs and the squashfs >>> mount -n -t tmpfs /aufs >>> mount -n <mtd> /squash >>> mount -n -t aufs -o br=/aufs:/squash none /newroot >>> >>> - in the end init calls >>> exec switch_root /newroot /sbin/init >>> >>> Can this work? >>> Because there are some active mount when I call switchroot? >>> >>> Can anybody share some experience please. >>> >>> -- >>> flip >>> ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/