Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The operating system image in a Fedora LiveCD or LiveUSB can be mounted after exposing the embedded root filesystem. Fedora's livecd-tools package provides a utility <a href="https://github.com/rhinstaller/livecd-tools/blob/master/tools/liveimage-mount" rel="nofollow">liveimage-mount</a> that does this using Python.</p> <p>The <a href="https://fedoraproject.org/wiki/LiveOS_image" rel="nofollow">Fedora LiveOS image</a> (Live CD/USB operating system) technology uses the Device-mapper snapshot target to make a compressed, read-only copy of the root filesystem available for read-write mounting at boot time, where filesystem writes go into a temporary or persistent copy-on-write overlay. Everything is accomplished with the <code>dmsetup</code> command. LVM is not involved (although it also uses Device-mapper technology).</p> <p>A LiveOS installed device will have a /LiveOS/ directory in it's base filesystem. The /LiveOS/squashfs.img file contains a compressed (and read-only) ext4 filesystem that itself contains a /LiveOS/ directory and within that the distributed root filesystem in a file named ext3fs.img. So, the squashfs.img file contains a directory and file, /LiveOS/ext3fs.img, that itself contains the root filesystem (with /bin, /boot, /dev, /etc, /home, ...).</p> <p>If there is a persistent overlay file installed on the device, it will be saved as<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/LiveOS/overlay-&lt;LABEL&gt;-&lt;UUID&gt;<br> where LABEL and UUID are the device partition label and UUID as reported by the following command,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>lsblk -o LABEL,UUID</code></p> <p>One can programmatically</p> <ol> <li>loop mount the squashfs.img file, then</li> <li>set up a loop device for the ext3fs.img file found in mount 1.</li> <li>If there is no persistent overlay, you may simply mount the ext3fs.img file or loop device from<br> step 2 (the read-only, base image).</li> <li>If there is a persistent overlay file, set up a loop device for it.</li> <li><p>Determine the size of the root filesystem in units of 512-byte sectors, </p> <p><code>blockdev --getsz &lt;basefs_loop&gt;</code></p></li> <li><p>Then setup a Device-mapper snapshot target with this general command, </p> <p><code>dmsetup create &lt;target_name&gt; --table "0 &lt;size&gt; snapshot &lt;basefs_loop&gt; &lt;overlay_loop&gt; P 8"</code></p></li> <li><p>Finally, mount the Device-mapper target on a desired mount point, </p> <p><code>mount /dev/mapper/&lt;target_name&gt; &lt;mount point&gt;</code></p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload