sf...@users.sourceforge.net wrote: > > My English and brain are broken, sorry. Hehehe ;) I am also not a native english speaker. But I think we'll work it out. Nevertheless, you are a wizard :D
> > Here is my guess. > > - syslogd opens these log files for write. > > - in the beginning, files exist on the lower ext3 only. no on the > > upper tmpfs. > > - aufs opens files on the lower ext3. > > - when syslogd writes to them first time, aufs copies-up them to the > > upper tmpfs and closes the one on the lower ext3. > > while the file object (a kernel object in memory) for ext3 is > > released, the inode object for ext3 is still referenced. It means > > the ext3 inode still exist on memory. > > rsync copies the file. the target file is removed but ext3 doesn't > release the resources for the file since the inode is still referenced > and alive. Wow. That really bends my brain. You say that the target file is removed at copying. So this is the reason why the inode of the original filename gets changed?! Is it neccessary that the target file is removed? Why not instead overwrite the file - so the inode gets conserved? If I do the same on a pure ext3 system, the inode number of the file is not being changed if I copy new content in it. It is just the case if I do some kind of copy-on-write. > And these removed but still alive files may be related to the ext3's > orphaned inode list. These inodes will be freed and ext3 resources for > them will be freed too when you unmount ext3. But when you unmount it, I can't unmount it. It just gets remounted. > ext3 is already set to readonly, right? At which part of the process? Do you mean right after the rsync command? However, below is the script I am using. > > If this option is correct, it is worth to try remounting ext3 > > writable in your shutdown script. But it is just my guess. This script is not neccessarily called at shutdown. I call it at random times. - - - - - - - - #!/bin/bash UPPER_BRANCH='/mnt/rw_root/' LOWER_BRANCH='/mnt/ro_root/' mount -o remount,udba=notify / mount -o remount,rw ${LOWER_BRANCH} case $UPPER_BRANCH in */) ;; *) UPPER_BRANCH=$(echo ${UPPER_BRANCH} | sed 's/\(.*\)/\1\//') ;; esac rsync --exclude=".wh.*" --exclude=lost+found -vaHSx --devices --specials ${UPPER_BRANCH} ${LOWER_BRANCH} #find . -name ".wh.*" -and -not -name ".wh..wh.*" | sed 's/^\.\//${LOWER_BRANCH}\//' | sed 's/\/\.wh\./\//' | /usr/bin/xargs -d "\n" rm -i sleep 1 mount -o remount,udba=reval / mount -o remount,ro ${LOWER_BRANCH} - - - - - - - - - ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev