Hello Matthew,
Matthew Harrell:
> Anyway what I am currenly doing in the initramfs is the following
>
> mount /dev/sd /root
> load aufs if available
> mount -o move /root /root.ro
> mount -t tmpfs root.rw /root.rw
> mount -t aufs -o "dirs=/root.rw=rw:/root.ro=ro" root.union /root
> mount -o bind /root.ro /root/root/ro
> mount -o bind /root.rw /root/root/rw
:::
> The problem I'm wondering about is that the underlying filesystem is
> still mounted readwrite so there's still a small chance of filesystem
> corruption. Is it possible to mount that layer readonly but remount it
> while the system is running if I need to update any files on the system?
> I think the answer is no and that I'll just have to reboot the system if
> I want to get that effect but I want to check
I'd suggest you to,
compie aufs withe CONFIG_AUFS_HINOTIFY enabled.
mount -o ro /dev/sd /root.ro
mount -t tmpfs tmpfs /root.rw
mount -t aufs -o br:/root.rw:/root.ro none /root
mount -o move /root.ro /root/root/ro
mount -o move /root.rw /root/root/rw
swtich root to /root...
When you want to change /root.ro directly then,
mount -o remount,udba=inotify /
mount -o remount,rw /root/root/ro
modify /root/root/ro
mount -o remount,ro /root/root/ro
mount -o remount,udba=reval /
But if there is the same named file in /root/root/rw already, you will
not see the modified file in /root/root/ro.
> Also is there a good place to get other documentation that explains the
> concepts of the whiteouts? I'm sure I'm missing some interesting effects
> when I read the man page simply because I don't know some of the concepts
I have added some documents describing aufs internals. You can get them
by GIT. see http://aufs.sf.net/README.aufs2.
If they are not enough for you still, some unionfs documents may be
better since they are written by native English speakers.
J. R. Okajima
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com