LiveOS image

From Sugar Labs
Revision as of 00:31, 1 June 2010 by FGrose (talk | contribs)
Jump to navigation Jump to search


Introduction

Fedora has developed Live CD USB DVD images for their GNU/Linux operating system. Since the image file systems are stored in the /LiveOS folder of the image, this is the name we'll use to reference their product.

This page shares some information about the LiveOS design that helps Sugar on a Stick Learners make better use of their disc resources.

References

Storage

The Fedora LiveOS system allows for persistent storage in 3 ways:

  1. An all-purpose, persistent overlay - a compressed, write-once, fixed-size file space that will save updates and changes to the LiveOS image (Activities, operating system changes, anything written in the LiveOS file space).
  2. Persistent home folder - a re-writable, re-sizable (with difficulty), uncompressed, optionally-encryptable, file space for anything that goes in the Learner's /home/ folder (all the Sugar Activities, logs, and good stuff). A persistent home folder is an option that must be selected at the time of installation of the LiveOS image. This option is only available through the installation scripts, 'livecd-iso-to-disk' or 'modified_livecd-iso-to-disk'. The Windows and Fedora 'Live USB Creator' installers do not provide this option as of June 2010.
  3. Host device file space - this is the file system that is outside of the LiveOS file tree, but is accessible through the /mnt/live folder mount point. There, one finds the boot configuration files and anything else one had on the device before loading the SoaS image. One may save files here without consuming the other, limited file spaces. (This file space is limited by the device capacity).

The all-purpose, persistent overlay is needed for operating system changes and updates.

But, one may find many advantages to installing Sugar on a Stick with a persistent, home folder (using the --home-size-mb NN --delete-home options), which will hold all the Activities one wants to try and, perhaps later, throw away—all without consuming the write-once, overlay that can be consumed very quickly, because file space is un-reusable.

Additionally, keeping some storage space on the device disc outside of the LiveOS system will let you copy, carry, and delete large resource files, such as image.iso files, or anything you might want to use or share. (We should adjust the Journal code to show this root mount to facilitate file sharing.)

Sugar on a Stick may be installed on a 1-GB USB device using the following options with livecd-iso-to-disk or modified_livecd-iso-to-disk (on a single Terminal Activity or console command line, even though the wiki may wrap the following text in accord with your browser window size):

./livecd-iso-to-disk --overlay-size-mb 200 --home-size-mb 200 --delete-home --unencrypted-home /path/to/source/iso/or/device /dev/sd?1
where '?' in the final parameter represents the target bootable device node, such as sdb1 or sdc1, etc.
(You may use '\' line-continuation symbols followed by a newline [enter or return keypress] to break a long line visually on the terminal, but not logically to the script processing software.)

The above configuration would allow space for the home folder, the operating system, and a little on the device root.

But with a larger capacity device, one can allocate the resources to suit the anticipated use, as described above.

File Systems

The Fedora LiveOS uses the Device-mapper service of the Linux kernel to manage the file stores on the device. This is the same service that is used by Logical Volume Manager to provide disc partition services.

One limitation, mentioned above, is that the LiveOS persistent overlay is a write-once file space. This is related to its use of device mapper snapshots to merge a read-only file system image with a Copy-on-write service that tracks only changed bits of data in the snapshot file and then re-referencing any pointers to any updated bits. Any changes to the operating system files are stored as differences from the base. As such, "deletions" of files are saved as additional difference references, and the originals are hidden, and so, physical storage space is consumed in the write-once file space rather than recovered.

To track the consumption of the space allocated for persistent storage, the snapshot overlay file, the device mapper service dmsetup provides a status report. Sugar Cellar is a small, utility script which uses that service to allow for Learner testing and discovery. This will help Learners manage their storage resources and learn ways to economize limited resources.