init boot mount: mounting /root on /root.ro failed: Invalid argument, aufs

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I am trying to set up a read-only filesystem at /root directory on my embedded device.
I have following in code in my boot init command file /sbin/init-overlay:



rootmnt=/root

ro_mount_point="$rootmnt%/.ro"
rw_mount_point="$rootmnt%/.rw"

# For local system rearranged from init
/bin/mkdir -p "$ro_mount_point" "$rw_mount_point"

# Move the already-mounted root filesystem to the ro mount point:
/bin/mount --move $rootmnt $ro_mount_point

# Mount the read/write filesystem:
/bin/mount -t tmpfs root.rw "$rw_mount_point"

# Mount the union:
/bin/mount -t aufs -o dirs=$rw_mount_point=rw:$ro_mount_point=ro aufs $rootmnt

# Correct the permissions of /:
/bin/chmod 755 "$rootmnt"

# Make sure the individual ro and rw mounts are accessible from within the root
# once the union is assumed as /. This makes it possible to access the
# component filesystems individually.
/bin/mkdir "$rootmnt/ro" "$rootmnt/rw"
/bin/mount --bind "$ro_mount_point" "$rootmnt/ro"
/bin/mount --bind "$rw_mount_point" "$rootmnt/rw"


This is my boot command:



console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fsck.repair=$fsck.repair panic=10 $extra fbcon=$fbcon rw init=/sbin/init-overlay


But while booting, I am getting the following error:



mount: mounting /root on /root.ro failed: Invalid argument


Can anyone point-out what's wrong here?










share|improve this question

























    up vote
    2
    down vote

    favorite












    I am trying to set up a read-only filesystem at /root directory on my embedded device.
    I have following in code in my boot init command file /sbin/init-overlay:



    rootmnt=/root

    ro_mount_point="$rootmnt%/.ro"
    rw_mount_point="$rootmnt%/.rw"

    # For local system rearranged from init
    /bin/mkdir -p "$ro_mount_point" "$rw_mount_point"

    # Move the already-mounted root filesystem to the ro mount point:
    /bin/mount --move $rootmnt $ro_mount_point

    # Mount the read/write filesystem:
    /bin/mount -t tmpfs root.rw "$rw_mount_point"

    # Mount the union:
    /bin/mount -t aufs -o dirs=$rw_mount_point=rw:$ro_mount_point=ro aufs $rootmnt

    # Correct the permissions of /:
    /bin/chmod 755 "$rootmnt"

    # Make sure the individual ro and rw mounts are accessible from within the root
    # once the union is assumed as /. This makes it possible to access the
    # component filesystems individually.
    /bin/mkdir "$rootmnt/ro" "$rootmnt/rw"
    /bin/mount --bind "$ro_mount_point" "$rootmnt/ro"
    /bin/mount --bind "$rw_mount_point" "$rootmnt/rw"


    This is my boot command:



    console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fsck.repair=$fsck.repair panic=10 $extra fbcon=$fbcon rw init=/sbin/init-overlay


    But while booting, I am getting the following error:



    mount: mounting /root on /root.ro failed: Invalid argument


    Can anyone point-out what's wrong here?










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I am trying to set up a read-only filesystem at /root directory on my embedded device.
      I have following in code in my boot init command file /sbin/init-overlay:



      rootmnt=/root

      ro_mount_point="$rootmnt%/.ro"
      rw_mount_point="$rootmnt%/.rw"

      # For local system rearranged from init
      /bin/mkdir -p "$ro_mount_point" "$rw_mount_point"

      # Move the already-mounted root filesystem to the ro mount point:
      /bin/mount --move $rootmnt $ro_mount_point

      # Mount the read/write filesystem:
      /bin/mount -t tmpfs root.rw "$rw_mount_point"

      # Mount the union:
      /bin/mount -t aufs -o dirs=$rw_mount_point=rw:$ro_mount_point=ro aufs $rootmnt

      # Correct the permissions of /:
      /bin/chmod 755 "$rootmnt"

      # Make sure the individual ro and rw mounts are accessible from within the root
      # once the union is assumed as /. This makes it possible to access the
      # component filesystems individually.
      /bin/mkdir "$rootmnt/ro" "$rootmnt/rw"
      /bin/mount --bind "$ro_mount_point" "$rootmnt/ro"
      /bin/mount --bind "$rw_mount_point" "$rootmnt/rw"


      This is my boot command:



      console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fsck.repair=$fsck.repair panic=10 $extra fbcon=$fbcon rw init=/sbin/init-overlay


      But while booting, I am getting the following error:



      mount: mounting /root on /root.ro failed: Invalid argument


      Can anyone point-out what's wrong here?










      share|improve this question













      I am trying to set up a read-only filesystem at /root directory on my embedded device.
      I have following in code in my boot init command file /sbin/init-overlay:



      rootmnt=/root

      ro_mount_point="$rootmnt%/.ro"
      rw_mount_point="$rootmnt%/.rw"

      # For local system rearranged from init
      /bin/mkdir -p "$ro_mount_point" "$rw_mount_point"

      # Move the already-mounted root filesystem to the ro mount point:
      /bin/mount --move $rootmnt $ro_mount_point

      # Mount the read/write filesystem:
      /bin/mount -t tmpfs root.rw "$rw_mount_point"

      # Mount the union:
      /bin/mount -t aufs -o dirs=$rw_mount_point=rw:$ro_mount_point=ro aufs $rootmnt

      # Correct the permissions of /:
      /bin/chmod 755 "$rootmnt"

      # Make sure the individual ro and rw mounts are accessible from within the root
      # once the union is assumed as /. This makes it possible to access the
      # component filesystems individually.
      /bin/mkdir "$rootmnt/ro" "$rootmnt/rw"
      /bin/mount --bind "$ro_mount_point" "$rootmnt/ro"
      /bin/mount --bind "$rw_mount_point" "$rootmnt/rw"


      This is my boot command:



      console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fsck.repair=$fsck.repair panic=10 $extra fbcon=$fbcon rw init=/sbin/init-overlay


      But while booting, I am getting the following error:



      mount: mounting /root on /root.ro failed: Invalid argument


      Can anyone point-out what's wrong here?







      boot linux-kernel aufs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 13 at 6:18









      Gopal Kildoliya

      1112




      1112




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The most likely explanation for a mount --move failing with "Invalid argument" is that the source isn't a mount point itself. If $rootmnt isn't a mount point, you have two choices: either properly make it one, or fake it with mount --bind "$rootmnt" "$rootmnt".






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468713%2finit-boot-mount-mounting-root-on-root-ro-failed-invalid-argument-aufs%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            The most likely explanation for a mount --move failing with "Invalid argument" is that the source isn't a mount point itself. If $rootmnt isn't a mount point, you have two choices: either properly make it one, or fake it with mount --bind "$rootmnt" "$rootmnt".






            share|improve this answer
























              up vote
              0
              down vote













              The most likely explanation for a mount --move failing with "Invalid argument" is that the source isn't a mount point itself. If $rootmnt isn't a mount point, you have two choices: either properly make it one, or fake it with mount --bind "$rootmnt" "$rootmnt".






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                The most likely explanation for a mount --move failing with "Invalid argument" is that the source isn't a mount point itself. If $rootmnt isn't a mount point, you have two choices: either properly make it one, or fake it with mount --bind "$rootmnt" "$rootmnt".






                share|improve this answer












                The most likely explanation for a mount --move failing with "Invalid argument" is that the source isn't a mount point itself. If $rootmnt isn't a mount point, you have two choices: either properly make it one, or fake it with mount --bind "$rootmnt" "$rootmnt".







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 14 at 21:12









                Joseph Sible

                939213




                939213



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468713%2finit-boot-mount-mounting-root-on-root-ro-failed-invalid-argument-aufs%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)