OverlayFS on DietPi with LXDE Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Cas
Posts: 6
Joined: Sat Aug 01, 2020 11:59 am

OverlayFS on DietPi with LXDE

Post by Cas »

Hi everyone,

I looking for a tutorial (or something similar) which could help me to install a OverlayFS on a DietPi with LXDE.
Do you have any suggestions? For Raspbian I found someone, but no DietPi-specific.

I try to get a ReadOnly-DietPi (on Raspberry Pi 3B+) with a Desktop. Until now, I try it with a separate RW-Partition, but this don‘t fit for the job.

Thank you in advance
- Cas
User avatar
Joulinar
Posts: 2081
Joined: Sat Nov 16, 2019 12:49 am

Re: OverlayFS on DietPi with LXDE

Post by Joulinar »

Many thanks for your report. Maybe you can have a look to following post.

viewtopic.php?p=24920#p24920
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Cas
Posts: 6
Joined: Sat Aug 01, 2020 11:59 am

Re: OverlayFS on DietPi with LXDE

Post by Cas »

Unfortunaly, this solution isn‘t working for me. The Bash-Prompt changed to „(ro)“, but my changes taking place and I don‘t see the Overlay mounted.

The "install.sh" run trough without any error or warning. But No overlay-fs was mounted. Is there anything other to d then you write in the linked answer?
User avatar
Joulinar
Posts: 2081
Joined: Sat Nov 16, 2019 12:49 am

Re: OverlayFS on DietPi with LXDE

Post by Joulinar »

did you copied the code lines from GitHub into /root/.bashrc ??

For my system, this is working well

Code: Select all

root@DietPi3:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            433M     0  433M   0% /dev
tmpfs            94M  1.7M   93M   2% /run
overlay         470M   88K  470M   1% /
tmpfs           470M   88K  470M   1% /overlay
/dev/mmcblk0p2   29G  1.5G   27G   6% /overlay/lower
tmpfs           470M     0  470M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           470M     0  470M   0% /sys/fs/cgroup
tmpfs           2.0G  8.0K  2.0G   1% /tmp
tmpfs            50M   32K   50M   1% /var/log
/dev/mmcblk0p1  253M   64M  189M  26% /boot
tmpfs            94M     0   94M   0% /run/user/0
root@DietPi3:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Cas
Posts: 6
Joined: Sat Aug 01, 2020 11:59 am

Re: OverlayFS on DietPi with LXDE

Post by Cas »

I analyze the problem;

the init-bottom-overlay throw a error (hides by default) in line 16 (. /scripts/functions) because this folder isn't existing.

Through this, no /overlay tree is created.

So, I'm stuck here. Do you have any idea where the /scripts/functions folder should be created?


Regarding to your question, the /root/.bashrc PS1-Setting is only alternating the "name" displayed in the bash, so this has in the end no effect to the system.
User avatar
Joulinar
Posts: 2081
Joined: Sat Nov 16, 2019 12:49 am

Re: OverlayFS on DietPi with LXDE

Post by Joulinar »

there you go

Code: Select all

root@DietPi3:~# ls -ls /usr/share/initramfs-tools/scripts
total 36
12 -rw-r--r-- 1 root root 9828 Aug 23  2019 functions
 4 drwxr-xr-x 2 root root 4096 Jun 23 23:24 init-bottom
 4 drwxr-xr-x 2 root root 4096 Aug  4 23:51 init-top
 8 -rw-r--r-- 1 root root 5679 Feb  6  2019 local
 4 drwxr-xr-x 2 root root 4096 Aug  4 23:51 local-premount
 4 -rw-r--r-- 1 root root 3093 Feb  6  2019 nfs
root@DietPi3:~#
should be created during

Code: Select all

apt install initramfs-tools
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Cas
Posts: 6
Joined: Sat Aug 01, 2020 11:59 am

Re: OverlayFS on DietPi with LXDE

Post by Cas »

Ok, very much thanks so far.
I change the Line to this specific tree.
Now the scirpt tries to mount the overlay-folders (they where created), but the mount-command throws a warning, that the overlay-folders are not specified in the /etc/fstab (thats the point where the partitions hook to some tree).

Do you know where the fstab should be written or could post me the containing of your file here?
User avatar
Joulinar
Posts: 2081
Joined: Sat Nov 16, 2019 12:49 am

Re: OverlayFS on DietPi with LXDE

Post by Joulinar »

are you sure your install.sh was executed correctly? because you are missing all the steps done on the script like copy new hooks-overlay and init-bottom-overlay in place

hooks-overlay should contain the correct path to scripts/functions
https://github.com/chesty/overlayroot/b ... overlay#L3

Code: Select all

. /usr/share/initramfs-tools/scripts/functions
. /usr/share/initramfs-tools/hook-functions
and init-bottom-overlay should do mounting as well as changing /etc/fstab
https://github.com/chesty/overlayroot/b ... verlay#L62

Code: Select all

mount -n -o move ${rootmnt} /overlay/lower
mount -t overlay overlay -olowerdir=/overlay/lower,upperdir=/overlay/upper,workdir=/overlay/work ${rootmnt}

mkdir -p ${rootmnt}/overlay
mount -n -o rbind /overlay ${rootmnt}/overlay

# fix up fstab
cp ${rootmnt}/etc/fstab ${rootmnt}/etc/fstab.orig
awk '$2 != "/" {print $0}' ${rootmnt}/etc/fstab.orig > ${rootmnt}/etc/fstab
awk '$2 == "'${rootmnt}'" { $2 = "/" ; print $0}' /etc/mtab >> ${rootmnt}/etc/fstab
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Cas
Posts: 6
Joined: Sat Aug 01, 2020 11:59 am

Re: OverlayFS on DietPi with LXDE

Post by Cas »

I'm not sure about this, but like I write above, I don't get any error massage.

But, I can see, there is only deleting changes to my fstab-file... So I don't think that the install.sh-script was executed correctly.

Last Message is that busybody was installed...

When I execute init-bottom-overlay directly (and adjust the path), I got the error-message before on the mount-commands. The fstab is rewritten (oder better: the line should be added) afterwards.

When I try the awk-command, nothing happens.
User avatar
Joulinar
Posts: 2081
Joined: Sat Nov 16, 2019 12:49 am

Re: OverlayFS on DietPi with LXDE

Post by Joulinar »

hi,

the install script is not doing any changes on /etc/fstab.
install.sh is just going to copy hooks-overlay as well as init-bottom-overlay in place.

https://github.com/chesty/overlayroot/b ... install.sh

Code: Select all

cp hooks-overlay /etc/initramfs-tools/hooks/
cp init-bottom-overlay /etc/initramfs-tools/scripts/init-bottom/
So you need to check if the new files are copied correctly

Next to this some settings are done on

Code: Select all

/boot/config.txt
It might be better to contact the maintainer of overlayroot if you have issues with running it. I installed it 3 times without issues now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply