Donate Share

aufs

Email Archive: aufs-users (read-only)

2006:
Jan
   
Feb
   
Mar
   
Apr
   
May
   
Jun
(1)
Jul
   
Aug
(9)
Sep
(6)
Oct
(5)
Nov
(6)
Dec
(16)
2007:
Jan
(37)
Feb
(138)
Mar
(102)
Apr
(62)
May
(31)
Jun
(92)
Jul
(71)
Aug
(16)
Sep
(103)
Oct
(76)
Nov
(50)
Dec
(47)
2008:
Jan
(56)
Feb
(58)
Mar
(100)
Apr
(101)
May
(89)
Jun
(32)
Jul
(57)
Aug
(73)
Sep
(40)
Oct
(72)
Nov
(96)
Dec
(31)
2009:
Jan
(43)
Feb
(130)
Mar
(130)
Apr
(120)
May
(68)
Jun
(31)
Jul
(63)
Aug
(39)
Sep
(30)
Oct
(48)
Nov
(26)
Dec
   
From: Yiu-Chung Lee <lee_yiu_chung@ya...> - 2008-05-08 15:09
Dear all,

I am considering using aufs for my company's embedded system. I would
like to have a read-only partition with the factory-installed firmware
(i.e. operating system with applications), and a read-write partition
(user data and all user-initiated firmware upgraded go here). By using
this configuration, I can restore the system by just formatting the
read-write partition (reset it to factory state) if anything about user
data/firmware upgrade go wrong.

In my initramfs, the read-only partition is mounted as /ro, and the
read-write partitions is mounted as /rw. Then these branches are merged
to /aufs. Then I move /ro to /aufs/.aufs/ro and /rw to /aufs/.aufs/rw.
As a last step, I move /aufs to /, and initramfs would finish its job.

That is, after booting up the system, the mount point would be:
/ - AUFS union of /.aufs/ro and /.aufs/rw
/.aufs/ro - read-only partition
/.aufs/rw - read-write partition

But now I found a problem here. I am unable to ensure clean unmount of
these partitions. Every time I reboot the system, there is always some
unclean filesystem warning, and seems replaying the journal every time
for the read-write partition (I am using ext3, and I always see there
are several deleted inodes being cleaned, and). Being an unattended
embedded system I am very concerned with it, since it is intended to be
a security product, and for security reasons remote support is often
impossible, since it would not be connected to the internet. This test
is just a new installation and test how aufs works, with very little
file IO. I am concerned if the filesystem would go wrong if there are
more file IO, since data loss is often unacceptable in our embedded system.

Is there any way that unmount the filesystem (or at least ensure the
filesystem being clean) at shutdown/reboot? I tried mounting all the
partitions read-only but seems it doesn't fix this issue.

Sorry for the long mail, but I believe that it would be better to
explain my situation clearly and throughly. Thanks in advance.

Regards,
Yiu-Chung Lee


    From: Tomas M <tomas@sl...> - 2008-05-08 15:30
    Hello,

    > In my initramfs, the read-only partition is mounted as /ro, and the
    > read-write partitions is mounted as /rw. Then these branches are merged
    > to /aufs. Then I move /ro to /aufs/.aufs/ro and /rw to /aufs/.aufs/rw.
    > As a last step, I move /aufs to /, and initramfs would finish its job.

    How do you 'move' them?

    > That is, after booting up the system, the mount point would be:
    > / - AUFS union of /.aufs/ro and /.aufs/rw
    > /.aufs/ro - read-only partition
    > /.aufs/rw - read-write partition

    To be honest, I do not know how to setup that. But I would do it this way:
    Mount read-only partition to /ro, then read-write to /rw,
    and finally create /aufs. When aufs is ready, create /aufs/.aufs/
    directory and use 'switch_root' to switch current root into /aufs/.aufs/

    So at the end, the entire content of previous root (initramfs?) will be visible in /.aufs/

    When you reboot, you have to
    1) end all processes
    2) close all files
    3) switch_root back
    4) umount /aufs, /ro and /rw
    5) shutdown

    Tomas M
    slax.org
    linux-live.org

    From: 李耀宗 <lee_yiu_chung@ya...> - 2008-05-08 15:44
    Dear Tomas,

    I moved the mount point by mount --move, as instructed in
    https://help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash (found in
    http://aufs.sourceforge.net/Tips, with some minor modifications, and I
    am testing in Debian.)

    Maybe I need to considering your way, but I would have to hand-make the
    initramfs, since this method appears to be incompatible to Debian's
    mkinitramfs utilities. (Debian built initramfs boot code would clear all
    the contents of initramfs and overmount /root to /.)

    Yiu-Chung Lee

    Tomas M 提到:
    > Hello,
    >
    >> In my initramfs, the read-only partition is mounted as /ro, and the
    >> read-write partitions is mounted as /rw. Then these branches are merged
    >> to /aufs. Then I move /ro to /aufs/.aufs/ro and /rw to /aufs/.aufs/rw.
    >> As a last step, I move /aufs to /, and initramfs would finish its job.
    >
    > How do you 'move' them?
    >
    >> That is, after booting up the system, the mount point would be:
    >> / - AUFS union of /.aufs/ro and /.aufs/rw
    >> /.aufs/ro - read-only partition
    >> /.aufs/rw - read-write partition
    >
    > To be honest, I do not know how to setup that. But I would do it this way:
    > Mount read-only partition to /ro, then read-write to /rw,
    > and finally create /aufs. When aufs is ready, create /aufs/.aufs/
    > directory and use 'switch_root' to switch current root into /aufs/.aufs/
    >
    > So at the end, the entire content of previous root (initramfs?) will be visible in /.aufs/
    >
    > When you reboot, you have to
    > 1) end all processes
    > 2) close all files
    > 3) switch_root back
    > 4) umount /aufs, /ro and /rw
    > 5) shutdown
    >
    > Tomas M
    > slax.org
    > linux-live.org
    >
    >

    From: Luis Carlos Erpen de Bona <bona@c3...> - 2008-05-08 17:02
    We already do it in remote boot schema. Here you have our
    script (but there are some strings in portuguese, sorry)

    Note that we don't use initrd, we just change init parameter
    to use the script bellow.

    Bona

    -------------------
    # Monta /proc : Precisamos HOSTNAME
    mount -n -t proc -onodev,noexec,nosuid "proc" /proc

    # SERVIDOR
    NFSSERVER=10.254.0.8

    HOSTNAME=$(cat /proc/sys/kernel/hostname)

    # EXPORT (Partes do Unionfs)
    EXPORT_ROOT=/export/mainroot


    RW=/tftpboot/aufs/rw
    NEWROOT=/tftpboot/newroot
    MAINROOT=/tftpboot/mainroot

    MOUNT_OPTIONS="proto=tcp,nolock,wsize=8192,rsize=8192"

    portmap

    mount -n -o rw,noexec,nosuid,nodev,mode=0755 -t tmpfs tmpfs $RW
    mount -n -o $MOUNT_OPTIONS,ro -t nfs $NFSSERVER:$EXPORT_ROOT $MAINROOT
    pkill portmap

    mount -n -t aufs -o xino=/xino/.aufs.xino,noplink,nowarn_perm,br:$RW=rw:$MAINROOT=ro aufs $NEWROOT
    mount -n --move /proc $NEWROOT/proc
    mount -n --move /xino $NEWROOT/xino

    cd $NEWROOT
    pivot_root . mnt

    On Thu, May 08, 2008 at 05:25:26PM +0200, Tomas M wrote:
    > Hello,
    >
    > > In my initramfs, the read-only partition is mounted as /ro, and the
    > > read-write partitions is mounted as /rw. Then these branches are merged
    > > to /aufs. Then I move /ro to /aufs/.aufs/ro and /rw to /aufs/.aufs/rw.
    > > As a last step, I move /aufs to /, and initramfs would finish its job.
    >
    > How do you 'move' them?
    >
    > > That is, after booting up the system, the mount point would be:
    > > / - AUFS union of /.aufs/ro and /.aufs/rw
    > > /.aufs/ro - read-only partition
    > > /.aufs/rw - read-write partition
    >
    > To be honest, I do not know how to setup that. But I would do it this way:
    > Mount read-only partition to /ro, then read-write to /rw,
    > and finally create /aufs. When aufs is ready, create /aufs/.aufs/
    > directory and use 'switch_root' to switch current root into /aufs/.aufs/
    >
    > So at the end, the entire content of previous root (initramfs?) will be visible in /.aufs/
    >
    > When you reboot, you have to
    > 1) end all processes
    > 2) close all files
    > 3) switch_root back
    > 4) umount /aufs, /ro and /rw
    > 5) shutdown
    >
    > Tomas M
    > slax.org
    > linux-live.org
    >
    > -------------------------------------------------------------------------
    > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
    > Don't miss this year's exciting event. There's still time to save $100.
    > Use priority code J8TL2D2.
    > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

    From: <sfjro@us...> - 2008-05-09 01:43
    Hello Yiu-Chung Lee,

    Yiu-Chung Lee:
    > Is there any way that unmount the filesystem (or at least ensure the
    > filesystem being clean) at shutdown/reboot? I tried mounting all the
    > partitions read-only but seems it doesn't fix this issue.

    How about this?

    (from the aufs manual)
    ----------------------------------------------------------------------
    When your aufs is the root directory of your system, and your system
    tells you some of the filesystem were not unmounted cleanly, try these
    procedure when you shutdown your system.
    .nf
    # mount -no remount,ro /
    # for i in $writable_branches
    # do mount -no remount,ro $i
    # done
    .fi
    If your xino file is on a hard drive, you also need to specify
    `noxino' option or `xino=/your/tmpfs/xino' at remounting root
    directory.
    ----------------------------------------------------------------------


    Junjiro Okajima

    From: Yiu-Chung Lee <lee_yiu_chung@ya...> - 2008-05-09 11:01
    Dear all,

    I just found out the problem. Somehow the remount read-only command for
    /.aufs/rw is lost in the shutdown sequence, and I never notice it. Also
    I have applied the noxino option. It now works, and I will have more
    test later.

    Regards,
    Yiu-Chung Lee

    sfjro@us... 提到:
    > Hello Yiu-Chung Lee,
    >
    > Yiu-Chung Lee:
    >> Is there any way that unmount the filesystem (or at least ensure the
    >> filesystem being clean) at shutdown/reboot? I tried mounting all the
    >> partitions read-only but seems it doesn't fix this issue.
    >
    > How about this?
    >
    > (from the aufs manual)
    > ----------------------------------------------------------------------
    > When your aufs is the root directory of your system, and your system
    > tells you some of the filesystem were not unmounted cleanly, try these
    > procedure when you shutdown your system.
    > .nf
    > # mount -no remount,ro /
    > # for i in $writable_branches
    > # do mount -no remount,ro $i
    > # done
    > .fi
    > If your xino file is on a hard drive, you also need to specify
    > `noxino' option or `xino=/your/tmpfs/xino' at remounting root
    > directory.
    > ----------------------------------------------------------------------
    >
    >
    > Junjiro Okajima
    >
    >