Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
replace aufs w. overlayfs in live system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Thu May 28, 2015 7:01 am    Post subject: replace aufs w. overlayfs in live system Reply with quote

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
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Thu May 28, 2015 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message
o5gmmob8
Guru
Guru


Joined: 17 Oct 2003
Posts: 465

PostPosted: Wed Jul 15, 2015 1:00 am    Post subject: aufs / overlayfs Reply with quote

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
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Sat Oct 22, 2016 7:47 pm    Post subject: Re: aufs / overlayfs Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum