[arch-releng] [PATCH] Mount tmpfs filesystems with mode=0755
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index d979ef4..ae98231 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -76,12 +76,12 @@ archiso_mount_handler() { newroot="${1}" msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." - mount -t tmpfs -o "size=${tmpfs_size}" tmpfs /tmpfs + mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs msg "done." if [ "${copytoram}" = "y" ]; then msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." - mount -t tmpfs -o "size=${tmpfs_sqfs_size}" tmpfs /tmpfs.sqfs + mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs msg "done." fi -- 1.7.1.1
On Mon, 5 Jul 2010 19:46:09 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index d979ef4..ae98231 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -76,12 +76,12 @@ archiso_mount_handler() { newroot="${1}"
msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." - mount -t tmpfs -o "size=${tmpfs_size}" tmpfs /tmpfs + mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs msg "done."
if [ "${copytoram}" = "y" ]; then msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." - mount -t tmpfs -o "size=${tmpfs_sqfs_size}" tmpfs /tmpfs.sqfs + mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs msg "done." fi
what does this fix? and /tmp has the sticky bit set, right? Dieter
--- El mar 6-jul-10, Dieter Plaetinck <dieter@plaetinck.be> escribió:
De: Dieter Plaetinck <dieter@plaetinck.be> Asunto: Re: [arch-releng] [PATCH] Mount tmpfs filesystems with mode=0755 Para: arch-releng@archlinux.org Fecha: martes, 6 de julio de 2010, 4:09 On Mon, 5 Jul 2010 19:46:09 -0300 Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index d979ef4..ae98231 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -76,12 +76,12 @@ archiso_mount_handler() { newroot="${1}" msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." - mount -t tmpfs -o "size=${tmpfs_size}" tmpfs /tmpfs + mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs msg "done." if [ "${copytoram}" = "y" ]; then msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." - mount -t tmpfs -o "size=${tmpfs_sqfs_size}" tmpfs /tmpfs.sqfs + mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs msg "done." fi
what does this fix? and /tmp has the sticky bit set, right? Dieter
One fix perm on / directory that is 1755 currently, the other fix a directory that is unreacheable outside initramfs (is not needed but fixed anyway).
On 07/06/2010 03:02 PM, Gerardo Exequiel Pozzi wrote:
--- El mar 6-jul-10, Dieter Plaetinck<dieter@plaetinck.be> escribió:
De: Dieter Plaetinck<dieter@plaetinck.be> Asunto: Re: [arch-releng] [PATCH] Mount tmpfs filesystems with mode=0755 Para: arch-releng@archlinux.org Fecha: martes, 6 de julio de 2010, 4:09 On Mon, 5 Jul 2010 19:46:09 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 4 ++-- 1 files changed, 2 insertions(+), 2
what does this fix? and /tmp has the sticky bit set, right? Dieter
One fix perm on / directory that is 1755 currently, the other fix a directory that is unreacheable outside initramfs (is not needed but fixed anyway). Oops, I did not answer your question at all: Yes /tmp is untouched (/tmp has 1755 made by filesystem pkg). /tmpfs (on initramfs is the writeable branch of union mount) /tmpfs.sqfs is where *.sqfs are copied when copytoram=y is used.
I detected this accidentaly while working with my custom live cd, I wrote to / some files as user :P -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 06.07.2010 20:02, schrieb Gerardo Exequiel Pozzi:
the other fix a directory that is unreacheable outside initramfs (is not needed but fixed anyway).
There's something I've been meaning to do for a while, but my time is very short recently. I'm telling you this, because I have the feeling if I do, there'll be a patch for it tomorrow :) I don't want to leave dangling mounts in initramfs that are invisible from the system. This would involve the following: 1) Don't bind /bootmnt into the root, but mount --move it there. 2) Don't bind _mnt_bind file systems into the root, but also mount --move (or mount them there directly) 3) After mounting, mount --move all aufs branches into a directory in the root. This way, nothing will be left in rootfs and invisible for us. I don't know a good name for a directory, so I'll stick to /bootmnt. A layout could be like: /bootmnt/ /bootmnt/image (move the image here) /bootmnt/isomounts /bootmnt/isomounts/loop0 (move /mnt/loop0 here) /bootmnt/isomounts/loop1 etc. What do you think?
On 07/08/2010 04:51 AM, Thomas Bächler wrote:
Am 06.07.2010 20:02, schrieb Gerardo Exequiel Pozzi:
the other fix a directory that is unreacheable outside initramfs (is not needed but fixed anyway). There's something I've been meaning to do for a while, but my time is very short recently. I'm telling you this, because I have the feeling if I do, there'll be a patch for it tomorrow :) hehe :P I don't want to leave dangling mounts in initramfs that are invisible from the system. This would involve the following:
1) Don't bind /bootmnt into the root, but mount --move it there. 2) Don't bind _mnt_bind file systems into the root, but also mount --move (or mount them there directly) Yes 3) After mounting, mount --move all aufs branches into a directory in the root.
This way, nothing will be left in rootfs and invisible for us. I don't know a good name for a directory, so I'll stick to /bootmnt. A layout could be like: /bootmnt/ /bootmnt/image (move the image here) /bootmnt/isomounts /bootmnt/isomounts/loop0 (move /mnt/loop0 here) /bootmnt/isomounts/loop1 etc. What do you think?
If I understand corretly, please fix me if I am wrong, but.the problem is that mounts will be overlapped(*) with aufs mount stack, so at least one mountpoint must be unreacheable, this is where sqfs images are mounted /tmpfs (and /tmpfs.sqfs if copytoram is used). (*) http://bugs.archlinux.org/task/17182 "Aufs rejects the branch which is an ancestor or a descendant of another branch. It is called overlapped. When the branch is loopback-mounted directory, aufs also checks the source fs-image file of loopback device. If the source file is a descendant of another branch, it will be rejected too" http://aufs.sourceforge.net/aufs2/man.html ------------------------------------------------------------------------------------------------------------ Currently this is what commands are executed on normal boot (mkdir steps skipped) 1) mount -t tmpfs -o size=75%,mode=0755 tmpfs /tmpfs 2) mount -r -t udf /dev/disk/by-label/ARCH_201007 /bootmnt 3) mount -t aufs -o dirs=/tmpfs=rw none /new_root 4) mount -r -t squashfs /bootmnt/overlay.sqfs /tmpfs/mnt/overlay 5) mount -t aufs -o remount,append:/tmpfs/mnt/overlay=ro none /new_root 6) mount -r -t squashfs /bootmnt/root-image.sqfs /tmpfs/mnt/root-image 7) mount -t aufs -o remount,append:/tmpfs/mnt/root-image=ro none /new_root 8) mount -o bind /bootmnt /new_root/bootmnt What thing that may be improved here is: * steps 4 and 6 instead of mounting on /tmpfs/mnt/imagename mount under /mnt/imagename currently an ls /new_root/mnt will display empty dirs "overlay" and "root-image". Now looks like a bit recursive. * execute 3) then 2) so medium will me mounted directly to /new_root/bootmnt Doing that dirs that will be unreachable are: /tmpfs that is needed for aufs writeable branch, maybe can be renamed to better named than tmpfs something like /rw_branch /mnt/X where sqfs are mounted ------------------------------------------------------------------------------------------------------------ when copytoram=y (steps for mkdir and cp to /tmpfs.sqfs skipped) 1) mount -t tmpfs -o size=75%,mode=0755 tmpfs /tmpfs 2) mount -r -t udf /dev/disk/by-label/ARCH_201007 /bootmnt 3) mount -t aufs -o dirs=/tmpfs=rw none /new_root 4) mount -t tmpfs -o size=75%,mode=0755 tmpfs /tmpfs.sqfs 5) mount -r -t squashfs /tmpfs.sqfs/overlay.sqfs /tmpfs/mnt/overlay 6) mount -t aufs -o remount,append:/tmpfs/mnt/overlay=ro none /new_root 7) mount -r -t squashfs /tmpfs.sqfs/overlay.sqfs /tmpfs/mnt/overlay 8) mount -t aufs -o remount,append:/tmpfs/mnt/overlay=ro none /new_root 9) umount /bootmnt Same commands except that sqfs images are mounted from /tmpfs.sqfs directory on ram instead from /bootmnt (the boot medium) - Same improvements here - Same dirs unreachable plus /tmpfs.sqfs ------------------------------------------------------------------------------------------------------------ _mnt_bind function can be replaced with _mnt_move or removed, since all things can be appended as aufs branch. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 07/08/2010 08:49 PM, Gerardo Exequiel Pozzi wrote:
On 07/08/2010 04:51 AM, Thomas Bächler wrote:
Am 06.07.2010 20:02, schrieb Gerardo Exequiel Pozzi:
the other fix a directory that is unreacheable outside initramfs (is not needed but fixed anyway). There's something I've been meaning to do for a while, but my time is very short recently. I'm telling you this, because I have the feeling if I do, there'll be a patch for it tomorrow :) hehe :P I don't want to leave dangling mounts in initramfs that are invisible from the system. This would involve the following:
1) Don't bind /bootmnt into the root, but mount --move it there. 2) Don't bind _mnt_bind file systems into the root, but also mount --move (or mount them there directly) Yes 3) After mounting, mount --move all aufs branches into a directory in the root.
This way, nothing will be left in rootfs and invisible for us. I don't know a good name for a directory, so I'll stick to /bootmnt. A layout could be like: /bootmnt/ /bootmnt/image (move the image here) /bootmnt/isomounts /bootmnt/isomounts/loop0 (move /mnt/loop0 here) /bootmnt/isomounts/loop1 etc. What do you think?
If I understand corretly, please fix me if I am wrong, but.the problem is that mounts will be overlapped(*) with aufs mount stack, so at least one mountpoint must be unreacheable, this is where sqfs images are mounted /tmpfs (and /tmpfs.sqfs if copytoram is used). (*) http://bugs.archlinux.org/task/17182 "Aufs rejects the branch which is an ancestor or a descendant of another branch. It is called overlapped. When the branch is loopback-mounted directory, aufs also checks the source fs-image file of loopback device. If the source file is a descendant of another branch, it will be rejected too" http://aufs.sourceforge.net/aufs2/man.html
------------------------------------------------------------------------------------------------------------
Currently this is what commands are executed on normal boot (mkdir steps skipped)
1) mount -t tmpfs -o size=75%,mode=0755 tmpfs /tmpfs 2) mount -r -t udf /dev/disk/by-label/ARCH_201007 /bootmnt 3) mount -t aufs -o dirs=/tmpfs=rw none /new_root 4) mount -r -t squashfs /bootmnt/overlay.sqfs /tmpfs/mnt/overlay 5) mount -t aufs -o remount,append:/tmpfs/mnt/overlay=ro none /new_root 6) mount -r -t squashfs /bootmnt/root-image.sqfs /tmpfs/mnt/root-image 7) mount -t aufs -o remount,append:/tmpfs/mnt/root-image=ro none /new_root 8) mount -o bind /bootmnt /new_root/bootmnt
What thing that may be improved here is: * steps 4 and 6 instead of mounting on /tmpfs/mnt/imagename mount under /mnt/imagename currently an ls /new_root/mnt will display empty dirs "overlay" and "root-image". Now looks like a bit recursive. * execute 3) then 2) so medium will me mounted directly to /new_root/bootmnt
NO!, bind mount /bootmnt to /new_root/bootmnt should be keep... otherwise on "shutdown", resourse or device busy message. the same applies when copytoram My hardcode archiso experiment: http://gist.github.com/468957 (I using using initscript.git + my pending patch for rc.shutdown from http://bugs.archlinux.org/task/19783)
Doing that dirs that will be unreachable are: /tmpfs that is needed for aufs writeable branch, maybe can be renamed to better named than tmpfs something like /rw_branch /mnt/X where sqfs are mounted
------------------------------------------------------------------------------------------------------------
when copytoram=y (steps for mkdir and cp to /tmpfs.sqfs skipped)
1) mount -t tmpfs -o size=75%,mode=0755 tmpfs /tmpfs 2) mount -r -t udf /dev/disk/by-label/ARCH_201007 /bootmnt 3) mount -t aufs -o dirs=/tmpfs=rw none /new_root 4) mount -t tmpfs -o size=75%,mode=0755 tmpfs /tmpfs.sqfs 5) mount -r -t squashfs /tmpfs.sqfs/overlay.sqfs /tmpfs/mnt/overlay 6) mount -t aufs -o remount,append:/tmpfs/mnt/overlay=ro none /new_root 7) mount -r -t squashfs /tmpfs.sqfs/overlay.sqfs /tmpfs/mnt/overlay 8) mount -t aufs -o remount,append:/tmpfs/mnt/overlay=ro none /new_root 9) umount /bootmnt
Same commands except that sqfs images are mounted from /tmpfs.sqfs directory on ram instead from /bootmnt (the boot medium)
- Same improvements here - Same dirs unreachable plus /tmpfs.sqfs ------------------------------------------------------------------------------------------------------------
_mnt_bind function can be replaced with _mnt_move or removed, since all things can be appended as aufs branch.
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 09.07.2010 04:46, schrieb Gerardo Exequiel Pozzi:
What thing that may be improved here is: * steps 4 and 6 instead of mounting on /tmpfs/mnt/imagename mount under /mnt/imagename currently an ls /new_root/mnt will display empty dirs "overlay" and "root-image". Now looks like a bit recursive. * execute 3) then 2) so medium will me mounted directly to /new_root/bootmnt
NO!, bind mount /bootmnt to /new_root/bootmnt should be keep... otherwise on "shutdown", resourse or device busy message. the same applies when copytoram
My hardcode archiso experiment: http://gist.github.com/468957 (I using using initscript.git + my pending patch for rc.shutdown from http://bugs.archlinux.org/task/19783)
It is still the right thing to do (if we can). We should rather have a solution for the "device and ressource busy" problem, somehow telling our initscripts to not try and umount the fs.
Am 09.07.2010 01:49, schrieb Gerardo Exequiel Pozzi:
If I understand corretly, please fix me if I am wrong, but.the problem is that mounts will be overlapped(*) with aufs mount stack, so at least one mountpoint must be unreacheable, this is where sqfs images are mounted /tmpfs (and /tmpfs.sqfs if copytoram is used). (*) http://bugs.archlinux.org/task/17182 "Aufs rejects the branch which is an ancestor or a descendant of another branch. It is called overlapped. When the branch is loopback-mounted directory, aufs also checks the source fs-image file of loopback device. If the source file is a descendant of another branch, it will be rejected too" http://aufs.sourceforge.net/aufs2/man.html
I don't think this is the case here. You are not mounting an aufs branch inside another one, but you are moving an AUFS branch into the AUFS mount point itself. To me, it seems like AUFS and the Linux VFS should be able to handle that. I haven't tested it though. What the bug report stated is different: You nested two branches into each other - if AUFS uses the whole directory as a branch instead of just the mount point, I can understand why that would fail.
On 07/09/2010 04:13 AM, Thomas Bächler wrote:
Am 09.07.2010 01:49, schrieb Gerardo Exequiel Pozzi:
If I understand corretly, please fix me if I am wrong, but.the problem is that mounts will be overlapped(*) with aufs mount stack, so at least one mountpoint must be unreacheable, this is where sqfs images are mounted /tmpfs (and /tmpfs.sqfs if copytoram is used). (*) http://bugs.archlinux.org/task/17182 "Aufs rejects the branch which is an ancestor or a descendant of another branch. It is called overlapped. When the branch is loopback-mounted directory, aufs also checks the source fs-image file of loopback device. If the source file is a descendant of another branch, it will be rejected too" http://aufs.sourceforge.net/aufs2/man.html I don't think this is the case here. You are not mounting an aufs branch inside another one, but you are moving an AUFS branch into the AUFS mount point itself. To me, it seems like AUFS and the Linux VFS should be able to handle that. I haven't tested it though.
What the bug report stated is different: You nested two branches into each other - if AUFS uses the whole directory as a branch instead of just the mount point, I can understand why that would fail.
Seems to work moving all to /new_root/somedir... I have a dude why are interested in doing that? (nothing left except /new_root , hehe) https://gist.github.com/468957/7284f470b968064a8342060e64d3784f6658a42c ------------------------------------------------------------ (copytoram=n) tmpfs on /new_root/aufs/rw_branch type tmpfs (rw,relatime,size=383696k,mode=755) none on /new_root type aufs (rw,relatime,si=ddcbbff9) /dev/disk/by-label/ARCH_201007 on /new_root/bootmnt type udf (ro,relatime,utf8) /dev/loop0 on /new_root/aufs/ro_branch/overlay type squashfs (ro,relatime) /dev/loop1 on /new_root/aufs/ro_branch/root-image type squashfs (ro,relatime) (on shutdown) umount: /dev/loop1 busy - remounted read-only umount: /dev/loop0 busy - remounted read-only umount: /dev/disk/by-label/ARCH_201007 busy - remounted read-only umount: /aufs/rw_branch: device is busy. ------------------------------------------------------------ (copytoram=y) tmpfs on /new_root/aufs/rw_branch type tmpfs (rw,relatime,size=383696k,mode=755) none on /new_root type aufs (rw,relatime,si=88cacedb) tmpfs on /new_root/copyonram type tmpfs (rw,relatime,size=383696k,mode=755) /dev/loop0 on /new_root/aufs/ro_branch/overlay type squashfs (ro,relatime) /dev/loop1 on /new_root/aufs/ro_branch/root-image type squashfs (ro,relatime) (on shutdown) umount: /dev/loop1 busy - remounted read-only umount: /dev/loop0 busy - remounted read-only umount: /copyonram: device is busy. umount: /aufs/rw_branch: device is busy. ------------------------------------------------------------ -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am 09.07.2010 17:11, schrieb Gerardo Exequiel Pozzi:
I don't think this is the case here. You are not mounting an aufs branch inside another one, but you are moving an AUFS branch into the AUFS mount point itself. To me, it seems like AUFS and the Linux VFS should be able to handle that. I haven't tested it though.
What the bug report stated is different: You nested two branches into each other - if AUFS uses the whole directory as a branch instead of just the mount point, I can understand why that would fail.
Seems to work moving all to /new_root/somedir... I have a dude why are interested in doing that?
It is simply cleaner and more transparent. Having unaccessible mounts below the visible root hides part of the system from the end user, which is something I never like to do.
(nothing left except /new_root , hehe)
https://gist.github.com/468957/7284f470b968064a8342060e64d3784f6658a42c
------------------------------------------------------------ (copytoram=n) tmpfs on /new_root/aufs/rw_branch type tmpfs (rw,relatime,size=383696k,mode=755) none on /new_root type aufs (rw,relatime,si=ddcbbff9) /dev/disk/by-label/ARCH_201007 on /new_root/bootmnt type udf (ro,relatime,utf8) /dev/loop0 on /new_root/aufs/ro_branch/overlay type squashfs (ro,relatime) /dev/loop1 on /new_root/aufs/ro_branch/root-image type squashfs (ro,relatime)
(on shutdown) umount: /dev/loop1 busy - remounted read-only umount: /dev/loop0 busy - remounted read-only umount: /dev/disk/by-label/ARCH_201007 busy - remounted read-only umount: /aufs/rw_branch: device is busy.
------------------------------------------------------------ (copytoram=y) tmpfs on /new_root/aufs/rw_branch type tmpfs (rw,relatime,size=383696k,mode=755) none on /new_root type aufs (rw,relatime,si=88cacedb) tmpfs on /new_root/copyonram type tmpfs (rw,relatime,size=383696k,mode=755) /dev/loop0 on /new_root/aufs/ro_branch/overlay type squashfs (ro,relatime) /dev/loop1 on /new_root/aufs/ro_branch/root-image type squashfs (ro,relatime)
(on shutdown) umount: /dev/loop1 busy - remounted read-only umount: /dev/loop0 busy - remounted read-only umount: /copyonram: device is busy. umount: /aufs/rw_branch: device is busy. ------------------------------------------------------------
Just as I suspected: It works fine and IMO looks very nice (you can investigate /bootmnt/ and /aufs/r?_branch if you want to see what's going on). Two problems: 1) umounting fails ... I need to work on the umount code in rc.shutdown anyway, so there may be a solution for that. 2) /aufs/rw_branch/ is writable! Writing to it will definitely cause trouble with aufs - which would be a reason not to do this. Thanks for your tests, I am not sure anymore whether this is a good idea though.
On 07/09/2010 12:29 PM, Thomas Bächler wrote:
Am 09.07.2010 17:11, schrieb Gerardo Exequiel Pozzi:
I don't think this is the case here. You are not mounting an aufs branch inside another one, but you are moving an AUFS branch into the AUFS mount point itself. To me, it seems like AUFS and the Linux VFS should be able to handle that. I haven't tested it though.
What the bug report stated is different: You nested two branches into each other - if AUFS uses the whole directory as a branch instead of just the mount point, I can understand why that would fail.
Seems to work moving all to /new_root/somedir... I have a dude why are interested in doing that? It is simply cleaner and more transparent. Having unaccessible mounts below the visible root hides part of the system from the end user, which is something I never like to do. hehe, an --occultism :P (nothing left except /new_root , hehe)
https://gist.github.com/468957/7284f470b968064a8342060e64d3784f6658a42c
------------------------------------------------------------ (copytoram=n) tmpfs on /new_root/aufs/rw_branch type tmpfs (rw,relatime,size=383696k,mode=755) none on /new_root type aufs (rw,relatime,si=ddcbbff9) /dev/disk/by-label/ARCH_201007 on /new_root/bootmnt type udf (ro,relatime,utf8) /dev/loop0 on /new_root/aufs/ro_branch/overlay type squashfs (ro,relatime) /dev/loop1 on /new_root/aufs/ro_branch/root-image type squashfs (ro,relatime)
(on shutdown) umount: /dev/loop1 busy - remounted read-only umount: /dev/loop0 busy - remounted read-only umount: /dev/disk/by-label/ARCH_201007 busy - remounted read-only umount: /aufs/rw_branch: device is busy.
------------------------------------------------------------ (copytoram=y) tmpfs on /new_root/aufs/rw_branch type tmpfs (rw,relatime,size=383696k,mode=755) none on /new_root type aufs (rw,relatime,si=88cacedb) tmpfs on /new_root/copyonram type tmpfs (rw,relatime,size=383696k,mode=755) /dev/loop0 on /new_root/aufs/ro_branch/overlay type squashfs (ro,relatime) /dev/loop1 on /new_root/aufs/ro_branch/root-image type squashfs (ro,relatime)
(on shutdown) umount: /dev/loop1 busy - remounted read-only umount: /dev/loop0 busy - remounted read-only umount: /copyonram: device is busy. umount: /aufs/rw_branch: device is busy. ------------------------------------------------------------ Just as I suspected: It works fine and IMO looks very nice (you can investigate /bootmnt/ and /aufs/r?_branch if you want to see what's going on). yes, you can see hidden control files for aufs under /aufs/rw_branch/
Maybe if this is implemented all can be moved to this dir struct: /.archiso/ /.archiso/aufs/ /.archiso/aufs/rw_branch/ /.archiso/aufs/ro_branch/overlay/ /.archiso/aufs/ro_branch/root-image/ /.archiso/bootmedia/ /.archiso/copyonram/
Two problems: 1) umounting fails ... I need to work on the umount code in rc.shutdown anyway, so there may be a solution for that. Quick&Dirty solution: removing from /etc/mtab these entries on shutdown. 2) /aufs/rw_branch/ is writable! Writing to it will definitely cause trouble with aufs - which would be a reason not to do this. I am not sure here, I also suspect but I don't know any example. any example scenario that you suspect?
some quick tests... touch /aufs/rw_branch/something (works, and is visible on /) vi /aufs/rw_branch/etc/passwd (edit an existent file works, and modifications are visible on /etc/passwd) rm /aufs/rw_branch/etc/passwd (you will see /etc/passwd from ro_branch)
Thanks for your tests, I am not sure anymore whether this is a good idea though.
You are welcome, but you are burning my brain haha :P -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 07/06/2010 04:09 AM, Dieter Plaetinck wrote:
On Mon, 5 Jul 2010 19:46:09 -0300 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
Signed-off-by: Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> --- archiso/hooks/archiso | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/archiso/hooks/archiso b/archiso/hooks/archiso index d979ef4..ae98231 100644 --- a/archiso/hooks/archiso +++ b/archiso/hooks/archiso @@ -76,12 +76,12 @@ archiso_mount_handler() { newroot="${1}"
msg -n ":: Mounting tmpfs, size=${tmpfs_size}..." - mount -t tmpfs -o "size=${tmpfs_size}" tmpfs /tmpfs + mount -t tmpfs -o "size=${tmpfs_size}",mode=0755 tmpfs /tmpfs msg "done."
if [ "${copytoram}" = "y" ]; then msg -n ":: Mounting tmpfs (for squashfs), size=${tmpfs_sqfs_size}..." - mount -t tmpfs -o "size=${tmpfs_sqfs_size}" tmpfs /tmpfs.sqfs + mount -t tmpfs -o "size=${tmpfs_sqfs_size}",mode=0755 tmpfs /tmpfs.sqfs msg "done." fi
what does this fix? and /tmp has the sticky bit set, right? Dieter
I found another "what fix this" :P aufs test_add:256:mount[554]: uid/gid/perm /tmpfs/mnt/overlay 0/0/0755, 0/0/01777 you don't see anymore this warning for each squashfs image ;) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (3)
-
Dieter Plaetinck
-
Gerardo Exequiel Pozzi
-
Thomas Bächler