site  contact  subhomenews

Filesystem check fails if boot- and wkg-partition the same

July 26, 2020 — BarryK

This was reported by 'foxpup' in the forum:

In the initrd there is script /sbin/fscheck that unmounts the working-partition prior to running 'e2fsck' utility. The problem is that there is a file in use in the boot-partition, which prevents unmounting. No problem if they are different partitions.

easy.sfs in the boot-partition is temporarily mounted on folder /tro, which enables 'fscheck' to chroot into it to run the 'e2fsck' utility. That is, there is no 'e2fsck' utility in the initrd. it was done this way as 'e2fsck' statically-linked is about 500KB, a bit big to put into the initrd. The temporary mounting of easy.sfs is used for other reasons also. For 'fscheck' to use the e2fsck inside easy.sfs is very efficient.

Anyway, we have to be a bit less size-efficient and the initrd now has statically-compiled 'e2fsck', and the temporarily-mounted easy.sfs is now unmounted before 'fscheck' script is called.

I tested, the fix works. 

Tags: easy