Home
| About
| Gallery | Tips | Download | Release
Notes
Architecture: Layered File System | What is an SFS
and How to Install?
| Compare PET vs. SFS
(Based on http://puppylinux.com/development/howpuppyworks.html) by Barry Kauler
The way to
understand the diagram
is to view each of those layers as
a complete filesystem, that is, a complete directory hierarchy from "/"
down. These layers are laid one on top of the other, which is achieved
by the aufs/unionfs filesystem. The way it works is very simple: say
that
the red (core system) layer has a file /usr/lib/libcairo.so. This file
will
be
visible at the top layer. If a blue (extra SFS) layer has the same
file,
it will not be visible, as it is overlaid by the same file on a higher
layer.
Anyway, here is a description of
each layer:
ram
disk Temporary Storage
|
This
is the tmpfs filesystem
running in RAM, with new and changed files.
It is the top layer at first boot from LiveCD with puppy pfix=ram
entered at the boot menu.
|
LHPsave.4fs
'pupsave'
|
This
is the persistent storage,
where all your data, settings, email, installed packages, etc., get
saved permanently. The ".4fs" means that the file contains a ext4
filesystem. If the host partition is not formatted with ext4, or the
LHPsave is encrypted, then it would be .3fs or .2fs.
When saving your session to an LHPsave file this becomes the new top
layer instead of the ram disk.
|
LHP_nnn.sfs
|
This
is Lighthouse. The kernel, built-in
applications, window manager, scripts, everything. The ".sfs" means the
file contains a squashfs compressed filesystem. The "nnn" is the
Lighthouse
version number without the dots, for example "503".
|
*.sfs
or *_nnn.sfs
|
These
are additional squashfs
files. The "*" can be anything, as long as its name does not begin with a 'z' or
distro-specific prefixes, like LHP, pup, wary, luci etc.
For example, Devx-LHP_503.sfs is the
complete environment for compiling C/C++ applications. Again, the
"_nnn", if present, is the
Lighthouse
version number. |
What needs to be emphasized,
however is that all of this is "under
the hood". While running Lighthouse, all you see is one file system,
which is
the top layer. So you see /usr/lib/libcairo.so and you don't care
what layer it is actually in.
What is an SFS?
SFS (Squash File System) add-ons
are typically compressed software files, (a 'filesystem in a file')
that are layered
into the LHP file system during boot up from LiveCD /
pfix=ram,
or a Frugal Install and initially
take up no space in the save file.
Each SFS is a separate read-only layer, (blue in the diagram above.)
They often include many apps, all in one 'combo-pack'. Lighthouse
supports
up to 40 concurrent SFS add-ons. Several popular ones are included in
the Lighthouse
Mariner ISO. Those and many more can
be found here.
How to install an SFS
With a Frugal Install,
place
them in
/mnt/home
e.g., /mnt/home/LibreOffice.sfs This is the top
level
directory of
the partition where your save file is. (/mnt/home is
actually a
symlink to the root of that partition.)
As of LHP 5.00 G, if the save file
is in a subdirectory, SFS files can be
placed in either the top directory or in that subdirectory, e.g., /mnt/home/lhp503/LibreOffice.sfs
Then, using BootManager in the
System
menu, move desired SFS's to the
right-hand pane, click OK and reboot.
If the SFS file name ends with _nnn it
must
match the LHP version you have, e.g., Devx-LHP_503.sfs
for LHP 5.03.
What is unique about the way Lighthouse uses an SFS?
- SFS add-ons can be
selected and
configured at first or any boot,
prior
to
mounting the layered file system.
- These are layered into the
main file system, each SFS in a separate layer, the same way
BootManager does it, but at any boot, including LiveCD. After the first
boot, a standard Frugal
Install
is recommended for proper layering of SFS files.
-
If sufficient free RAM is
detected,
all core files and SFS add-ons can be copied to RAM. This means the Lighthouse Mariner ISO is a true LiveCD with
the Mariner add-ons & LibreOffice running
in RAM at
first boot. To select the SFS
at first boot from the LiveCD, it must be present in the top-level of
the CD, which is the case in the Mariner ISO.
-
If any .sfs add-ons are
found, before they are loaded, a brief prompt during boot-up is offered
to select and
configure them, (Press Enter within 5 secs...) The SFS configuration
allows you
to choose which add-ons you'd like to use that session, and whether or
not to copy them
to RAM. Skip the prompt and use all SFS selected in prior configuration
/ BootManager / default selections from
LiveCD.
-
Available free RAM is
recalculated
after each copy2ram. If RAM is low,
only SFS files that will safely fit in RAM will be copied and the rest
will mount in place. This way all selected add-ons will be loaded,
making maximum use of available RAM.
- Lighthouse may or may not include
support for loading and unloading SFS add-ons from the desktop without
rebooting, and not at all with a
full install. Shinobar has written an
experimental utility called SFS_Load-on-the-fly and other
methods are discussed here and here.
Which is better,
PET packages or SFS
files?
Personal preference is often the deciding factor.
That said, SFS files are ideal for large apps e.g., LibreOffice or
combo-packs of many apps, e.g., Mariner or KDE, because they reside
compressed, typically at /mnt/home and use little or no space in the
LHPsave file. PETS on the other hand, are easily installed without
rebooting and thus are ideal for smaller packages or frequent updates,
e.g., Sylpheed, printer drivers, Flash and browsers. PETS are a bit
easier to build and often use pinstall.sh and puninstall.sh scripts
ideal for handling setup and uninstall tasks.
SFS files are designed to load individually, each in
a separate read-only layer,
whereas PETS are all in the same read-write (yellow LHPsave file)
layer. There is a limit to the number of SFS files that can be loaded
at the same time, (40 in Lighthouse) whereas the number of PETS is
practically unlimited.
I'm currently running Lighthouse64 with about 15 SFS files (not
counting the
main file
and zWine) as well as a dozen or so PETS.
Because SFS files are layered in below the core (main file) layer,
they are less apt to cause version conflicts with system files and
shared libraries. So if the same files are in both an SFS/PET and the
core system, system stability and reliability is usually not affected
by the SFS, but could be with a PET.
See also http://puppylinux.com/development/howpuppyworks.html
and http://puppylinux.com/faq.htm