We already do it in remote boot schema. Here you have our
script (but there are some strings in portuguese, sorry)

Note that we don't use initrd, we just change init parameter
to use the script bellow.

Bona

-------------------
# Monta /proc : Precisamos HOSTNAME
mount -n -t proc -onodev,noexec,nosuid "proc" /proc

# SERVIDOR
NFSSERVER=10.254.0.8

HOSTNAME=$(cat /proc/sys/kernel/hostname)

# EXPORT (Partes do Unionfs)
EXPORT_ROOT=/export/mainroot


RW=/tftpboot/aufs/rw
NEWROOT=/tftpboot/newroot
MAINROOT=/tftpboot/mainroot

MOUNT_OPTIONS="proto=tcp,nolock,wsize=8192,rsize=8192"

portmap

mount -n -o rw,noexec,nosuid,nodev,mode=0755 -t tmpfs tmpfs $RW
mount -n -o $MOUNT_OPTIONS,ro -t nfs $NFSSERVER:$EXPORT_ROOT $MAINROOT
pkill portmap

mount -n -t aufs -o 
xino=/xino/.aufs.xino,noplink,nowarn_perm,br:$RW=rw:$MAINROOT=ro aufs $NEWROOT
mount -n --move /proc $NEWROOT/proc
mount -n --move /xino $NEWROOT/xino

cd $NEWROOT
pivot_root . mnt

On Thu, May 08, 2008 at 05:25:26PM +0200, Tomas M wrote:
> Hello,
> 
> > In my initramfs, the read-only partition is mounted as /ro, and the 
> > read-write partitions is mounted as /rw. Then these branches are merged 
> > to /aufs. Then I move /ro to /aufs/.aufs/ro and /rw to /aufs/.aufs/rw. 
> > As a last step, I move /aufs to /, and initramfs would finish its job.
> 
> How do you 'move' them?
> 
> > That is, after booting up the system, the mount point would be:
> > / - AUFS union of /.aufs/ro and /.aufs/rw
> > /.aufs/ro - read-only partition
> > /.aufs/rw - read-write partition
> 
> To be honest, I do not know how to setup that. But I would do it this way:
> Mount read-only partition to /ro, then read-write to /rw,
> and finally create /aufs. When aufs is ready, create /aufs/.aufs/
> directory and use 'switch_root' to switch current root into /aufs/.aufs/
> 
> So at the end, the entire content of previous root (initramfs?) will be 
> visible in /.aufs/
> 
> When you reboot, you have to
> 1) end all processes
> 2) close all files
> 3) switch_root back
> 4) umount /aufs, /ro and /rw
> 5) shutdown
> 
> Tomas M
> slax.org
> linux-live.org
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Reply via email to