Subsections


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


4.9.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!

4.9.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 START_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.

4.9.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'.

4.9.1.3 Configuration Of The Setup Bootmedia


Table 4.6: 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.

4.9.1.4 Examples For Completed Installations Type A and B:

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


Table 4.7: 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!


4.9.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'


4.9.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.

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


4.9.4 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


4.9.5 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'


4.9.6 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-2019 The fli4l-Team - 28 April 2019