Hi,

I have a problem with aufs used as root of the filesystem. I know
that there are similar posts. I have read them, but since I have the
latest version of aufs and a fresh kernel I wonder what the problem
might be...I have f.e. not tried to play with ?plinks? yet, because I
don't understand the concept.
The info that is stated as being needed, I put on pastebin
(because of the kernel config) :
http://pastebin.com/1CC6h5at

I am using a initramfs that creates a aufs with two branches. A upper
branch is tmpfs (rw) and the lower branch is flash memory with a gentoo
root (ext3+ro). Here is the initramfs init script:


- - - - - - - -
#!/bin/busybox sh

mount -t proc none /proc
mount -t sysfs none /sys
mount -t tmpfs mdev /dev
sleep 10
echo 'Mounting root filesystem readonly'
mdev -s
echo '/bin/mdev' > /proc/sys/kernel/hotplug
mount -v -o rw /dev/sda1 /ro_root
mount -t tmpfs none /rw_root
echo 'Mounting tmpfs and root in a aufs'
mount -t aufs -o br:/rw_root=rw:/ro_root=ro none /aufs_root
echo 'Moving branches to the future chroot directory'
mount --move /ro_root /aufs_root/mnt/ro_root
mount --move /rw_root /aufs_root/mnt/rw_root

echo 'Unmounting all extra filesystems'
umount /proc
umount /sys
umount /dev
echo 'Doing a switch_root into /aufs_root'
exec switch_root /aufs_root /sbin/init <dev/console >dev/console 2>&1
- - - - - - - -


This runs finally flawless, but I have one issue. From time to time I
need direct access to the (--moved) readonly flash, to perform various
actions (f.e. if memory is running low I have to flush the tmpfs to the
flash-disk) (or to make changes permanent - like installed packages).

Aubrsync, I cannot use because it reports that / is busy.

Thus, I use this script to move the data (note that the errors occur
whether or not I remove the copied data from the tmpfs-branch after the
moving):


- - - - - - - -
#!/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}

mount -o remount,ro ${LOWER_BRANCH}
mount -o remount,udba=reval /
- - - - - - - -


I've read other posts here and so I guessed that it has to work this
way, especially since the remount with udba=notify - which I thought
would be failsafe?!

If I then check the filesystem with:

fsck -nf /dev/sda1

... I get:


- - - - - - - -
sck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
Warning!  /dev/sda1 is mounted.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 346591 has zero dtime.  Fix? no

Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 346594 was part of the orphaned inode list.  IGNORED.
Inode 346597 was part of the orphaned inode list.  IGNORED.
Inode 346598 was part of the orphaned inode list.  IGNORED.
Inode 346600 was part of the orphaned inode list.  IGNORED.
Inode 346601 was part of the orphaned inode list.  IGNORED.
Inode 346602 was part of the orphaned inode list.  IGNORED.
Inode 346603 was part of the orphaned inode list.  IGNORED.
Inode 346617 was part of the orphaned inode list.  IGNORED.
Inode 346618 was part of the orphaned inode list.  IGNORED.
Inode 346629 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(1431566--1431694) -(1431705--1432067)
-(1432141--1432657) -(1433735--1433738) Fix? no

Inode bitmap differences:  -346591 -346594 -(346597--346598)
-(346600--346603) -(346617--346618) -346629 Fix? no


nibbler: ********** WARNING: Filesystem still has errors **********

nibbler: 151589/394352 files (0.9% non-contiguous), 598663/1574362
blocks
- - - - - - - -


Thus the data is written to /mnt/ro_root and erros get corrected
automatically at the next reboot.
But still in the same session I cannot remount /mnt/ro_root because
is is declared to still has filesystem errors.

This is a big post, hopefully you understand it and hopefully I have
not made any big mistakes.
If you have something you can point me to, I
would greatly appreciate it.


Have a nice day,

Marcus R.

------------------------------------------------------------------------------
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

Reply via email to