Diskless System

From ArchWiki

Jump to: navigation, search

Contents

Create a Diskless Archlinux-based System

Introduction

  • Flash-based systems are appearing at a fast pace. This wiki presents one way to employ flash drives in an archlinux based “LIVE” arrangement.
  • It is important to note that the system must operate from “IDE” in order that the flash drives utilized are recognized as “TRUE IDE” devices thus permitting full “UDMA” operability.
  • In addition, an adapter having “UDMA READY” must be used to interface the Compact Flash (CF) to the IDE 80-wire interface cable. The CF card(s) must also be “UDMA” rated.
  • The system herein described has no HDD's and can be described as “DISKLESS”.
  • Two CF/IDE interfaces are utilized. When employing CF/IDE adapters, only one such device is usable on a given IDE 80-wire cable at a time. A “slave” device can be provided on the adapter but it cannot be connected simultaneously with a “master” CF card on the same cable.
  • The present 2.6 kernels include provisions which eliminate the application of 80-wire cable parameters to IDE buses such that normal boots using standard kernels prevent “TRUE IDE” operation of the CF card(s).....thus, the operations are limited to UDMA 2 mode even if the UDMA RATING is much higher.
  • Therefore, the requirement for “IDE” operation of the system is imperative for maximum performance and applies to the remainder of this “DISKLESS SYSTEM”description.

System Details

  • Both the the primary and secondary IDE buses are utilized. The primary bus IDE cable has the “boot” CF card and the secondary bus IDE cable has a cachedir CF card,each having an adapter and connected via normal 80-wire cable.
  • The operation of these adapters is powered by the 4-pin power connector of the type provided to power the floppy peripheral device.
  • The system being described is archlinux based, with larch “Live” system elements and Faunos elements added. It utilizes pacman and aufs for its basic operational utility.

System Philosophy

  • Operate as much as possible in ram.
  • The primary CF card contains the boot Faunos system. It is squashfs compressed and has ~600 archlinux packages, includes pacman, aufs and PacTrac capability. It executes in ram as a r/o source.
  • The secondary CF card is used as a local cachedir to archive any and all upgrades to the operating system. As such it enables storage of downloaded packages for use at users discretion.
  • When loaded into the system via pacman/aufs, the packages are decompressed into ram and operate therein, entirely in ram.
  • Downloading packages into the cachedir permits the storage of several versions of a given package...the original package is NOT OVERWRITTEN, thus flash device life is unaffected. Also,the user can revert back to a previous version and it will be INSTALLED INTO RAM.!

System Consequences

  • The need to “SAVE SESSION” via the Faunos system is reduced or eliminated at the users discretion thus providing fastest reboot time. The feature is Larch system related and under revision at this writing.
  • “REBOOT” of the system without “SAVE SESSION” removes any and all packages added in ram via the use of the cachedir archive.
  • Adding packages in this manner allows checkout of new package impact on the system without interfering with the basic boot system.
  • Power savings are obvious!
  • Downloading via mirrors (many throttled) takes much time! The power required to download into HDD is nearly fully eliminated and CF cards incur no latency.
  • INSTALL from cachedir is at 40+MB/sec with UDMA 4,5.
  • System cache in /var/cache/pacman/pkg is not utilized.
  • PacTrac in Faunos provides a complete log of installed programs (including those installed toram by cachedir) and the last installed version as well as a listing of installable programs via pacman. This program is inherent in Faunos boot flash device.
  • Additional elements of video, graphics and text can be included in the cachedir . For example, a 1GB .avi. This video file can be entered in ram via tmpfs and the player via pacman into ram...then execution and data are all in ram. The tmpfs video file can be deleted and another video file inserted...ad infinitum!
                                                                                                                      ::*All is readonly for the flash drives after initial install of the video file(s) to cachedir. A text file to provide a paste of pacman install commands for cachedir package groups is also an aid to users if incorporated in the cachedir.
  • Larch systems would provide a similar capability except for the PacTrac that Faunos provides.
  • The cachedir appears in the system as a media disk.
  • All USB functions are available and a USB/HDD adapter permits access to external HDD data and storage. Also, external CD/DVD devices are similarly available.
  • Moore's law applies to flash devices!!!!!!!!!

Installation

  • This wiki is based on demonstrating the “LIVE” flash drive capabilities introduced by UDMA capable flash devices with archlinux based operational capabilities. Therefore, an archlinux-based installation is required. In this wiki, that is Faunos which is flash-installed, based on archlinux packages and Larch-derived install parameters.  ::*A 2GB compact flash drive is recommended with adapter, either for HDD use or a USB adapter, preferably a USB 2.0 unit.
  • Faunos is soon to be released in “STABLE” version. It is maintained by RAYMANO at faunos.com.
  • The download of faunos is installed via....
dd if=(faunOS download usb.img) of=/dev/sd(x)
  • Note: The....of=/dev/sdx....is important.....do not use ...of=/dev/sda1 for example...... Do not change the name of the download to ....faunos.img... becausethe download has that file within it and will only address that file.
  • When the flash drive is first ready to be booted, do not boot on it until you have re-sized the linux partition from 1GB to ~1500MB . Do so with gparted as root. Provide linux swap at this time if you desire.
  • When ready to boot, install in primary HDD slot with adapter and set bios to recognize the flash drive. Some flash units do not have a label, they appear as brackets [ ] but are fully functional as boot devices.
  • After reaching the Desktop, the internet parameters are established in WICD.
  • Editing of /etc files is then accomplished as desired. Reboot and save session.
  • The system can then be shut down to allow install of the CF/IDE in the secondary IDE cable.

Configuration Changes for UDMA CF/IDE

  • At this point, a change is necessary in the boot CF/IDE device in the primary IDE slot to enable IDE MODE OF SYSTEM OPERATION.

1. Boot into Faunos.
2. Select “log out”
3. Select “end session”
4. “log-in” as root with root password.
5. With “archlinux” desktop displayed, select kwrite editor.
6. Go to /lib/initcpio/hooks/larch/
7. change: ....................line (96):

for d in /dev-sd[a-z][0-9]* ; do

to................

for d in /dev[hs]d[a-z][0-9]*; do

1. Edit /usr/share/larch/initcpio/mkinitcpio.conf...... as follows;
2. hooks=”base udev fbsplash ide scsi usb larch1 larch2 larch3_aufs splashy”
3. Select “STORAGE DEVICES” and open the “livesys/livecd” device,
4. Delete file “faunos.img” to trash bin.
5. Perform the following to generate a new “faunos.img” in terminal as root:

mkinitcpio -c mkinitcpio -g faunos.img
  • Install the faunos.img thus generated into “livesys/livecd” in the place of the original faunos.img.

6. Reboot and “SAVE SESSION”.

Troubleshooting

  • The performance of the CF/IDE devices can be verified by use of hdparm.
  • All devices in “STORAGE DEVICES” are identified as “media”.

See forums for advice on boot problems or system related issues.

Cachdir Parameters

  • Loading of the cachedir via pacman is accomplished with the following command in terminal:
pacman –cachedir /media/disk -Sw (package name)

This places the named -i686.pkg.tar.gz in the cachedir. The locale of the downloaded package may be a previously established folder, in which case the /media/disk/folderID is used in the command.

  • Other files of interest may also be loaded from HDD via a primary IDE install or a flash drive via USB or an install via USB/HDD source. Additionally, pacman Syuw is usable:
pacman –cachedir /media/disk/upgrade -Syuw.........
  • Note:This assumes the generated “upgrade” folder.
  • Subsequent installs to cachedir do not overwrite existing packages, but make new entries.

Installing the package(s) is done with the following pacman command:

pacman -Ud /media/disk/upgrade/*-i686.pkg.tar.gz...

This example assumes the -Syuw case of installing all packages; they can be individually installed as desired.

  • Packages installed via pacman/aufs are in ram by default. w00t!

More Resources

Full disclosures of problems and solutions is provided in the FaunOS forums which has over a hundred registered users. This forum also includes a Larch forum hosted by Gradgrind.

Personal tools