[kiwi] Problem with overlayfs and 3.18 kernel

777 views
Skip to first unread message

Yaroslav Andrusyak

unread,
Dec 4, 2014, 1:31:15 PM12/4/14
to kiwi-...@googlegroups.com
Hi all.
Looks like overlayfs (fs name and module name) was renamed to overlay, 

cat /proc/filesystems|grep overlay
nodev   overlay

modinfo overlay
filename:       /lib/modules/3.18.0-rc7-2-desktop/kernel/fs/overlayfs/overlay.ko                                                                  
alias:          fs-overlay                                                                                                                        
license:        GPL                                                                                                                               
description:    Overlay filesystem                                                                                                                
author:         Miklos Szeredi <mik...@szeredi.hu>                                                                                                
srcversion:     7B9E64FDD9543689D7E0606                                                                                                           
depends:                                                                                                                                          
intree:         Y                                                                                                                                 
vermagic:       3.18.0-rc7-2-desktop SMP preempt mod_unload modversions       

and other problem is workdir(required) mount option.


mount -t overlay -o rw,lowerdir=/mnt/1,upperdir=/mnt/2 overlay /mnt/3                                              
mount: wrong fs type, bad option, bad superblock on overlay,                                                                                      
       missing codepage or helper program, or other error                                                                                         
                                                                                                                                                  
       In some cases useful info is found in syslog - try                                                                                         
       dmesg | tail or so.                



mount -t overlay -o rw,lowerdir=/mnt/1,upperdir=/mnt/2,workdir=/mnt/4 overlay /mnt/3
 works fine

Marcus Schäfer

unread,
Dec 5, 2014, 5:06:15 AM12/5/14
to kiwi-...@googlegroups.com
Hi,

> Hi all.
> Looks like overlayfs (fs name and module name) was renamed to overlay,
> cat /proc/filesystems|grep overlay
> nodev overlay
> modinfo overlay
> filename:
> /lib/modules/3.18.0-rc7-2-desktop/kernel/fs/overlayfs/overlay.ko

Thanks much for letting us know, in kiwi we match the module
by <fs/overlayfs/*> so this will still match the renamed module

> and other problem is workdir(required) mount option.
> mount -t overlay -o rw,lowerdir=/mnt/1,upperdir=/mnt/2 overlay /mnt/3
>
> mount: wrong fs type, bad option, bad superblock on overlay,
>
> mount -t overlay -o rw,lowerdir=/mnt/1,upperdir=/mnt/2,workdir=/mnt/4
> overlay /mnt/3
> works fine

yes thanks I have updated the kiwi code to check for both variants
The commit is here:

commit 48333a6af8be419556bbec300fb28f572d49762d
Adapt changes in overlayfs in kernel 3.18

Would be great if you can double check

Thanks

Regards,
Marcus
--
Public Key available
http://pgp.mit.edu/pks/lookup?search=0x94302D78&op=index
-------------------------------------------------------
Marcus Schäfer (Res. & Dev.) SUSE Linux GmbH
Tel: 0911-740 53 0 Maxfeldstrasse 5
FAX: 0911-740 53 479 D-90409 Nürnberg
GF: Jeff Hawn,Jennifer Guild, Felix Imendörffer
HRB: 21284 (GmbH Nürnberg) Germany
http://www.suse.de
-------------------------------------------------------

Yaroslav Andrusyak

unread,
Dec 5, 2014, 7:23:20 AM12/5/14
to kiwi-...@googlegroups.com
Does not work. I can not switch to other vt to see more info(dmesg, lsmod )


Встроенное изображение 1







--
You received this message because you are subscribed to the Google Groups "kiwi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kiwi-images...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcus Schäfer

unread,
Dec 5, 2014, 8:39:54 AM12/5/14
to kiwi-...@googlegroups.com
Hi,

> Does not work. I can not switch to other vt to see more info(dmesg,
> lsmod )

try to boot with

kiwidebug=1

that will give you a shell

Yaroslav Andrusyak

unread,
Dec 5, 2014, 9:37:19 AM12/5/14
to kiwi-...@googlegroups.com
 14.308204] overlayfs: workdir and upperdir must reside under the same mount

looks like we need 

upperdir=/read-write/rw
workdir=/read-write/work-dir


Marcus Schäfer

unread,
Dec 5, 2014, 9:53:17 AM12/5/14
to kiwi-...@googlegroups.com
Hi,

> 14.308204] overlayfs: workdir and upperdir must reside under the same
> mount
> looks like we need
> upperdir=/read-write/rw
> workdir=/read-write/work-dir

hmpf, ok follow up patch pushed to the git, let's see if it like it
that way

Thanks much for testing this

Yaroslav Andrusyak

unread,
Dec 5, 2014, 10:24:15 AM12/5/14
to kiwi-...@googlegroups.com
overlay say 
upperdir and workdir must be in separate subtrees



Yaroslav Andrusyak

unread,
Dec 7, 2014, 5:35:27 AM12/7/14
to kiwi-...@googlegroups.com
now it works

\--- /home/download/git/kiwi/modules/KIWILinuxRC.sh      2014-12-05 17:05:35.029034489 +0200
+++ /usr/share/kiwi/modules/KIWILinuxRC.sh      2014-12-07 11:35:46.653382513 +0200
@@ -6133,6 +6133,7 @@
     local roDir=/read-only
     local rwDir=/read-write
     local wkDir=$rwDir/work-stage
+    local upDir=$rwDir/rw                                                                                                                                               
     local rwDevice=`echo $UNIONFS_CONFIG | cut -d , -f 1`                                                                                                              
     local roDevice=`echo $UNIONFS_CONFIG | cut -d , -f 2`                                                                                                              
     local unionFST=`echo $UNIONFS_CONFIG | cut -d , -f 3`                                                                                                              
@@ -6197,7 +6198,8 @@                                                                                                                                                   
         local opts="rw,lowerdir=$roDir,upperdir=$rwDir"                                                                                                                
         if ! mount -t overlayfs -o $opts overlayfs /mnt;then                                                                                                           
             mkdir -p $wkDir                                                                                                                                            
-            opts="$opts,workdir=$wkDir"                                                                                                                                
+            mkdir -p $upDir                                                                                                                                             
+            opts="rw,lowerdir=$roDir,upperdir=$upDir,workdir=$wkDir"                                                                                                    
             if ! mount -t overlay -o $opts overlay /mnt;then                                                                                                           
                 Echo "Failed to mount root via overlayfs"                                                                                                              
                 return 1  

Marcus Schäfer

unread,
Dec 7, 2014, 8:32:07 AM12/7/14
to kiwi-...@googlegroups.com
Hi,

> overlay says
> upperdir and workdir must be in separate subtrees

yes, sorry forgot to take that into acount. you mentioned this
in your last mail. applied now

Regards,
Marcus
--
Public Key available
http://pgp.mit.edu/pks/lookup?search=0x94302D78&op=index
-------------------------------------------------------
Marcus Schäfer (Res. & Dev.) SUSE LINUX Products GmbH
Tel: 0911-740 53 0 Maxfeldstrasse 5
FAX: 0911-740 53 479 D-90409 Nürnberg
GF: Jeff Hawn,Jennifer Guild, Felix Imendörffer
HRB: 21284 (AG Nürnberg) Germany
http://www.suse.de
-------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages