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

Clash 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?
boot linux-kernel aufs
add a comment |Â
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?
boot linux-kernel aufs
add a comment |Â
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?
boot linux-kernel aufs
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
boot linux-kernel aufs
asked Sep 13 at 6:18
Gopal Kildoliya
1112
1112
add a comment |Â
add a comment |Â
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".
add a comment |Â
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".
add a comment |Â
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".
add a comment |Â
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".
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".
answered Sep 14 at 21:12
Joseph Sible
939213
939213
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password