Comment 31 for bug 1489855

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 1489855] Re: Change to mount sequence order breaks persistence on casper-rw partitions

On Thu, 18 Jul 2019 at 23:40, Akeo <email address hidden> wrote:

> Thanks for looking into this.
>
> I've been trying to validate the above fix, but I'm still seeing the
> same issue. In other words, Ubuntu Live still seems to bail out to the
> busybox console as soon as you use add 'persistent' to the Kernel
> options.
>
> Here's what I did:
> - Extracted the content of
> http://cdimage.ubuntu.com/daily-live/current/eoan-desktop-amd64.iso to a
> FAT32 partition on an USB Flash drive
> - Added a 4 GB ext4 casper-rw partition to same drive (mkfs -L casper-rw
> -t ext4
> /dev/sda2)
> - Because the current image is dated 2019.07.15, which may be older than
> your fix, I extracted casper/filesystem.squashfs from the USB media with
> unsquashfs to a temporary ./squashfs-root/
> - I picked up
> http://archive.ubuntu.com/ubuntu/pool/main/c/casper/casper_1.413.tar.xz,
> and replaced ./squashfs-root/usr/share/initramfs-tools/scripts/ with the
> content of ./casper/scripts/ from that archive.
> - For good measure I also replaced the 4 files in
> ./squashfs-root/usr/share/casper/ with their latest version from
> ./casper/bin/ on the archive.
> - I then recreated the casper/filesystem.squashfs image with mksquashfs
> squashfs-root/ /mnt/usb_media/casper/filesystem.squashfs -noappend
> -always-use-fragments
>

This doesn't update the files where they matter though: the ones that
matter are in the initrd (casper/initrd in this case). So you'd need to
unpack that (it's multiple cpio archives concatenated together, although
for testing this we can only care about the last one), overwrite the casper
stuff in there and pack it up again.

Something like:

mkdir /tmp/initrd
cd /tmp/initrd
(cpio -t; cpio -t; lz4cat | cpio -i ) < /mnt/casper/initrd
cp /path/to/new/casper scripts/casper # etc
find . | LC_ALL=C sort | cpio -R 0:0 -o -H newc | gzip > ../initrd.new
cp ../initrd.new /mnt/casper/initrd

(this is all extremely obscure, yes)

- I added 'persistent' to the kernel options in grub.cfg then tried to boot
> the media on a UEFI system
>

> The end result was still a boot failure with the message "mount:
> mounting /cow on /root failed: Invalid argument", and I'm pretty
> confident the same will hold true (without having to go through the
> whole squashfs update) with the next Live ISOs that is generated on
> http://cdimage.ubuntu.com/daily-live/current/, so I don't believe the
> issue has been properly fixed...
>

All the above said, I didn't do anything to fix the problem you've hit here.

I don't understand why find_cow_device is written the way that it is. I
guess it must pre-date us having udev in the initrd because you can check
for a filesystem with the right label now by looking in /dev/disk/by-label
now. And when looking at vfat partitions that might or might not have a
casper-rw file, if it finds that the partition is mounted it could check
for the existence of the backing file _before_ it does mount games that it
then might have to undo. I'll see if I can rewrite it :)

Cheers,
mwh

--
> You received this bug notification because you are a member of Ubuntu
> Installer Team, which is subscribed to casper in Ubuntu.
> https://bugs.launchpad.net/bugs/1489855
>
> Title:
> Change to mount sequence order breaks persistence on casper-rw
> partitions
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1489855/+subscriptions
>