Just tested USB connection on Libra 2, 4.31 firmware, no mods installed (other than dev mode enabled for telnet access).
Umount always fails when you connect within KEPUB (nickel does not release KEPUB filehandle), and sometimes fails when you connect from Home menu (nickel does not release KoboReader.sqlite filehandle).
Umount works well from within regular EPUB book. So if you have USB corruption issues I recommend you open a regular EPUB first before making the connection, and see if that helps.
Lazy umount is a bug that helps sweep other bugs under the rug, so no one will ever notice or fix them.
----
if anyone wants to test, put the following code in /usr/local/Kobo/udev/usb just *before* sync umount -l /mnt/onboard
it will try to umount regularly 5 times, if it fails you'll find umount.txt in the exported filesystem showing a process list and open filehandles and such
Code:
attempts=5
for i in $(seq $attempts)
do
grep " /mnt/onboard " /proc/mounts || break
umount /mnt/onboard && break
(
echo "-------- umount failed ($i / $attempts) --------"
umount /mnt/onboard 2>&1
date -Is
pstree -p
grep -E '^([^ ]+ ){3}b3:0[39] ' /proc/*/maps
find /proc/[0-9]*/cwd /proc/[0-9]*/fd -exec stat -tL {} + | grep -E '^([^ ]+ ){6}b30[39]' | xargs ls -l
) > /tmp/umount.txt
cat /tmp/umount.txt >> /mnt/onboard/umount.txt
sleep 1
done