3

When I run the live image (Ubuntu 18.04), it shows the root filesystem being an overlay with the squashfs image (/cdrom/casper/filesystem.squashfs, containing the main data) as lower layer, and /cow/upper as upper layer. But /cow is not visible anymore as it is hidden by the overlay mounted on root.

Where (on what device) does the upper layer live? Is it accessible somewhere or is it a memory-only device?

JanKanis
  • 673
  • 9
  • 14
  • 1
    Is there any way to access it? (Just for the fun of it, as it is lost on reboot) – JanKanis Dec 21 '18 at 12:50
  • Were you able to find a method to access it? – Martian2020 Dec 01 '21 at 00:09
  • 1
    Hi @Martian2020, that's a long time ago. I don't have a live image of Ubuntu 18.04 around anymore. I'm not sure if I managed to access the uppler layer, but I don't remember being able to do so. My idea was to re-mount /cow/upper somewhere else to be able to access it, but for that I needed to know its device. – JanKanis Dec 01 '21 at 11:14

2 Answers2

2

COW stands for copy-on-write, In the case of live media it refers to the changes that are made to the live environment. It is accessible if you boot live iso in persistence mode, in that case it is written to the drive, folder or casper-rw container file you specify. But if persistence mode is not enabled it is just a memory only device.

There are many articles available on askubuntu regarding persistence.

harshit
  • 169
0

Access Casper-rw file

You can mount casper-rw file and access contents within using:

sudo mkdir /media/casper

sudo mount -o loop casper-rw /media/casper/

C.S.Cameron
  • 19,519
  • thanks for quick reply, give me time to check ;-) – Martian2020 Dec 01 '21 at 03:19
  • "failed to setup loop device for casper-rw". btw booted w/out persistence, but that is expected, right? cause with persistence contents are clearly visible on USB. – Martian2020 Dec 01 '21 at 03:28
  • How did you make your persistent USB? Rufus, Unetbootin, mkusb, Yumi, dd or what? What version of Ubuntu? Does it use "writable" or "casper-rw" file. – C.S.Cameron Dec 01 '21 at 03:48
  • That particular USB was made long time ago, it is now booted for further testing. cat /etc/os-release: 20.04 LTS. How to check for "writable" part of the question? – Martian2020 Dec 01 '21 at 04:07
  • I just have an idea: I can boot it with "toram" and have both running system and USB stick to examine. But could toram change the procedure to access upper layer for /? – Martian2020 Dec 01 '21 at 04:13
  • meanwhile I've done similar mount -o loop writable and got similar failed to setup – Martian2020 Dec 01 '21 at 04:25
  • Does your USB use persistent file or persistent partition? A persistent file is generally located in the FAT32 root partition of a USB made using UNetbootin. Universal, Ventoy and YUMI. Mkusb and Rufus use persistent partitions., – C.S.Cameron Dec 01 '21 at 05:44
  • I think you mix this with my question https://askubuntu.com/questions/1378503/persistence-how-to-modify-location-of-upper-and-work-directories/1378519. This one says nothing about persistence, I booted w/out it, re-booted "toram" and it is booted now that way, USB unplugged. I'd like to see which files are created in upper layer. – Martian2020 Dec 01 '21 at 05:50