SBUML -ScrapBook for User-Mode Linux-
    »  About
    »  HowTo
    »  Techniques
    »  Reference
       »  Browser Helper Application
       »  Directory Layout
       »  The rh72c Distribution
       »  Restoring Old Snapshots
       »  Kernel/Scripts Interface
    »  FAQ
    »  Miscellaneous
    »  Contact
»  Site Map

Directory Layout

When used with the default directory layout, the only changes SBUML makes to the host Linux system (except for a few very small files in /tmp) are inside the sbumldemo directory. This makes installation and removal simple with ordinary Linux commands.

In SBUML, both UML machines and snapshots of machines are represented as directories, which are also saved by default inside the sbumldemo directory. Machines are kept separated from snapshots to avoid confusing them. The default layout for SBUML's directories is this:

sbumldemo/kernel/ - the binary (UML Linux kernel with SBUML extensions)
sbumldemo/scripts/ - higher-level scripts that implement the SBUML commands
sbumldemo/support-bin/ - support binaries (ignored if already on the host Linux)
sbumldemo/bases/ - base disk images of Linux distributions
sbumldemo/machines/ - default location to put directories that contain active machine runtime state and hibernated machines
sbumldemo/snapshots/ - default location to put directories that hold frozen machine snapshots

Therefore if a user types in the command sbumlboot mymachine, the machine's state will be put in the directory sbumldemo/machines/mymachine. If user issues the command sbumlsave mymachine new-snapshot, the snapshot information is put in the directory sbumldemo/snapshots/new-snapshot-uniquesuffix.

Specifying specific machine and snapshot locations
Full directory paths can be used to place specific machines or snapshots in other locations. For example,

$ sbumlboot /mnt/big-ramdisk/m1
will boot a new machine and save its state in /mnt/big-ramdisk/, assuming big-ramdisk exists.

$ sbumlquick /mnt/cdrom/demo2
will look on the cdrom for the snapshot to restore.

The general rule is that machine and snapshot parameters that start with "/", "./", or "~" are treated as normal Linux directories. Other names are relative to the sbumldemo/machines/ and sbumldemo/snapshots/ directories.

One exception is giving the single letter m as a machine name. Since machines are often temporary, the name is often not important to the user. Therefore, the user can let SBUML choose an unused directory name in the default machine directory with the special name "m". For example, $ sbumlboot m will boot a new machine with the first unused name of the form m1, m2, m3, etc.

Using "./" to specify a snapshot is sometimes convenient because it works naturally with bash completion. For example, if the shell's current working directory is changed to sbumldemo/snapshots/, the user can type ./rh72c-32 followed by the tab key and bash will list all the snapshots that match that prefix.

Changing the default directory locations
SBUML uses the default directories locations that are specified in the file sbumldemo/scripts/sbuml.rc. However, this file is recreated every time sbumlinitdemo is run, so the best way to change the default directories is to edit them in the file sbumldemo/scripts/this_sbumlinitdemo and then run sbumlinitdemo again. One reason to do this might be to have machines be created on a different physical drive so that state is copied faster between machines and snapshots.

 Printable Version