Mr. Junjiro R. Okajima,

   please read the second section of this letter first.

   1. Kernel messages

   After our discussion from yesterday, I looked again on the script
   journal-commit. In my last letter I ask you the following questions:

   a) The script journal-commit gets its info about the file system
      type from /proc/mounts. Is that right?

   b) The script runs the following mount command only if it has found
      the file system type ext3 in /proc/mounts. Is that right?

      As example:
      mount -o remount,commit=0 /tmp/jailcache.ro.var

   c) If the scripts finds a file system type like aufs or tmpfs in
      /proc/mounts it doesn't call the mount command. Is that right?

   For that reason, I looked again into the file /proc/mounts and
   executed the mount command from the command line. I run mount in
   the chroot environment. I used only lines from /proc/mounts that
   contains the FSTYPE ext3 and used the mount from this line,
   because the script journal-commit does the same:

   $> sudo chroot /tmp/jail /bin/login

   chroot_$> sudo mount -o remount,commit=0 /
   mount: / not mounted already, or bad option

   kernel message from aufs module:
   [ 5994.037100] aufs au_opts_parse:1039:mount[5124]: \
                       unknown option errors=remount-ro

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /home
   mount: /home not mounted already, or bad option

   kernel message from aufs module:
   [ 6087.176869] aufs au_opts_parse:1039:mount[5142]: \
                       unknown option commit=0
   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /opt
   mount: /opt not mounted already, or bad option

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /srv
   mount: /srv not mounted already, or bad option

   kernel message from aufs module:
   [ 6275.775855] aufs au_opts_parse:1039:mount[5177]: \
                       unknown option commit=0

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp
   mount: /tmp not mounted already, or bad option

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /usr
   mount: /usr not mounted already, or bad option

   kernel message from aufs module:
   [ 6399.863304] aufs au_opts_parse:1039:mount[5212]: \
                       unknown option commit=0

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /usr/local
   mount: /usr/local not mounted already, or bad option

   kernel message from aufs module:
   [ 6427.924941] aufs au_opts_parse:1039:mount[5229]: \
                       unknown option commit=0

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /var
   mount: /var not mounted already, or bad option

   kernel message from aufs module:
   [ 6506.867357] aufs au_opts_parse:1039:mount[5246]: \
                       unknown option commit=0

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp/jailcache.ro.root
   mount: mount point /tmp/jailcache.ro.root does not exist

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp/jailcache.ro.var
   mount: mount point /tmp/jailcache.ro.var does not exist

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp/jailcache.ro.usr
   mount: mount point /tmp/jailcache.ro.usr does not exist

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp/jailcache.ro.usrlocal
   mount: mount point /tmp/jailcache.ro.usrlocal does not exist

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp/jailcache.ro.home
   mount: mount point /tmp/jailcache.ro.home does not exist

   kernel message from aufs module:
   no output

   --------------------------------------------------

   chroot_$> sudo mount -o remount,commit=0 /tmp/jailcache.ro.srv
   mount: mount point /tmp/jailcache.ro.srv does not exist

   kernel message from aufs module:
   no output

   The question is, is the above message from the aufs module via the
   kernel only a warning or is this message a hint for a bigger
   problem? A problem that could be harmful.


   The following lins shows how I created the branches and unions for
   the above used chroot environment:

   # The code of the script bldchraufs
   #
   # The following lines contains the code of the script:

   # Stop script on error.
   set -e

   # Create the chroot directory /tmp/jail.
   mkdir -p /tmp/jail

   # Build the AUFS union rootonaufs based on the bond of /.
   # Mount rootonaufs in /tmp/jail/.
   mkdir -p /tmp/jailcache.rw.root /tmp/jailcache.ro.root
   mount -o bind / /tmp/jailcache.ro.root
   mount -t aufs -o br:/tmp/jailcache.rw.root:/tmp/jailcache.ro.root \
         rootonaufs /tmp/jail/

   # Build the AUFS union varonaufs based on the bond of /var.
   # Mount varonaufs in /tmp/jail/var.
   mkdir -p /tmp/jailcache.rw.var /tmp/jailcache.ro.var
   mount -o bind /var /tmp/jailcache.ro.var
   mount -t aufs -o br:/tmp/jailcache.rw.var:/tmp/jailcache.ro.var \
         varonaufs /tmp/jail/var

   # Build the AUFS union usronaufs based on the bond of /usr.
   # Mount usronaufs in /tmp/jail/usr.
   mkdir -p /tmp/jailcache.rw.usr /tmp/jailcache.ro.usr
   mount -o bind /usr /tmp/jailcache.ro.usr
   mount -t aufs -o br:/tmp/jailcache.rw.usr:/tmp/jailcache.ro.usr \
         usronaufs /tmp/jail/usr

   # Build the AUFS union usrlocalonaufs based on the bond of
   # /usr/local.
   # Mount usrlocalonaufs in /tmp/jail/usr/local.
   mkdir -p /tmp/jailcache.rw.usrlocal /tmp/jailcache.ro.usrlocal
   chmod g+ws /tmp/jailcache.rw.usrlocal
   chown 0:50 /tmp/jailcache.rw.usrlocal
   chmod g+ws /tmp/jailcache.ro.usrlocal
   chown 0:50 /tmp/jailcache.ro.usrlocal
   chmod g+ws /tmp/jail/usr/local
   chown 0:50 /tmp/jail/usr/local
   mount -o bind /usr/local /tmp/jailcache.ro.usrlocal
   mount -t aufs \
         -o br:/tmp/jailcache.rw.usrlocal:/tmp/jailcache.ro.usrlocal \
         usrlocalonaufs /tmp/jail/usr/local

   # Build the AUFS union bootonaufs based on the bond of /boot.
   # Mount bootonaufs in /tmp/jail/boot.
   mkdir -p /tmp/jailcache.rw.boot /tmp/jailcache.ro.boot
   mount -o bind /boot /tmp/jailcache.ro.boot
   mount -t aufs -o br:/tmp/jailcache.rw.boot:/tmp/jailcache.ro.boot \
         bootonaufs /tmp/jail/boot

   # Build the AUFS union homeonaufs based on the bond of /home.
   # Mount homeonaufs in /tmp/jail/home.
   mkdir -p /tmp/jailcache.rw.home /tmp/jailcache.ro.home
   chown 1000:1000 /tmp/jailcache.rw.home
   chown 1000:1000 /tmp/jailcache.ro.home
   chown 1000:1000 /tmp/jail/home
   mount -o bind /home /tmp/jailcache.ro.home
   mount -t aufs -o br:/tmp/jailcache.rw.home:/tmp/jailcache.ro.home \
         homeonaufs /tmp/jail/home

   # Build the AUFS union srvonaufs based on the bond of /srv.
   # Mount srvonaufs in /tmp/jail/srv.
   mkdir -p /tmp/jailcache.rw.srv /tmp/jailcache.ro.srv
   mount -o bind /srv /tmp/jailcache.ro.srv
   mount -t aufs -o br:/tmp/jailcache.rw.srv:/tmp/jailcache.ro.srv \
         srvonaufs /tmp/jail/srv

   # Mount proc in /tmp/jail/proc.
   mount -t proc -o rw,noexec,nosuid,nodev proconaufs /tmp/jail/proc

   # Mount sysfs in /tmp/jail/sys.
   mount -t sysfs -o rw,noexec,nosuid,nodev sysonaufs /tmp/jail/sys

   # Bind /var/lib/nfs/rpc_pipefs to /tmp/jail/var/lib/nfs/rpc_pipefs.
   mount -o bind /var/lib/nfs/rpc_pipefs \
                 /tmp/jail/var/lib/nfs/rpc_pipefs

   # Bind /sys/fs/fuse/connections to
   # /tmp/jail/sys/fs/fuse/connections.
   mount -o bind /sys/fs/fuse/connections \
                 /tmp/jail/sys/fs/fuse/connections

   # Bind /proc/sys/fs/binfmt_misc to
   # /tmp/jail/proc/sys/fs/binfmt_misc.
   mount -o bind /proc/sys/fs/binfmt_misc \
                 /tmp/jail/proc/sys/fs/binfmt_misc

   # Bind /dev to /tmp/jail/dev.
   mount -o bind /dev /tmp/jail/dev

   # Bind /dev/pts to /tmp/jail/dev/pts.
   mount -o bind /dev/pts /tmp/jail/dev/pts

   # Bind /run to /tmp/jail/run.
   mount -o bind /run /tmp/jail/run

   # Bind /dev/shm to /tmp/jail/run/shm.
   mount -o bind /run/shm /tmp/jail/run/shm


   2. Conclusion

   As example I use the directory /var in the chroot environment. In
   the chroot environment /var has the file system type aufs. Outside
   the chroot environment /var has the file system type ext3 and is
   also known with file system type aufs under the device varnonaufs.

   The script journal-commit that runs in the chroot environment gets
   its info about /var from the file /proc/mounts. Because the script
   only sees lines with the file systems types ext3 or ext4 it thinks
   that /var in the chroot environment has the file system type ext3.
   For that reason the script calls mount with the option commit. But
   in the chroot environment /var has the file system type aufs and
   AUFS doesn't know anything about the option commit. As consequence
   the aufs module generates a kernel message.

   I hope, I have found the correct explanation.

   Regards,
   Robert Wotzlaw


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

Reply via email to