Ну вот нашлось более-менее внятное решение проблемы (под спойлером). Спасибо человеку по имени Steve Dodd с bugs.launchpad.net. Человек не поленился расписать мне, новичку, что да как...
Правда, на английском. Если найдется человек, который толково переведет это на русский, то большое ему будет за это спасибо.
Hi Aleksey,
Yes, I think this is the same problem. This fix requires changing two files, one in the initrd.gz, one in the main filesystem. Fortunately you can make this second change in the casper-rw filesystem, so there's no need to rebuild filesystem.squashfs ..
The first _is_ a bit of a pain because it means unpacking and repacking the initrd. The quick and dirty way to do that (i.e., as root), is to copy the initrd.gz to /tmp and do something like (untested):
cd /tmp
gunzip initrd.gz
mkdir ird
cd ird
cpio -i <../initrd
patch scripts/casper <<'EOM'
diff -Nur casper-1.152.orig/scripts/casper casper-1.152/scripts/casper
--- casper-1.152.orig/scripts/casper 2008-10-25 23:46:45.000000000 +0100
+++ casper-1.152/scripts/casper 2009-04-03 00:57:25.000000000 +0100
@@ -396,6 +396,8 @@
mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || panic "Can not mount $cowdevice on /cow"
mount -t ${UNIONFS} -o noatime,dirs=/cow=rw:$rofsstring ${UNIONFS} "$rootmnt" || panic "${UNIONFS} mount failed"
+ [ -d "${rootmnt}/cow" ] || mkdir "${rootmnt}/cow"
+ mount /cow "${rootmnt}/cow" -o move
# Adding other custom mounts
if [ -n "${PERSISTENT}" ]; then
@@ -592,3 +594,5 @@
exec 2>&7 7>&-
cp casper.log "${rootmnt}/var/log/"
}
+
+# vi:ts=4:et:
EOM
find | cpio -H newc -o >../newird
cd ..
gzip newird
And then overwrite the initrd.gz on your live USB/CD with the generated 'newird.gz'.
The second file is easier, boot the live CD/USB with persistence enabled and then (as root) do:
patch /etc/init.d/casper <<'EOM'
diff -Nur casper-1.152.orig/debian/casper.init casper-1.152/debian/casper.init
--- casper-1.152.orig/debian/casper.init 2008-10-25 23:46:45.000000000 +0100
+++ casper-1.152/debian/casper.init 2009-04-10 14:49:09.000000000 +0100
@@ -75,6 +75,17 @@
prompt=
fi
+ # remount cow ro
+ OPTS=`grep '^aufs / aufs ' /proc/mounts | awk '{print $4}'`
+ if [ -n "$OPTS" ]; then
+ OPTS=`echo "$OPTS" | sed -e 's/xino=.*,/noxino,/' -e
+ 's/cow=rw/cow=ro/' -e 's/^rw/ro/'`
+ mount / -no remount,$OPTS
+ mount /cow -no remount,ro
+ sync # you'd think mount would do this ..
+ sleep 5 # could probably get away with less
+ fi
+
for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default $(which stty); do
cache_path "$path"
done
@@ -113,3 +124,5 @@
exit 3
;;
esac
+
+# vi:ts=4:et:
EOM
I've not yet tested this fix with jaunty, but it seemed to work for me with intrepid.
Ну что могу сказать... Метод работает! Единственное, мне понадобилась установка пакета patch (sudo apt-get install patch).
После применения патчей с последующей перезагрузкой в настольную систему и проверкой раздела casper-rw утилита e2fsck сообщила о том, что этот раздел был неправильно размонтирован, но ошибок не нашла.
При последующих перезагрузках Live системы persistent работает, и все еще имеем две ошибки ввода-вывода при завершении работы, но при этом e2fsck сообщает, что c casper-rw все хорошо. Можно спать спокойно...
Проверено мной на Ubuntu Jaunty Live USB (созданном с помощью штатной убунтовской утилиты) с отдельным ext2-разделом casper-rw. Steve также сказал, что у него на Intrepid тоже все работает.
Источник решения (LP bug: #125702)P.S. Если кому надо, то позже смогу выложить патченый casper и initrd.gz
(хотя, думаю, правильнее будет все-же сделать все самим на своей системе)