Hello!
   I am working in an environment with an aufs root partition. The top write
   enabled layer is tmpfs, and the bottom layer is an ext2 partition located on
   flash media. There are also directories in the filesystem which reside on
   the same ext2 file system that have been mounted with mount --bind on top of
   aufs. The following should illustrate this more clearly.
   device  mountpoint  type
   [1]root.rw       /rw           tmpfs
   /dev/sda1   /ro          ext2
   root.union   /             aufs
   /dev/sda1  Â /usr/configdir  Â ext2  Â (<--  this is a mount --bind of
   /ro/usr/configdir)
   /dev/sda1   /usr/vardir      ext2  (<-- this is a mount --bind of
   /ro/usr/vardir)
   /rw is there mainly for troubleshooting purposes, it is never written to
   directly. However, there are many scripts and tasks within this system which
   make changes to /usr/configdir and /usr/vardir. There are also infrequent
   but  occasional  changes  directly within /ro. The idea is to create a
   writeable partition which can have many changes made without burning out the
   write-limited  flash  media,  and which do not persist between reboot.
   Occasionally, however, changes must be made to the system which do need to
   persist after reboot, and so we make use of the /ro, /usr/configdir and
   /usr/vardir directories. The /usr/configdir and /usr/vardir directories are
   there mainly for backwards compatibility from before we begun using aufs in
   this manner.
   Under normal operation, the ext2 filesystem is indeed mounted read-only.
   When  changes  need  to be made, a script is used which calls mount -o
   remount,rw /ro. In addition, we call mount -o remount,udba=notify /. Once
   all of the writes have been made, we then change the /ro mountpoint back to
   read-only. When we do this, we call auplink first, followed by a sync call,
   then the remount,ro call. Once we have set the ext2 back to ro, we then
   mount --remount,udba=reval /.
   The system is a modified Ubuntu 12.04 system. My latest test branch for
   working with this problem is using the kernel from Ubuntu Trusty (14.04) git
   repo. This reports its version as 3.13.0-32-generic. modinfo on the aufs
   module reports version as 3.13-20140303.
   The system that this takes place on is remote. When we make version changes
   to our system, we pull those changes using a script which runs an rsync
   directly to the /ro mount. before this firmware-upgrade script runs, it
   ensures the ext2 is mounted ro, and then runs an fsck on it. When this fsck
   runs, it almost always reports many errors. I will paste some of them into
   the bottom of this email. Even mounted ro, fsck complains about making
   changes to a running filesystem when correcting these errors. However, if we
   force it to make the changes, reboot, and then re-run the firmware-upgrade
   immediately   it  will  successfully  rsync  the  files  to  /ro.  The
   firmware-upgrade script then causes a reboot and those changes take effect.
   During my testing, I reconfigured the unit to not use aufs for its root
   partition. In order to do this, I had to mount the ext2 as rw for testing.
   When running fsck -nf /dev/sda1 while /dev/sda1 was still mounted rw, it
   would have errors. Then, I would mount -o remount,ro /dev/sda1, and run fsck
   -nf /dev/sda1. This second fsck would not show any errors. In addition, fsck
   -fy /dev/sda1 did not complain about running checks on a mounted filesystem
   anymore.
   During my testing, I also tried reformatting the ext2 partition as ext4, but
   without a journal. This did not change the results.
   I am concerned about the recurring filesystem errors which are apparently
   not being correctly handled by the system when aufs is in use. Please let me
   know  how  I can troubleshoot this further, and especially if you need
   clarification or other information.
   The errors differ from time to time, but this is one example of the error
   output:
   e2fsck 1.42 (29-Nov-2011)
   /dev/sda1 is mounted. Â
   Pass 1: Checking inodes, blocks, and sizes
   Deleted inode 229380 has zero dtime. Â Fix? yes
   Pass 2: Checking directory structure
   Pass 3: Checking directory connectivity
   /lost+found not found. Â Create? yes
   Pass 3A: Optimizing directories
   Pass 4: Checking reference counts
   Pass 5: Checking group summary information
   Block bitmap differences: Â -921603
   Fix? yes
   Free blocks count wrong for group #28 (9828, counted=9829).
   Fix? yes
   Free blocks count wrong (753498, counted=753499).
   Fix? yes
   Inode bitmap differences: Â -229380
   Fix? yes
   Free inodes count wrong for group #28 (5108, counted=5109).
   Fix? yes
   Free inodes count wrong (221502, counted=221503).
   Fix? yes
   cipa_flash: ***** FILE SYSTEM WAS MODIFIED *****
   cipa_flash: 40641/262144 files (0.1% non-contiguous), 294821/1048320 blocks
   --
   Jacob Burkamper
   CIPAFilter Development
   Email:Â  [2]jac...@cipafilter.com
   ----------------------
   CIPAFilter Beta Program
   Email: [3]b...@cipafilter.com
   Web:Â Â Â Â Â  [4]http://www.cipafilter.com

References

   1. http://root.rw/
   2. mailto:jac...@cipafilter.com
   3. mailto:b...@cipafilter.com
   4. http://www.cipafilter.com/
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

Reply via email to