[Bug 1489855] Re: Change to mount sequence order breaks persistence on casper-rw partitions

Michael Hudson-Doyle mwhudsonlp at fastmail.fm
Fri Jul 19 02:15:30 UTC 2019


On Thu, 18 Jul 2019 at 23:40, Akeo <pete at akeo.ie> 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
>

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, 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

Status in casper package in Ubuntu:
  Fix Released

Bug description:
  the system boots fine when using a casper-rw FILE but drops to a
  busybox when using a partition

  
  the short log would be:
  ___________________________________________________
  Begin: Running /scripts/casper-premount ... done.
  done.
  umount: can't umount /cdrom: Device or resource busy
  Warning: Unable to find the persistent home medium
  umount: can't umount /cdrom: Device or resource busy
  Warning: Impossible to include the casper-sn Snapshot
  umount: can't umount /cdrom: Device or resource busy
  Warning: Impossible to include the home-sn Snapshot
  done.
  ___________________________________________________

  removing the "persistence" keyword from the syslinux.cfg works and the live usb drive boots just fine.
  using a persistence file instead of the partition and the usb drive boots just fine.

  i found older bug reports concerning the same problem but the fix
  proposed in 2010 is already integrated into the script "casper".

  so i started the flashdrive with the casper debug= option and i see
  the following (after probing several other devices it finally finds
  the right device and partition (sdb3)

  ___________________________________________________

  + cow_backing_mp=/cdrom
  + [ -e /cdrom/casper-rw ]
  + umount /cdrom
  + sys2dev /sys/block/sdb/sdb3
  + sysdev=/block/sdb/sdb3
  + udevadm info -q name -p /block/sdb/sdb3
  + echo /dev/sdb3
  + devname=/dev/sdb3
  + /sbin/blkid -s LABEL -o value /dev/sdb3
  + [ casper-rw = casper-rw ]
  + echo /dev/sdb3
  + return
  + cowprobe=/dev/sdb3
  + [ -b /dev/sdb3 ]
  + cowdevice=/dev/sdb3
  + get_fstype /dev/sdb3
  + local FSTYPE
  + local FSSIZE
  + fstype
  + eval FSTYPE=ext4 FSSIZE=8458862592
  + FSTYPE=ext4 FSSIZE=8458862592
  + [ ext4 != unknown ]
  + echo ext4
  + return 0
  + cow_fstype=ext4
  + cow_mountopt=rw,noatime
  + mount -t ext4 -o rw,noatime /dev/sdb3 /cow
  + [ ! -d /cow/upper ]
  + mkdir -p /cow/upper
  + continue
  + continue
  + mkdir -p /cow/work
  + [ -f /cow/format ]
  + [ DEFAULT = DEFAULT ]
  + modprobe -q -b overlay
  + grep -q ^overlay$
  + cut -f2 /proc/filesystems
  + UNIONFS=overlay
  + break
  ___________________________________________________

  this looks fine to me.. it looks like it recognizes everything .. it's
  ext4 .. label casper-rw.. it's mounting it...

  a little bit further down in the loooong log file it states the
  following:

  ______________________________________________

  + cow_backing_mp=/home-rw-backing
  + [ -e /home-rw-backing/home-rw ]
  + umount /home-rw-backing
  + sys2dev /sys/block/sdb/sdb3
  + sysdev=/block/sdb/sdb3
  + udevadm info -q name -p /block/sdb/sdb3
  + echo /dev/sdb3
  + devname=/dev/sdb3
  + /sbin/blkid -s LABEL -o value /dev/sdb3
  + [ casper-rw = home-rw ]
  + get_fstype /dev/sdb3
  + local FSTYPE
  + local FSSIZE
  + fstype
  + eval FSTYPE=ext4 FSSIZE=8458862592
  + FSTYPE=ext4 FSSIZE=8458862592
  + [ ext4 != unknown ]
  + echo ext4
  + return 0
  + [ ext4 = vfat ]
  + homecow=
  + [ -b ]
  + [ n != y ]
  + log_warning_msg Unable to find the persistent home medium
  + _log_msg Warning: Unable to find the persistent home medium\n
  + [ n = y ]
  + printf Warning: Unable to find the persistent home medium\n
  Warning: Unable to find the persistent home medium
  __________________________________________________________

  
  a warning about the home medium is shown in both cases (file and partition) but the persistence file works never the less..

  
  my system:  

  kubuntu linux 15.10 beta1

  uname -a
  Linux wald 4.1.0-3-generic #3-Ubuntu SMP Tue Jul 28 12:25:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1489855/+subscriptions



More information about the foundations-bugs mailing list