Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: aufs root filesystem

  1. #21
    Join Date
    Nov 2006
    Beans
    28

    Re: aufs root filesystem

    Quote Originally Posted by TimSylvester View Post
    Yes, that did it. Thanks!

    For the record, I added "rootflags=barrier=0" to the kernel command line. ("nobarrier" seems to be the XFS equivalent). Next step is to update grub2 so it happens automatically...
    I'm having the same issue: remountrw appears to "work" although no changes are committed after a reboot.

    cat /proc/mounts (before remountrw):
    Code:
    rootfs / rootfs rw 0 0
    none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
    none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    udev /dev tmpfs rw,relatime,mode=755 0 0
    /dev/disk/by-uuid/2f4daaaa-ec96-426c-be68-f4bb6bfe4166 /ro ext4 ro,relatime,barrier=0,data=ordered 0 0
    none /sys/kernel/security securityfs rw,relatime 0 0
    aufs-tmpfs /rw tmpfs rw,relatime 0 0
    aufs / aufs rw,relatime,si=82ce0764d1af8a79 0 0
    none /sys/fs/fuse/connections fusectl rw,relatime 0 0
    none /sys/kernel/debug debugfs rw,relatime 0 0
    none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
    tmpfs /tmp tmpfs rw,relatime 0 0
    none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0
    none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0
    none /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
    tmpfs /var/log tmpfs rw,relatime 0 0
    tmpfs /var/tmp tmpfs rw,relatime 0 0
    tmpfs /var/lib/dhcp3 tmpfs rw,relatime 0 0
    binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
    gvfs-fuse-daemon /home/cmhaadmin/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
    Here's what it looks like after running remountrw:

    Code:
    rootfs / rootfs rw 0 0
    none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
    none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    udev /dev tmpfs rw,relatime,mode=755 0 0
    /dev/disk/by-uuid/2f4daaaa-ec96-426c-be68-f4bb6bfe4166 /ro ext4 rw,relatime,barrier=0,data=ordered 0 0
    none /sys/kernel/security securityfs rw,relatime 0 0
    aufs-tmpfs /rw tmpfs rw,relatime 0 0
    aufs / aufs rw,relatime,si=82ce0764d1af8a79 0 0
    none /sys/fs/fuse/connections fusectl rw,relatime 0 0
    none /sys/kernel/debug debugfs rw,relatime 0 0
    none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
    tmpfs /tmp tmpfs rw,relatime 0 0
    none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0
    none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0
    none /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
    tmpfs /var/log tmpfs rw,relatime 0 0
    tmpfs /var/tmp tmpfs rw,relatime 0 0
    tmpfs /var/lib/dhcp3 tmpfs rw,relatime 0 0
    binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
    gvfs-fuse-daemon /home/cmhaadmin/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
    As you can see, the rw flag is set after remounting, but making changes doesn't commit (I tried 'touch foobar' in my sudo user's home directory, and then running remountro and rebooting).

    My grub.cfg has been edited manually (that was another adventure altogether) for now, will fix once I have this working.

    Here's my grub.cfg:

    Code:
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #
    
    ### BEGIN /etc/grub.d/00_header ###
    if [ -s /boot/grub/grubenv ]; then
      have_grubenv=true
      load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
      saved_entry=${prev_saved_entry}
      save_env saved_entry
      prev_saved_entry=
      save_env prev_saved_entry
    fi
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set 2f4daaaa-ec96-426c-be68-f4bb6bfe4166
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      insmod gfxterm
      insmod vbe
      if terminal_output gfxterm ; then true ; else
        # For backward compatibility with versions of terminal.mod that don't
        # understand terminal_output
        terminal gfxterm
      fi
    fi
    if [ ${recordfail} = 1 ]; then
      set timeout=-1
    else
      set timeout=10
    fi
    ### END /etc/grub.d/00_header ###
    
    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/white
    ### END /etc/grub.d/05_debian_theme ###
    
    
    
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    
    # aufs read-only grub menu items
    menuentry "Ubuntu, Linux 2.6.31-20-generic READ-ONLY" {
            recordfail=1
            if [ -n ${have_grubenv} ]; then save_env recordfail; fi
            set quiet=1
            insmod ext2
            set root=(hd0,1)
            search --no-floppy --fs-uuid --set 2f4daaaa-ec96-426c-be68-f4bb6bfe4166
            linux   /boot/vmlinuz-2.6.31-20-generic root=UUID=2f4daaaa-ec96-426c-be68-f4bb6bfe4166 ro quiet splash aufs=tmpfs rootflags=barrier=0
            initrd  /boot/initrd.img-2.6.31-20-generic
    }
    
    menuentry "Ubuntu, Linux 2.6.31-20-generic WRITEABLE" {
            recordfail=1
            if [ -n ${have_grubenv} ]; then save_env recordfail; fi
            set quiet=1
            insmod ext2
            set root=(hd0,1)
            search --no-floppy --fs-uuid --set 2f4daaaa-ec96-426c-be68-f4bb6bfe4166
            linux   /boot/vmlinuz-2.6.31-20-generic root=UUID=2f4daaaa-ec96-426c-be68-f4bb6bfe4166 ro quiet splash
            initrd  /boot/initrd.img-2.6.31-20-generic
    }
    
    
    menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
            recordfail=1
            if [ -n ${have_grubenv} ]; then save_env recordfail; fi
            insmod ext2
            set root=(hd0,1)
            search --no-floppy --fs-uuid --set 2f4daaaa-ec96-426c-be68-f4bb6bfe4166
            linux   /boot/vmlinuz-2.6.31-20-generic root=UUID=2f4daaaa-ec96-426c-be68-f4bb6bfe4166 ro single
            initrd  /boot/initrd.img-2.6.31-20-generic
    }
    
    ### END /etc/grub.d/40_custom ###
    
    
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
            linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
            linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    if [ ${timeout} != -1 ]; then
      if keystatus; then
        if keystatus --shift; then
          set timeout=-1
        else
          set timeout=0
        fi
      else
        if sleep --interruptible 3 ; then
          set timeout=0
        fi
      fi
    fi
    ### END /etc/grub.d/30_os-prober ###

  2. #22
    Join Date
    Nov 2006
    Beans
    28

    Re: aufs root filesystem

    Ok as a test (and after looking at /proc/mounts a bit more carefully), I ran remountrw and touched a file in /ro/home/gravyface, remountro'ed, and rebooted and the file was present in /home/gravyface.

    Is this the expected behavior? I could've sworn that with Voyage Linux (which this rootaufs script is based off of) you could run the system normally when remountrw'ed (i.e. apt-get install/remove, etc.). Am I missing something?

    I'm following these instructions:
    https://help.ubuntu.com/community/au...stemOnUsbFlash

    Running Ubuntu 9.10 2.6.31-20 64-bit; /dev/sda1 is a CompactFlash card (SATA-to-CF adapter) formatted with Ext4.

  3. #23
    Join Date
    Aug 2006
    Beans
    235
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: aufs root filesystem

    For what it's worth, Puppy Linux does exactly this kind of thing when running from a flash drive... You might take a look at their scripts and see if they're easily convertible for a full-size distribution...
    bIlujlaHbe'chugh, bIQaplaHbe' --tlhIngan vIttlhegh.

    Was my answer helpful? A few bitcents to help a starving IT professional would be appreciated! 1CBzQFjyp5xKoRYRZog6VPgR75oCP6T2AJ

  4. #24
    Join Date
    Aug 2010
    Beans
    1

    Re: aufs root filesystem

    Many thanks for this script! I use it every day. It really does the trick.

    I often remountrw or mount a scratch partition to store things across reboots. Of course, sometimes I forget to remountro before rebooting. I've noticed that this always causes fsck to complain about improper unmounting. After a little looking around it became clear that the umountfs and umountroot scripts in /etc/init.d are not set up to handle the rootaufs scenario. To fix them I added the following lines to the rootaufs script (after the fstab fixes):

    Code:
    cat /aufs/ro/etc/init.d/umountfs | \
        sed 's:\(PROTECTED_MOUNTS.*\)\^.... .. .. /:\1^aufs.* \\/ /:' \
        | sed 's:\(^\s*/|/proc.*\)):\1|/ro|/rw):' >/aufs/etc/init.d/umountfs
    
    cat /aufs/ro/etc/init.d/umountroot | \
        sed 's:\(\s*\)\(mount.*dummytype.*dummydev.*\):\1for aroot in /ro /rw /; do\n\1\2:' \
        | sed '/mount.*dummytype.*dummydev/,/ES=/s:\(\s*\)\(.*\) /\([ ]*\):\1    \2 $aroot\3:' \
        | sed 's/\(\s*\)ES=\$?/\1done\n\1ES=$?/' >/aufs/etc/init.d/umountroot
    umountfs is expecting a /proc/mounts that has a line starting with "/some-dev / " somewhere after the first line. It leaves anything above this line mounted. In the rootaufs case, the script should instead look for a line starting with "aufs / ". As an extra precaution, add /ro and /rw to the list of mounts that umountfs should not touch.

    For umountroot, run a loop that umounts /ro /rw and finally /, instead of just umounting /. I'm not certain what the best order is for umounting these, but this seems to work.


    Cheers,
    Brendan
    Last edited by zagaeski; August 19th, 2010 at 02:11 AM. Reason: correction

  5. #25
    Join Date
    Aug 2010
    Location
    Poland
    Beans
    44
    Distro
    Ubuntu

    Angry Re: aufs root filesystem

    I run this script on 11.04 and i have following errors:

    from gnome panel:
    Code:
    "Indicator Applet Session" has quit unexpectedly
    "Indicator Applet" has quit unexpectedly
    and i have no sound

    dmesg shows:

    Code:
    dmesg | cut -d ']' -f 2 | grep hardlink| sort | uniq
    non-accessible hardlink creation was attempted by: compiz (fsuid 1000)
     non-accessible hardlink creation was attempted by: gconfd-2 (fsuid 1000)
     non-accessible hardlink creation was attempted by: gconfd-2 (fsuid 106)
     non-accessible hardlink creation was attempted by: gdm-session-wor (fsuid 1000)
     non-accessible hardlink creation was attempted by: gdm-simple-slav (fsuid 106)
     non-accessible hardlink creation was attempted by: gvfsd-metadata (fsuid 1000)
     non-accessible hardlink creation was attempted by: indicator-apple (fsuid 1000)
     non-accessible hardlink creation was attempted by: opera (fsuid 1000)
     non-accessible hardlink creation was attempted by: pulseaudio (fsuid 1000)
     non-accessible hardlink creation was attempted by: ubuntuone-login (fsuid 1000)
     non-accessible hardlink creation was attempted by: ubuntuone-syncd (fsuid 1000)
     non-accessible hardlink creation was attempted by: zeitgeist-daemo (fsuid 1000)
    and couple of:
    Code:
    Error in vfs_unlink; rc = [-1]
    apparmor is off

    help pls, since i really wanna have my linux on pendrive

  6. #26
    Join Date
    Apr 2005
    Location
    Finland/UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: aufs root filesystem

    Considering that this is years old thread, and has absolutely nothing to do with the problem you are having, you really should just start a new thread of your own, with a title related to your problem.

  7. #27
    Join Date
    Aug 2010
    Location
    Poland
    Beans
    44
    Distro
    Ubuntu

    Talking Re: aufs root filesystem

    k, found solution for it:

    kernel.yama.protected_nonaccess_hardlinks=0 in boot options /etc/defautls/grub fixes it

    https://bugs.launchpad.net/ubuntu/+s...ux/+bug/663069

  8. #28
    Join Date
    Aug 2010
    Location
    Poland
    Beans
    44
    Distro
    Ubuntu

    Re: aufs root filesystem

    and that solution doesnt fix the problem... sucks, time to go for plan b, which is by hand tmpfs-aufs the main offenders... oh well

  9. #29
    Join Date
    Aug 2010
    Location
    Poland
    Beans
    44
    Distro
    Ubuntu

    Thumbs up Re: aufs root filesystem

    Quote Originally Posted by mcduck View Post
    Considering that this is years old thread, and has absolutely nothing to do with the problem you are having, you really should just start a new thread of your own, with a title related to your problem.
    no.

    i would suggest you should drop passive-agressive and/or authoritarian tone from your future posts, and maybe read what is really going on (i.e. that my post has EVERYTHING to do with aufs on root on ubuntu).

    also, the help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash howto points to this thread, if youre owner of that howto then please fix that...

    kthxbai

  10. #30
    Join Date
    Jun 2009
    Beans
    1

    Re: aufs root filesystem

    I also came across the non-accessible hardlink creation problem, with xbmc. As stated, the kernel option kernel.yama.protected_nonaccess_hardlinks=0 is what needs to be done, but passing it as a kernel option in GRUB does not work. My solution was to embed it in a startup script instead:

    Code:
    sudo nano -w /etc/init.d/hardlinks_fix
    then save this in the new file:

    Code:
    #! /bin/sh
    # /etc/init.d/hardlinks_fix
    #
    
    sysctl -w kernel.yama.protected_nonaccess_hardlinks=0
    
    exit 0
    make it executable and add it to the default runlevel:

    Code:
    sudo chmod +x /etc/init.d/hardlinks_fix
    
    sudo update-rc.d hardlinks_fix defaults
    After this, and the AppArmor workaround "aa-complain dhclient3" to get networking under aufs, xbmc seems to be working for me and I don't have the hardlinks creation error anymore.

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •