Subsections


1.1 HD - Support For Harddisks, Flash-Cards, USB-Sticks, ...


1.1.1 OPT_HDINSTALL - Installation On A Harddisk/CompactFlash

fli4l supports a large variety of boot media (CD, HD, Network, Compact-Flash,...). Floppy Disks are not supported anymore due to filesize regressions.

All steps necessary to install to a harddisk are explained below.

The usual way is installation via a physical boot medium. Installing via network boot is possible too. OPT_HDINSTALL prepares the harddisk. If boot medium and installation target share the same BOOT_TYPE='hd' installation files will be transferred immedeately. If direct transfer is not possible the files will be transferred later via scp or remote update using Imonc.

An Overview to the different harddisk installation variants A or B is found at the Beginning of the documentation for fli4l. Please read carefully before proceeding!

1.1.1.1 HD-Installation In Six Simple Steps

  1. create a bootable fli4l medium with package BASE and OPT_HDINSTALL. This medium must be able to perform remote updates. Either OPT_SSHD must be activated or OPT_IMOND is set to 'yes'. If additional drivers not contained in the standard installation are necessary to access the harddisk, configure OPT_HDDRV as well.
  2. boot the router with the installation medium.
  3. log in to the router console and execute ``hdinstall.sh''.
  4. transfer the files syslinux.cfg, kernel, rootfs.img, opt.img and rc.cfg via scp or Imonc to the router's /boot directory if prompted to. It is recommended to work with two fli4l directories, one for the setup and a second for the hd installation. In the HD version, set the variable BOOT_TYPE='hd' and for the boot media type according to its type.


    During remote update the files for the hd-version have to be copied!

  5. unload boot medium, shut down the router and reboot again (by using halt/reboot/poweroff). The router will boot from harddisk now.
  6. if problems occur please refer to the following text.

1.1.1.2 HD-Installation Explained In Detail (including examples)

First, a router boot media containing the installation scripts and additional drivers (eventually) has to be created. Activate OPT_HDINSTALL in config/hd.txt and OPT_HDDRV (only if additional drivers are needed). Please read the section on OPT_HDDRV thoroughly!

The variable BOOT_TYPE in base.txt has to be set in accordance with the chosen setup media. After all, a setup has to be performed... The variable MOUNT_BOOT in base.txt has to set to 'rw', in order to allow saving new archives (*. img) loaded over the network.

Then boot the router from this setup medium. Run the installation program by executing ``hdinstall.sh'' at the fli4l sonsole . After answering a few questions the installion on the hard drive is performed. Eventually you will be prompted to load files needed for the router via remote update.


Don't forget this remote update, otherwise the router won't boot from harddisk. To reboot the routers after remote update use reboot/halt/poweroff, otherwise your remote update changes will be lost.

The installation script may be started directly at the router console or via ssh from another PC. This way you have to log in by giving a password. As an ssh client you may use the freeware 'putty'.

1.1.1.3 Configuration Of The Setup Bootmedia


Table 1.1: Configuration example of a setup media
BOOT_TYPE set according to type of bootmedia for the installation
MOUNT_BOOT='rw' necessary to copy new archives (*.img) to the harddisk over network
OPT_HDINSTALL='yes' necessary to have the setup script and tools for formatting of partitions on the bootmedia
(OPT_HDDRV='yes') only necessary if harddisk needs special drivers
OPT_SSHD='yes' after preparation of the harddisk eventually files have to be copied via remote update. You will either need sshd, imond (IMOND='yes') or another package allowing file transfers.


At this point network configuration has to be completed in order to be able to copy files over the network later. Please do not activate DNS_DHCP at this point because this may cause all kinds of errors (the DHCP-server maybe already have a lease file for the router to be installed). For a remote update via scp (package SSHD) please set up OPT_SSHD='yes'. As an alternative you may transfer files via IMOND. This needs a complete and working configuration for DSL or ISDN. Please omit all packages not mentioned, i.e. no DNS_DHCP, SAMBA_LPD, LCD,Portforwarding a.s.o.

In case that the installations stops with the error message

    *** ERROR: can't create new partition table, see docu ***
several problems may have occurred: In the last step the final configuration files can be set up and all other packages needed may be added to the router.

1.1.1.4 Examples For Completed Installations Type A and B:

An example for each configuration is to be found in table 1.2.


Table 1.2: Example for an installation according to type A or B
BOOT_TYPE='hd' necessary because we are booting from harddisk now
MOUNT_BOOT='rw|ro|no' choose one. For copying new fli4l archives to harddisk over network 'rw' is needed.
OPT_HDINSTALL='no' not needed after successful installation.
OPT_MOUNT activate only if a data partition was configured
(OPT_HDDRV='yes') only necessary if harddisk can't be used without additional drivers.


Creation of a swap-partition will only be available if the router has less than 32MB RAM and the installation target is NO flash media!


1.1.2 OPT_MOUNT - Automatic Mounting Of Filesystems

OPT_MOUNT mounts data partitions created during installation to /data, file system checks will be performed automatically when needed. CD-ROMs will be mounted to /cdrom if a CD is inserted. For swap-partitions OPT_MOUNT is not needed!


OPT_MOUNT reads the configuration file hd.cfg on the boot-partition and mounts partitions mentioned there. If OPT_MOUNT was transferred via remote update to an already installed router this file has to be edited manually.


While booting from CD-ROM OPT_MOUNT can't be used. The CD may be mounted by setting MOUNT_BOOT='ro'.

The file hd.cfg on the DOS-partition for a router according to type B with swap and data partition looks like this (example):

        hd_boot='sda1'
        hd_opt='sda2'
        hd_swap='sda3'
        hd_data='sda4'
        hd_boot_uuid='4A32-0C15'
        hd_opt_uuid='c1e2bfa4-3841-4d25-ae0d-f8e40a84534d'
        hd_swap_uuid='5f75874c-a82a-6294-c695-d301c3902844'
        hd_data_uuid='278a5d12-651b-41ad-a8e7-97ccbc00e38f'

Just omit non-existent partitions, a router according to type A without further partitions looks like this:

        hd_boot='sda1'
        hd_boot_uuid='4863-65EF'


1.1.3 OPT_EXTMOUNT - Manual Mounting Of File Systems

OPT_EXTMOUNT mounts data partitions to any chosen mountpoint in file system. This allows to mount file systems created manually and for example provide a rsync-server directory.

EXTMOUNT_N

Number of manually created data partitions to be mounted.

EXTMOUNT_x_VOLUMEID

Device, label or UUID of the volume to be mounted. By executing 'blkid' device, label and UUID of all volumes can be displayed.

EXTMOUNT_x_FILESYSTEM

The file system used for the partition. fli4l supports isofs, fat, vfat, ext2, ext3 und ext4 at the time of writing.
(The default setting EXTMOUNT_x_FILESYSTEM='auto' automatically tries to determine the file system used.)

EXTMOUNT_x_MOUNTPOINT

The path (Mountpoint) to where the device should be mounted. It does not have to exist and will be created automatically.

EXTMOUNT_x_OPTIONS

Specify special options to be passed to the 'mount' command here.

EXTMOUNT_x_HOTPLUG

redWenn diese Variable den Wert `yes' enthält, ist es kein Fehler, wenn zur Boot-Zeit die Datenpartition nicht existiert. In diesem Fall wird davon ausgegangen, dass der zugehörige Datenträger fehlt und ggf. später eingebunden wird (z.B. via SATA-Hotplugging oder als USB-Stick). Das Aktivieren dieser Option erfordert zwingend OPT_AUTOMOUNT='yes'. Des Weiteren muss zur Identifikation der gewünschten Datenpartition die eindeutige Kennung (UUID) des Dateisystems in EXTMOUNT_x_VOLUMEID eingetragen werden; andere IDs wie Gerätename oder Label werden nicht unterstützt.

Example:

       EXTMOUNT_1_VOLUMEID='sda2'        # device
       EXTMOUNT_1_FILESYSTEM='ext3'      # filesystem
       EXTMOUNT_1_MOUNTPOINT='/mnt/data' # mountpoint for device
       EXTMOUNT_1_OPTIONS=''             # extra mount options passed via mount -o
       EXTMOUNT_1_HOTPLUG='no'           # device must exist at boot time


1.1.4 OPT_AUTOMOUNT - automatisches Einhängen von Datenpartitionen

redOPT_AUTOMOUNT='yes' erlaubt es, Datenpartitionen automatisch und dynamisch während der Laufzeit einzuhängen. Es gibt zwei Konfigurationsvarianten. Die erste arbeitet mit OPT_EXTMOUNT zusammen und hängt nur Datenpartitionen ein, die beim Booten gefehlt haben. Die zweite ist unabhängig von OPT_EXTMOUNT und hängt alle lesbaren Datenpartitionen ein, egal ob bereits während des Bootens oder erst später. Steuern lässt sich das Verhalten mit Hilfe der Variablen AUTOMOUNT_UNKNOWN:

AUTOMOUNT_UNKNOWN

redDiese Variable steuert, ob unbekannte Datenpartitionen eingehängt werden. Mit AUTOMOUNT_UNKNOWN='no' werden nur Datenpartitionen dynamisch während der Laufzeit eingehängt, die einem EXTMOUNT_x-Eintrag entsprechen. Dazu muss zusätzlich EXTMOUNT_x_HOTPLUG='yes' definiert sein, damit OPT_EXTMOUNT nicht meckert, wenn die Datenpartition beim Booten fehlen sollte. Mit AUTOMOUNT_UNKNOWN='yes' werden auch unbekannte Datenpartitionen eingehängt. Dies funktioniert aber nur, wenn das Dateisystem auf der Datenpartition eine eindeutige Kennung (UUID) besitzt. In diesem Fall wird die Datenpartition in dem Verzeichnis /media/<UUID> eingehängt (dieses Verzeichnis wird bei Bedarf erzeugt).

Standard-Einstellung: AUTOMOUNT_UNKNOWN='no'

AUTOMOUNT_UNKNOWN_OPTS

redDiese Variable gibt die mount-Optionen an, die bei unbekannten Datenpartitionen beim Einhängen verwendet werden. Ist die Datenpartition über OPT_EXTMOUNT in der /etc/fstab identifizierbar, dann werden die hier angegebenen Optionen nicht benutzt; vielmehr werden die Optionen im passenden EXTMOUNT_x_OPTIONS-Eintrag genutzt.

Standard-Einstellung: AUTOMOUNT_UNKNOWN_OPTS='ro' (damit werden Schreibzugriffe auf unbekannte Datenpartitionen standardmäßig verhindert)

redJede Datenpartition wird vor dem Einhängen mit Hilfe des für das jeweilige Dateisystem verfügbaren Prüfprogramms auf Fehler überprüft (e2fsck für ext2/ext3/ext4-Dateisysteme und fsck.fat für (V)FAT-Dateisysteme). Schlägt die Prüfung oder die automatische Korrektur fehl, wird das Dateisystem nicht eingehängt, um Datenkorruption zu vermeiden.

Wird ein Gerät entfernt, auf dem ein Dateisystem eingehängt war, wird dies nachträglich via umount ausgehängt. Natürlich können dabei womöglich noch nicht geschriebene Daten nicht mehr gesichert werden (schließlich ist der Datenträger nicht mehr da), aber immerhin kann nicht mehr versucht werden, auf den nicht mehr vorhandenen Datenträger weiter zuzugreifen. Die korrekte Vorgehensweise ist natürlich erst das Dateisystem auszuhängen und dann den Datenträger zu entfernen. Weil nicht alle Gerätetypen ein Entfernen verhindern, wenn das Dateisystem eingehängt ist (beispielsweise funktioniert dies gut bei CD-Laufwerken), muss man sich unter Umständen selbst um die korrekte Reihenfolge der+ Aktionen kümmern.

Alle Aktivitäten von OPT_AUTOMOUNT werden in der Datei /var/log/automount.log protokolliert. Ein beispielhafter Ausschnitt einer solchen Log-Datei wird im Folgenden gezeigt. Zuerst kommt der Abschnitt, der die Aktivitäten für Datenpartitionen aufzeigt, die bereits während des Bootens verfügbar sind (ACTION=change):

[2015-04-25 00:33:35] [INFO   ] ACTION=change SUBSYSTEM=block DEVNAME=vda1 DEVPATH=/devices/pci0000:00/0000:00:08.0/virtio4/block/vda/vda1 MDEV=vda1
[2015-04-25 00:33:35] [INFO   ] TYPE: vfat
[2015-04-25 00:33:35] [INFO   ] UUID: 442e-93ba
[2015-04-25 00:33:35] [INFO   ] mount point: /media/442e-93ba
[2015-04-25 00:33:35] [ERROR  ] /dev/vda1 already mounted on /boot, giving up
[2015-04-25 00:33:35] [INFO   ] ACTION=change SUBSYSTEM=block DEVNAME=vda2 DEVPATH=/devices/pci0000:00/0000:00:08.0/virtio4/block/vda/vda2 MDEV=vda2
[2015-04-25 00:33:35] [INFO   ] TYPE: ext3
[2015-04-25 00:33:35] [INFO   ] UUID: 77ab35b3-029e-42c9-93a0-d197c01e6e89
[2015-04-25 00:33:35] [INFO   ] mount point: /media/77ab35b3-029e-42c9-93a0-d197c01e6e89
[2015-04-25 00:33:35] [INFO   ] /dev/vda2: clean, 671/26208 files, 57544/104420 blocks
[2015-04-25 00:33:35] [NOTICE ] /dev/vda2 mounted on /media/77ab35b3-029e-42c9-93a0-d197c01e6e89
[2015-04-25 00:33:36] [INFO   ] ACTION=change SUBSYSTEM=block DEVNAME=vda3 DEVPATH=/devices/pci0000:00/0000:00:08.0/virtio4/block/vda/vda3 MDEV=vda3
[2015-04-25 00:33:36] [INFO   ] TYPE: ext3
[2015-04-25 00:33:35] [INFO   ] UUID: 1580b80c-92b1-4492-abfa-92a12a7d2027
[2015-04-25 00:33:35] [INFO   ] mount point: /media/1580b80c-92b1-4492-abfa-92a12a7d2027
[2015-04-25 00:33:35] [ERROR  ] /dev/vda3 already mounted on /data, giving up
[2015-04-25 00:33:35] [INFO   ] ACTION=change SUBSYSTEM=block DEVNAME=vdb1 DEVPATH=/devices/pci0000:00/0000:00:0a.0/virtio5/block/vdb/vdb1 MDEV=vdb1
[2015-04-25 00:33:35] [INFO   ] TYPE: ext3
[2015-04-25 00:33:35] [INFO   ] UUID: 4c1a03e1-3a0c-4835-88dc-a51879def464
[2015-04-25 00:33:35] [INFO   ] mount point: /mnt/extra
[2015-04-25 00:33:35] [ERROR  ] /dev/vdb1 already mounted on /mnt/extra, giving up
[2015-04-25 00:33:35] [INFO   ] ACTION=change SUBSYSTEM=block DEVNAME=vdc1 DEVPATH=/devices/pci0000:00/0000:00:1f.0/virtio6/block/vdc/vdc1 MDEV=vdc1
[2015-04-25 00:33:35] [INFO   ] TYPE: vfat
[2015-04-25 00:33:35] [INFO   ] UUID: ba6e-9ebd
[2015-04-25 00:33:35] [INFO   ] mount point: /media/ba6e-9ebd
[2015-04-25 00:33:35] [INFO   ] fsck.fat 3.0.26 (2014-03-07)
[2015-04-25 00:33:35] [INFO   ] /dev/vdc1: 0 files, 0/32672 clusters
[2015-04-25 00:33:35] [NOTICE ] /dev/vdc1 mounted on /media/ba6e-9ebd

redZwei Datenpartitionen wurden eingehängt (/dev/vda2 und /dev/vdc1), davon wurden beide nicht via OPT_EXTMOUNT konfiguriert und somit unterhalb von /media eingehängt. Die verbliebenen drei Datenpartitionen /dev/vda1, /dev/vda3 und /dev/vdb1 wurden bereits von anderen Boot-Skripten eingehängt und entsprechen der Boot- und der Datenpartition sowie einer benutzerdefinierten OPT_EXTMOUNT-Datenpartition.

Jetzt werden /dev/vdb1 und /dev/vdc1 ausgehängt (ACTION=remove; die Warnung, dass /dev/vdb1 beim Aushängen nicht in der Volumen-Datenbank gefunden wurde, ist harmlos und weist darauf hin, dass diese Datenpartition bereits während des Bootens von OPT_EXTMOUNT und nicht von OPT_AUTOMOUNT eingehängt wurde)...

[2015-04-25 00:34:52] [INFO   ] ACTION=remove SUBSYSTEM=block DEVNAME=vdb1 DEVPATH=/devices/pci0000:00/0000:00:0a.0/virtio5/block/vdb/vdb1 MDEV=vdb1
[2015-04-25 00:34:52] [WARNING] /dev/vdb1 not found in volume database
[2015-04-25 00:34:52] [INFO   ] mount point: /mnt/extra
[2015-04-25 00:34:52] [NOTICE ] /dev/vdb1 unmounted from /mnt/extra
[2015-04-25 00:34:55] [INFO   ] ACTION=remove SUBSYSTEM=block DEVNAME=vdc1 DEVPATH=/devices/pci0000:00/0000:00:1f.0/virtio6/block/vdc/vdc1 MDEV=vdc1
[2015-04-25 00:34:55] [INFO   ] UUID: ba6e-9ebd
[2015-04-25 00:34:55] [INFO   ] mount point: /media/ba6e-9ebd
[2015-04-25 00:34:55] [NOTICE ] /dev/vdc1 unmounted from /media/ba6e-9ebd

red...und in umgekehrter Reihenfolge wieder eingehängt (ACTION=add):

[2015-04-25 00:35:14] [INFO   ] ACTION=add SUBSYSTEM=block DEVNAME=vdb1 DEVPATH=/devices/pci0000:00/0000:00:0b.0/virtio5/block/vdb/vdb1 MDEV=vdb1
[2015-04-25 00:35:14] [INFO   ] TYPE: vfat
[2015-04-25 00:35:14] [INFO   ] UUID: ba6e-9ebd
[2015-04-25 00:35:14] [INFO   ] mount point: /media/ba6e-9ebd
[2015-04-25 00:35:15] [INFO   ] fsck.fat 3.0.26 (2014-03-07)
[2015-04-25 00:35:15] [INFO   ] /dev/vdb1: 0 files, 0/32672 clusters
[2015-04-25 00:35:15] [NOTICE ] /dev/vdb1 mounted on /media/ba6e-9ebd
[2015-04-25 00:35:18] [INFO   ] ACTION=add SUBSYSTEM=block DEVNAME=vdc1 DEVPATH=/devices/pci0000:00/0000:00:0c.0/virtio6/block/vdc/vdc1 MDEV=vdc1
[2015-04-25 00:35:18] [INFO   ] TYPE: ext3
[2015-04-25 00:35:18] [INFO   ] UUID: 4c1a03e1-3a0c-4835-88dc-a51879def464
[2015-04-25 00:35:18] [INFO   ] mount point: /mnt/extra
[2015-04-25 00:35:18] [INFO   ] /dev/vdc1: recovering journal
[2015-04-25 00:35:18] [INFO   ] /dev/vdc1: clean, 11/16384 files, 7477/65488 blocks
[2015-04-25 00:35:18] [NOTICE ] /dev/vdc1 mounted on /mnt/extra

redDas ``unsaubere'' Aushängen des ext3-Dateisystems auf /dev/vdc1 hat zu einer ``recovering journal''-Meldung beim Einhängen geführt, die aber nicht kritisch ist, da keine weiteren Fehler gefunden wurden.


1.1.5 OPT_HDSLEEP - Setting Automatic Sleep Mode For Harddisks

A harddisk can power down after a certain time period without activity. The disk will save power and operate quiet then. Accessing the harddisk will cause it to automatically spin up again.


Not all harddisks tolerate frequent spinup. Don't set the time for spindown too short. Older IDE-disks don't even have this function. This setting is also senseless for Flash-Media.

HDSLEEP_TIMEOUT

The variable specifies after what time period without access the disk should power down. It will power down after that time period and come up again with the next access. Sleep timeouts can be specified in minutes from one to 20 and in periods of 30 minutes from half an hour up to 5 hours. A sleep timeout of 21 or 25 minutes will be rounded to 30 minutes. Some harddisks ignore values too high and stop after some minutes then. Please test the settings thoroughly because proper functioning depends on the hardware used!

        HDSLEEP_TIMEOUT='2'              # wait 2 minutes until power down


1.1.6 OPT_RECOVER - Emergency Option

This variable determines if functions for creating an emergency option will be available. If activated the option copies the command ``mkrecover.sh'' to the router. By executing it you can activate the emergency option at the console. With package ``HTTPD'' installed the action of copying an existing installation to an emergency instance can be achieved conveniantly in the menu ``recover''.

To use the recovery installation choose ``r'' for recovery in the boot menu at the next reboot.

        OPT_RECOVER='yes'


1.1.7 OPT_HDDRV - Additional Drivers For Harddisk Controllers

By setting OPT_HDDRV='yes' you may activate drivers additionally needed. Generally this is NOT needed for IDE und SATA, package 'Base' will load all necessary files.

HDDRV_N
Set the number of drivers to be loaded.

HDDRV_x
HDDRV_1 a.s.o. Set drivers to be chosen for the host-adapters in use. A list of all supported adapters is provided with the initial config file for package hd.

HDDRV_x_OPTION
With HDDRV_x_OPTION additional options can be passed that some drivers need for proper operation (for example an IO-address). This variable can be empty for the most drivers.

In the Appendix you may find an overview of the most common errors concerning harddisk and CompactFlash operation.

Example 1: Access to a SCSI-harddisk on an Adaptec 2940 controller

   OPT_HDDRV='yes'             # install Drivers for Harddisk: yes or no
   HDDRV_N='1'                 # number of HD drivers
   HDDRV_1='aic7xxx'           # various aic7xxx based Adaptec SCSI 
   HDDRV_1_OPTION=''           # no need for options yet

Example 2: Accelerated IDE-Access with PC-Engines ALIX

   OPT_HDDRV='yes'             # install Drivers for Harddisk: yes or no
   HDDRV_N='1'                 # number of HD drivers
   HDDRV_1='pata_amd'          # AMD PCI IDE/ATA driver (e.g. ALIX) 
   HDDRV_1_OPTION=''           # no need for options yet

© 2001-2022 The fli4l-Team - 7 September 2022