View previous topic :: View next topic |
Author |
Message |
dasPaul Apprentice
Joined: 14 Feb 2012 Posts: 243 Location: Dresden
|
Posted: Thu May 28, 2015 7:01 am Post subject: replace aufs w. overlayfs in live system |
|
|
Hi there
Does someone here have experience with overlayfs in initramfs using tmpfs and squashfs image?
Currently I use aufs in my initramfs to boot my selfmade squashed LiveUsb system.
Here is the part how it works currently in my initramfs:
Code: | mkdir /mnt/imgdisk
mount LABEL=LiveUsb /mnt/imgdisk
mkdir /mnt/tmpfs
mount -t tmpfs -o size=2700m tmpfs /mnt/tmpfs
bin/rsync -ahP /mnt/imgdisk/live1.1 /mnt/tmpfs # copy the squashfs image into tmpfs
umount /mnt/imgdisk
mkdir /mnt/ro_root
mkdir /mnt/tmpfs/rw
mount -o ro /mnt/tmpfs/live1.1 /mnt/ro_root
mount -t aufs -o br=/mnt/tmpfs/rw:/mnt/ro_root none /mnt/root
mkdir /mnt/root/rw
mount -o bind /mnt/tmpfs/rw /mnt/root/rw
exec switch_root /mnt/root /sbin/init |
It works without problems. Now I would like to replace aufs with overlayfs.
Its a bit unclear to me what exactly the workdir does. Can someone tell me if my understanding is correct?
lowerdir= goes in /mnt/ro_root
upperdir= goes in /mnt/tmpfs/rw
/merge= /mnt/root (this is the new_root for switch_root)
workdir= where to put this?
Before I do that I tried to test overlayfs on my system(its the live system where / is in tmpfs from above init).
Code: | mkdir /{lower,upper,work,merge}
mount -t overlay -olowerdir=/lower,upperdir=/upper,workdir=/work overlay /merge |
It complains about:
Quote: | "overlayfs: filesystem on '/upper' not supported" |
upper fs is tmpfs in my case but why it is not supported? |
|
Back to top |
|
|
dasPaul Apprentice
Joined: 14 Feb 2012 Posts: 243 Location: Dresden
|
Posted: Thu May 28, 2015 8:11 am Post subject: |
|
|
ok, Press on regardless!
I just tried to boot with the replacement of the aufs part with:
Code: | mkdir /mnt/tmpfs/work
mount -t overlay -o lowerdir=/mnt/ro_root,upperdir=/mnt/tmpfs/rw,workdir=/mnt/tmpfs/work overlay /mnt/root |
and it booted.
mount shows root is mounted as overlay:
Code: |
overlay on / type overlay (rw,relatime,lowerdir=/mnt/ro_root,upperdir=/mnt/tmpfs/rw,workdir=/mnt/tmpfs/work) |
|
|
Back to top |
|
|
o5gmmob8 Guru
Joined: 17 Oct 2003 Posts: 465
|
Posted: Wed Jul 15, 2015 1:00 am Post subject: aufs / overlayfs |
|
|
Hi,
Genkernel includes support for both aufs and overlayfs - have you found that not to be sufficient? You can pass either aufs (to activate aufs) or overlayfs (to activate overlayfs), you then need to follow the livecd conventions for where to put the root image ...
Walter |
|
Back to top |
|
|
likewhoa l33t
Joined: 04 Oct 2006 Posts: 778 Location: Brooklyn, New York
|
Posted: Sat Oct 22, 2016 7:47 pm Post subject: Re: aufs / overlayfs |
|
|
walterw wrote: | Hi,
Genkernel includes support for both aufs and overlayfs - have you found that not to be sufficient? You can pass either aufs (to activate aufs) or overlayfs (to activate overlayfs), you then need to follow the livecd conventions for where to put the root image ...
Walter |
You meant to say 'genkernel-next' as genkernel doesn't have overlayfs support yet... |
|
Back to top |
|
|
|