next up previous contents index
Next: The SuSE Linux Boot Up: System Previous: The Linux Kernel   Contents   Index

Subsections


Special Features of SuSE Linux

This chapter provides information about the Filesystem Hierarchy Standard (FHS) and Linux Standard Base (LSB). Various software packages and special features, such as booting with ``initrd'', linuxrc, and the rescue system, are described in detail.


Linux Standards


File System Hierarchy Standard (FHS)

SuSE Linux strives, as far as possible, to conform to the File system Hierarchy Standard (FHS, package fhs). See also http://www.pathname.com/fhs/. For this reason, it is sometimes necessary to move files or directories to their ``correct'' places in the file system.


Linux Standard Base (LSB)

SuSE supports the Linux Standard Base project. Current information on this can be found at http://www.linuxbase.org.

The LSB specification version for 9.0 is 1.3. From now on, the Filesystem Hierarchy Standard (FHS) is included in the specification and defines settings, such as the package format and the initialization of the system. See Chapter 12.


teTeX -- TEX in SuSE Linux

TEX is a complete typesetting system which runs on various platforms. It is expandable with macro packages like LATEX. It consists of very many single files that have to be assembled according to the TEX Directory Structure (TDS) (ref. ftp://ftp.dante.de/tex-archive/tds/ teTeX is a compilation of current TEXapplications.

teTeX is employed in SuSE Linux with a configuration that complies with the requirements of both the TDS and the FHS.


Example Environments for FTP and HTTP


About FTP

To make it easier to set up an FTP server, the package ftpdir includes an example environment. This is installed in /srv/ftp.


About HTTP

Apache is the standard web server in SuSE Linux. Together with the installation of Apache, some example documents are made available in /srv/www. To set up your own web server, include your own DocumentRoot in /etc/httpd/httpd.conf and store your files (documents, picture files) accordingly.


Hints on Special Software Packages


Package bash and /etc/profile

  1. /etc/profile
  2.  /.profile
  3. /etc/bash.bashrc
  4.  /.bashrc

Users can make personal entries in  /.profile or in  /.bashrc respectively. To ensure the correct processing of these files, it is necessary to copy the basic settings from /etc/skel/.profile or /etc/skel/.bashrc respectively into the home directory of the user. It is recommended to copy the settings from /etc/skel following an update. Execute the following shell commands to prevent the loss of personal adjustments:

mv ~/.bashrc ~/.bashrc.old
cp /etc/skel/.bashrc ~/.bashrc
mv ~/.profile ~/.profile.old
cp /etc/skel/.profile ~/.profile

The personal adjustments then need to be copied back from the files *.old.


cron Package

The cron tables are now located in /var/cron/tabs. /etc/crontab serves as a system-wide cron table. Enter the name of the user who should run the command directly after the time table (see File 23, here SuSE @nohyphen root is entered). Package-specific tables, located in /etc/cron.d, have the same format. See [8]cron.

File: Example of an Entry in /etc/crontab


1-59/5 * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun

/etc/crontab cannot be processed with crontab -e. It must be loaded directly into an editor, modified, then saved.

A number of packages install shell scripts to the directories /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly, whose instructions are controlled by /usr/lib/cron/run-crons. /usr/lib/cron/run-crons is run every fifteen minutes from the main table (/etc/crontab). This guarantees that processes that may have been neglected can be run at the proper time.

The daily system maintenance jobs have been distributed to various scripts for reasons of clarity ( package aaa_base). Apart from aaa_base, /etc/cron.daily thus contains for instance the components backup-rpmdb, clean-tmp or clean-vi.


Log Files -- the Package logrotate

There are a number of system services (``daemons''), which, along with the kernel itself, regularly record the system status and specific events to log files. This way, the administrator can regularly check the status of the system at a certain point in time, recognize errors or faulty functions, and troubleshoot them with pinpoint precision. These log files are normally stored in /var/log as specified by FHS and grow on a daily basis. The package logrotate package helps control the growth of these files.


Changing to logrotate

The old settings listed below will be adopted when updating from a version older than SuSE Linux 8.0:

  • Entries from /etc/logfile not associated with a particular package are moved to /etc/logrotate.d/aaa_base.
  • The variable MAX_DAYS_FOR_LOG_FILES from the former rc.config file is mapped as dateext and maxage in the configuration file. Refer to [8]logrotate.


Configuration

Configure logrotate with the file /etc/logrotate.conf. In particular, the include specification primarily configures the additional files to read. SuSE Linux ensures that individual packages install files in /etc/logrotate.d (e.g., syslog or yast).

File: Example for /etc/logrotate.conf


# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp - we'll rotate them here
#/var/log/wtmp {
#    monthly
#    create 0664 root utmp
#    rotate 1
#}

# system-specific logs may be also be configured here.

logrotate is controlled through cron and it is called daily by /etc/cron.daily/logrotate.


Note

The create option reads all settings made by the administrator in /etc/permissions*. Ensure that no conflicts arise from any personal modifications.


Man Pages

For some GNU applications (e.g. , tar) the man pages are no longer maintained. They have been replaced by info files. info is GNU's hypertext system. Typing info info gives a starting help for using info. info can be launched via emacs -f info or on its own with info. The programs tkinfo and xinfo are easy to use or you can access the SuSE help system.


The Command ulimit

With the ulimit (user limits) command, it is possible to set limits for the use of system resources and to have these displayed. ulimit is especially useful for limiting the memory available for applications. With this, an application can be prevented from using too much memory on its own, which could bring the system to a standstill.

ulimit can be used with various options. To limit memory usage, use the options listed in Table 11.1.
ulimit: Setting Resources for the User
-m maximum size of physical memory
-v maximum size of virtual memory (swap)
-s maximum size of the stack
-c maximum size of the core files
-a display of limits set

System-wide settings can be made in /etc/profile. There, creating core files must be enabled, needed by programmers for ``debugging''. A normal user cannot increase the values specified in /etc/profile by the system administrator, but he can make special entries in his own  /.bashrc.

File: ulimit: Settings in ~/.bashrc


# Limits of physical memory:
ulimit -m 98304
 
# Limits of virtual memory:
ulimit -v 98304

Details of memory must be specified in KB. For more detailed information, see bash.


Note

Not all shells support ulimit directives. PAM (for instance, pam_limits) offers comprehensive adjustment possibilities should you depend on encompassing settings for these restrictions.


The free Command

The free command is somewhat misleading if your goal is to find out how much RAM is currently being used. The relevant information can be found in /proc/meminfo. These days, users, who have access to a modern operating system such as Linux, should not really have to worry much about memory. The concept of ``available RAM'' dates back to before the days of unified memory management. The slogan free memory is bad memory applies well to Linux. As a result, Linux has always made the effort to balance out caches without actually allowing free or unused memory.

Basically, the kernel does not have direct knowledge of any applications or user data. Instead, it manages applications and user data in a ``page cache''. If memory runs short, parts of it will be either written to the swap partition or to files, from which they can initially be read with the help of the mmap command (see [2]mmap).

Furthermore, the kernel also contains other caches, such as the ``slab cache'' where the caches used for network access are stored. This may explain differences between the counters in /proc/meminfo. Most, but not all of them, can be accessed via /proc/slabinfo.


The File /etc/resolv.conf

Domain name resolution is handled through the file /etc/resolv.conf. Refer to 13 on this.

This file is updated by the script /sbin/modify_resolvconf exclusively, with no other program having permission to modify /etc/resolv.conf directly. Enforcing this rule is the only way to guarantee that the system's network configuration and the relevant files are kept in a consistent state.


Settings for GNU Emacs

GNU Emacs is a complex work environment. More information is available at http://www.gnu.org/software/emacs/. The following sections cover the configuration files processed when GNU Emacs is started.

On start-up, Emacs reads several files containing the specifications of the user, system administrator, and distributor for customization or preconfiguration. The initialization file  /.emacs is installed to the home directories of the individual users from /etc/skel. .emacs, in turn, reads the file /etc/skel/.gnu-emacs. If a user wants to customize the program, the .gnu-emacs should be copied to the home directory and the desired settings should be specified there:


cp /etc/skel/.gnu-emacs ~/.gnu-emacs

.gnu-emacs defines the file  /.gnu-emacs-custom as custom-file. If users specify settings with the customize options, these will be saved to  /.gnu-emacs-custom.

When the package emacs is installed in SuSE Linux, the file site-start.el is installed in the directory /usr/share/emacs/site-lisp. The file site-start.el is loaded before the initialization file  /.emacs. Among other things, site-start.el makes sure that special configuration files distributed with Emacs add-on packages are loaded automatically (e.g., the package psgml). Configuration files of this type are also located in /usr/share/emacs/site-lisp and always begin with suse-start-. The local system administrator can specify system-wide settings in default.el.

More information about these files is available in the Emacs info file under Init File: info:/emacs/Init File. Information about how to prevent these files from loading is also provided at this location.

The components of Emacs are split in several packages:

  • The base package emacs.
  • Usually, the package emacs-x11 should be installed. This package contains the program with X11 support.
  • The package emacs-nox contains the program without X11 support.
  • The package emacs-info: online documentation in info format.
  • The package emacs-el contains the uncompiled library files in Emacs Lisp. These are not required at run-time.
  • Numerous add-on packages that can be installed if needed: the package emacs-auctex (for LATEX), the package psgml (for SGML and XML), the package gnuserv (for client/server operation), and others.


Booting with the Initial Ramdisk

As soon as the Linux kernel has been booted and the root file system (/) mounted, programs can be run and further kernel modules can be integrated to provide additional functions. To mount the root file system, certain conditions must be met. The kernel needs the corresponding drivers to access the device on which the root file system is located (especially SCSI drivers). The kernel must also contain the code needed to read the file system (ext2, reiserfs, romfs, etc.). It is also conceivable that the root file system is already encrypted. In this case, a password is needed to mount the file system.

For the problem of SCSI drivers, a number of different solutions are possible: the kernel could contain all imaginable drivers. This might be a problem because different drivers could conflict with each other. Also, the kernel will become very large because of this. Another possibility is to provide different kernels, each one containing just one or a few SCSI drivers. This method also has the problem that a large number of different kernels are required, a problem then increased by the differently optimized kernels (Pentium optimization, SMP). The idea of loading the SCSI driver as a module leads to the general question answered by the concept of an initial ramdisk: creating a way of being able to run user space programs even before the root file system is mounted.


Concept of the Initial Ramdisk

The initial ramdisk (also called ``initdisk'' or ``initrd'') solves precisely the problems described above. The Linux kernel provides an option of having a small file system loaded to a RAM disk and running programs there before the actual root file system is mounted. The loading of initrd is handled by the boot loader (GRUB, LILO, etc.). Boot loaders only need BIOS routines to load data from the boot medium. If the boot loader is able to load the kernel, it can also load the initial ramdisk. Special drivers are not required.


The Order of the Booting Process with initrd

The boot loader loads the kernel and the initrd to memory and starts the kernel. The boot loader informs the kernel that an initrd exists and where it is located in memory.

If the initrd was compressed (which is typically the case), the kernel decompresses the initrd and mounts it as a temporary root file system. A program called linuxrc is then started. This program can now do all the things necessary to mount the proper root file system. As soon as linuxrc finishes, the temporary initrd is unmounted and the boot process continues as normal with the mounting of the proper root file system. Mounting the initrd and running linuxrc can be seen as a short interlude during a normal boot process.

The kernel tries to remount initrd to the /initrd directly after the actual root partition is booted. If this fails because the mount point /initrd does not exist, for example, the kernel will attempt to unmount initrd. If this does not work, the system is fully functional, but the memory taken up by initrd can no longer be unlocked and thus will no longer be available.


linuxrc

These are the only requirements for the program linuxrc in the initrd. It must have the special name linuxrc and it must be located in the root directory of the initrd. Apart from this, it only needs to be executable by the kernel. This means that linuxrc may be dynamically linked. In this case, the ``shared libraries'' in /lib must be completely available in initrd. linuxrc can also be a shell script. For this to work, a shell must exist in /bin. In short, initrd must contain a minimal Linux system that allows the program linuxrc to be run. When SuSE Linux is installed, a statically-linked linuxrc is used to keep initrd as small as possible (space on boot disks is very limited). linuxrc is run with SuSE @nohyphen root permissions.

The Real Root File System

As soon as linuxrc terminates, initrd is unmounted and discarded, the boot process carries on as normal, and the kernel mounts the real file system. What is mounted as the root file system can be influenced by linuxrc. It just needs to mount the /proc file system and write the value of the real root file system in numerical form to /proc/sys/kernel/real-root-dev.


Boot Loaders

Most boot loaders (above all, GRUB, LILO, and syslinux) can handle initrd. Individual boot loaders are given instructions for how to use initrd as follows:

GRUB
Enter the following line in /boot/grub/menu.lst:


initrd (hd0,0)/initrd
Because the loading address of the initrd is written to the loaded kernel image, the initrd command must follow the kernel command.

LILO

Enter the following line in /etc/lilo.conf:


initrd=/boot/initrd

The file /boot/initrd is the initial ramdisk. It can be, but does not have to be, compressed.

syslinux

Enter the following line in syslinux.cfg:


append initrd=initrd <further parameters>


Using initrd in SuSE

Installing the System

The initrd has already been used for some time for the installation: the user can load modules and make the entries necessary for an installation (above all, for the source medium). linuxrc then starts YaST, which carries out the installation. When YaST has finished, it tells linuxrc where the root file system of the freshly installed system is located. linuxrc writes this value to /proc, terminates, and informs the kernel to continue booting into the newly installed system.

For an installation of SuSE Linux, you are, from the very beginning, booting the system being installed. A real reboot after installation only takes place if the kernel does not match the modules installed in the system. Because SuSE Linux uses a kernel for uniprocessor systems during installation, a reboot is only necessary if an SMP kernel was installed in the system with the corresponding modules.

Booting the Installed System

In the past, YaST has provided more than forty kernels for installing in the system, with the only basic difference a specific SCSI driver. This was necessary to be able to mount the root file system after booting. Further drivers could then be loaded afterwards as modules. Because optimized kernels are now available, this concept is no longer feasible -- by now, over one hundred kernel images would be needed.

This is why an initrd is used now, even to start the system normally. The way it is used is similar to that for an installation. The linuxrc used here, however, is simply a shell script with the task of loading a given module. Typically, this is just one single module -- the very SCSI driver needed to access the root file system.


Creating an initrd

An initrd is created by means of the script mkinitrd (previously mk_initrd). In SuSE Linux, the modules to load are specified by the variable INITRD_MODULES in /etc/sysconfig/kernel. After installation, this variable is automatically occupied by the correct values (the installation linuxrc knows which modules were loaded). The modules are loaded in exactly the order in which they appear in INITRD_MODULES. This is especially important if a number of SCSI drivers are used, because otherwise the names of the hard disks would change. Strictly speaking, it would be sufficient just to load those drivers needed to access the root file system. Because the automatic loading of additional SCSI drivers may cause problems (how should it be ``triggered'' if hard disks hang on the second SCSI adapter), all SCSI drivers needed at the installation are loaded by means of initrd.


Note

Because the loading of the initrd with the boot loader runs in the same way as loading the kernel itself (LILO notices, in its map file, the location of the files), you must run lilo if LILO after every change in initrd, if LILO is used as the boot loader. If grub is used for booting, this step is not needed.


Possible Difficulties -- Self-Compiled Kernels

A self-compiled kernel can often lead to the following problem: out of habit, the SCSI driver is hard-linked to the kernel, but the existing initrd remains unchanged. When you boot, the following occurs. The kernel already contains the SCSI driver, so the hardware is detected. initrd, however, now tries to load the driver again as a module. With some SCSI drivers, especially with aic7xxx, this leads to the system blocking. Strictly speaking, this is a kernel error. An already existing driver should not be allowed to be loaded again as a module. The problem is already known from another context, however (serial drivers).

There are several solutions to the problem: either configure the driver as a module (then it will be correctly loaded in the initrd) or remove the entry for initrd from the file /etc/lilo.conf. An equivalent to the latter solution is to remove the variable INITRD_MODULES then run mkinitrd, which then realizes that no initrd is needed.

Prospects

It is quite possible in the future that an initrd will be used for many more and much more sophisticated things than loading modules needed to access /.

  • High-end EIDE drivers
  • Root file system on RAID software (linuxrc sets up the md devices)
  • Root file system on the LVM
  • Root file system is encrypted (linuxrc asks for the password)
  • Root file system on a SCSI hard disk on a PCMCIA adapter

For More Information

/usr/src/linux/Documentation/ramdisk.txt
/usr/src/linux/Documentation/initrd.txt
[4]initrd


linuxrc

linuxrc is started during the boot of the kernel, usually as a prelude to a Linux system installation, before the ``actual'' booting commences (the kernel must first be properly configured, of course). This allows you to boot a small, modularized kernel and to load the few drivers needed as modules from a floppy disk.

If needed, linuxrc assists in loading the related drivers.

You can also use linuxrc as a boot tool for an already installed system. You can even start a totally independent RAM disk-based rescue system, for example, if something serious should happen to your hard disk or you have simply forgotten your SuSE @nohyphen root password. More about this below, in Section 11.


Main Menu

After you have selected the language and keyboard, find yourself in linuxrc's main menu (see Figure 1.2). Normally, linuxrc is used to start Linux. Go to the start menu to start an installation (` Start installation / system').

Settings / Preferences

Specify your settings in respect to ` Language', ` Screen' (Color/monochrome), ` Keyboard Layout', and ` Debug (Experts)'.


System Information

In ` System Information' (Figure 11.1), check a number of other things, besides kernel messages, such as the I/O addresses of PCI cards or the size of the main memory recognized by Linux.

You can check some system information in ` System information'. Here, check the used interrupts, I/O ports used, main memory, and recognized PCI devices as detected by Linux.

Figure 11.1: System Information
\includegraphics[width=\linewidth]{linuxrc_sysinfo}

The next lines show how a hard disk and a CD-ROM connected to an (E)IDE controller announce their start. In this case, you do not need to load additional modules:

hda: ST32140A, 2015MB w/128kB Cache, LBA, CHS=1023/64/63
hdb: CD-ROM CDR-S1G, ATAPI CD-ROM drive
Partition check:
 hda: hda1 hda2 hda3 < hda5 >

If you booted a kernel that already had a SCSI driver compiled, you do not need this SCSI driver as a module as well. Quite typical announcements when loading SCSI adapters and connected devices might look like this:

scsi : 1 host.
Started kswapd v 1.4.2.2
scsi0 : target 0 accepting period 100ns offset 8 10.00MHz FAST SCSI-II
scsi0 : setting target 0 to period 100ns offset 8 10.00MHz FAST SCSI-II
  Vendor: QUANTUM   Model: VP32210           Rev: 81H8
  Type:   Direct-Access                      ANSI SCSI revision: 02
Detected scsi disk sda at scsi0, channel 0, id 0, lun 0
scsi0 : target 2 accepting period 236ns offset 8 4.23MHz synchronous SCSI
scsi0 : setting target 2 to period 248ns offset 8 4.03MHz synchronous SCSI
  Vendor: TOSHIBA   Model: CD-ROM XM-3401TA  Rev: 0283
  Type:   CD-ROM                             ANSI SCSI revision: 02
scsi : detected 1 SCSI disk total.
SCSI device sda: hdwr sector= 512 bytes. Sectors= 4308352 [2103 MB] [2.1 GB]
Partition check:
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 >


Loading Modules

Select which kinds of modules you need. If you booted via disk, the corresponding data must be read by linuxrc and displayed in a list.

If you have booted from CD or from DOS (via loadlin), these modules are already set in linuxrc. This saves tedious loading, but requires additional memory.

Figure 11.2: Load Modules
\includegraphics[width=.9\linewidth]{linuxrc_module}

linuxrc offers a list of available drivers. On the left is the name of the module and, on the right, a short description of its usage. For some components, there are a variety of drivers from which to choose (even newer alpha drivers).

Figure 11.3: Selection of SCSI Drivers
\includegraphics[width=.9\linewidth]{linuxrc_scsi}


Passing Parameters

When you have found a suitable driver, move to it with the cursor and press . This opens a dialog box in which to add additional parameters for this module.

Figure 11.4: Entering Parameters for a Module to Load
\includegraphics[width=.9\linewidth]{linuxrc_param}
Beware that -- in contrast to entering the parameters at the kernel prompt (as in MILO, LILO, or SYSLINUX) -- multiple parameters for the same module must be separated here by a blank space.

In most cases, it is not necessary to specify the hardware in detail. Most drivers find their components automatically. Specifying parameters is only necessary if you have a network card or an older CD-ROM drive with a proprietary controller card. If in doubt, just try pressing .

Recognizing and initializing certain hardware can take some time. Switching to virtual console 4 ( + F4) lets you watch the kernel messages while loading. SCSI drivers need a while, as they have to wait for each device to load.

The messages are displayed by linuxrc so you can verify that everything ran smoothly. If it fails, the messages might give a hint as to why.


Start Installation / System

Once you have set up hardware support via modules, proceed to the ` Start installation / system' menu.

From here, a number of procedures can be started: ` Start installation' (an update is also started from this item), ` Boot installed system' (the root partition must be known), ` Start rescue system' (refer to Section 11), and ` Eject CD'.

` Start Live-CD' is only available if you booted a ``LiveEval CD''. Download ISO images from the FTP server (live-eval-<VERSION>):


Tip

The item ` Start Live-CD' can be of great use if, for example, you want to test, without actually installing, if the computer in question or the laptop you might want to buy is at all compatible with SuSE Linux -- such a test ought to be possible in every modern PC shop, without any trouble.

Figure 11.5: Selection of Source Media in linuxrc
\includegraphics[width=\linewidth]{linuxrc_installmedium}

For the installation (Figure 11.5), choose various sources for the installation and similarly for the rescue system (see Figure 11.5).


The SuSE Rescue System

SuSE Linux contains several Linux rescue systems so that, in emergencies, your Linux partitions on the hard disks are reachable ``from the outside'': via a boot disk or the ``Rescue'' System, loaded from disk, CD, the network, or the SuSE FTP server. There is also a bootable SuSE Linux CD (the ``LiveEval CD'') that can be used as a rescue system. The rescue system includes several help programs with which you can remedy large problems with inaccessible hard disks, misconfigured configuration files, or other similar problems.

Another aspect of the rescue system is Parted, which is used for modifying the partition size. This program can be launched from inside the rescue system itself, if you do not want to take advantage of the resizer integrated in YaST. Information on Parted can be found at:


Tip

Always have a boot and rescue disk at hand, because the slight effort for creating and maintaining the disk is negligible in comparison to the time wasted and work involved when, in the case of emergency, you cannot access your system or your CD-ROM drive.


Preparations

For setting up your rescue system, you need two disks free of errors: one as a future boot disk and the other for the compressed image of a small root file system. The image file bootdisk for booting the system and the file rescue for the root file system can be found on the first CD in the boot directory.

There are three ways to set up the root file system on the disk:

  • with YaST
  • in a console using the Linux commands

    earth :# /sbin/badblocks -v /dev/fd0 1440
    earth :# dd if=/media/cdrom/boot/rescue of=/dev/fd0 bs=18k

  • at the DOS prompt (where the CD-ROM drive is Q:)

    Q:\> cd \dosutils\rawrite
    Q:\dosutils\rawrite> rawrite.exe

As of Version 8.0, the rescue disk is currently based on libc5 (SuSE Linux 5.3), since it is possible in this to save some programs, such as an editor, fdisk, or e2fsck to a disk.


Note

The rescue disk cannot be mounted, because it is not a file system. It only contains the compressed images of one. Directions for reading the file system are in the following paragraph.

To read the image, you will need to decompress the image file then mount the decompressed image as user SuSE @nohyphen root. If your Linux kernel support the loop device, the procedure is as follows:


earth :# cp /media/cdrom/boot/rescue /root/rescue.gz
earth :# gunzip /root/rescue.gz
earth :# mount -t ext2 -o loop /root/rescue /mnt


Starting the Rescue System

The rescue system is launched by the SuSE boot disk you created or by your bootable CD or DVD. It is required that the disk and CD-ROM or DVD drives are bootable. If necessary, change the boot series in the CMOS setup. Following are the steps for starting the rescue system:

  1. Start your system with the SuSE boot disk created yourself or with the first SuSE Linux CD or DVD inserted into the corresponding drive.
  2. Launch the entire system or choose ` Manual Installation' so that ` boot options' can be entered and kernel modules to load can be defined.
  3. Make the respective settings for language and keyboard.
  4. Select the item ` Installation/Start system' in the main menu.

  5. If you started with the boot disk, now insert the installation CD or the rescue disk with the compressed image of the rescue system.

    Figure 11.6: Source Medium for the Rescue System
    \includegraphics[width=.8\linewidth]{linuxrc_rescue_medium}

  6. In the menu ` Start installation/system' select the item ` Start rescue system' (see Figure 1.3) then specify the desired source medium (Figure 11.6).

    Subsequently, we will introduce a few tips on selection options:

    ` CD-ROM':
    When loading the rescue system, the path /cdrom is exported. This makes the installation from this CD possible.
    ` Network':
    For starting the rescue system over a network connection, the network card's driver must be loaded first. See the general information on this in Section 1. Several protocols exist for this purpose (see Figure 11.7), such as NFS, FTP, or SMB.

    Figure 11.7: Network Protocols
    \includegraphics[width=\linewidth]{linuxrc_network_protocol}

    ` Hard disk':
    Load the rescue system from the hard disk.

    ` Floppy Disk':
    The rescue system can also be started from the floppy disk, especially if the computer only has a small amount of working memory.

Regardless of the medium chosen, the rescue system will be decompressed, loaded onto a RAM floppy disk as a new root file system, mounted, and started. Now it is ready for use.


Working with the Rescue System

The rescue system provides three virtual consoles on keys + F1 to + F3. Here, SuSE @nohyphen root may log in without a password. + F4 accesses the system console, where you can view the kernel and syslog messages.

A shell and lots of other useful utilities (net tools), such as the mount program, can be found in the /bin directory. In sbin, find important file and network utilities for reviewing and repairing the file system (e.g., e2fsck).

Furthermore, this directory contains the most important binaries for system maintenance, such as fdisk, mkfs, mkswap, mount, mount, init, and shutdown, as well as ifconfig, route, and netstat for maintaining the network.

An editor, vi, is located in /usr/bin. Also, tools like grep, find, and less, along with telnet are available.


Accessing Your Normal System

To mount your SuSE Linux system using the rescue system, use the mount point /mnt. You can also use or create another directory.

As an example, assume your normal system is put together according to the /etc/fstab shown in the example File 26.

File: Sample /etc/fstab


/dev/sdb5       swap        swap        defaults   0   0
/dev/sdb3       /           ext2        defaults   1   1
/dev/sdb6       /usr        ext2        defaults   1   2


Caution

Pay attention to the order of steps outlined in the following section for mounting the various devices.

To access your entire system, mount it step-by-step in the /mnt directory using the following commands:


  earth :/# mount /dev/sdb3 /mnt
  earth :/# mount /dev/sdb6 /mnt/usr

Now, you can access your entire system and, for example, correct mistakes in configuration files such as /etc/fstab, /etc/passwd, and /etc/inittab. The configuration files are now located in the /mnt/etc directory instead of in /etc.

To recover even completely lost partitions with the fdisk program by simply setting it up again, determine where on the hard disk the partitions were previously located and make a printout of the /etc/fstab directory as well as the output of the command


earth :# fdisk -l /dev/<disk>

Instead of the <disk> variable, insert, in order, the device names of your hard disks, such as hda.


Repairing File Systems

Damaged file systems are tricky problems for the rescue system. This could happen after an unscheduled shutdown caused by power failure or a system crash. Generally, file systems cannot be repaired on a running system. If you encounter really severe problems, you may not even be able to mount your root file system so the system boot ends in a kernel panic. Here, the only chance is to repair the system from the ``outside'' using a rescue system.

The SuSE Linux rescue system contains the utilities e2fsck and dumpe2fs (for diagnosis). These should remedy most problems.

In an emergency, man pages often are not available. That is why we have included them in this manual in Appendix C.

Example: If mounting a file system fails due to an invalid superblock, the e2fsck program would probably fail, too. If this were the case, your superblock may be corrupted, too. There are copies of the superblock located every 8192 blocks (8193, 16385, etc.). If your superblock is corrupted, try one of the copies instead. This is accomplished by entering the command:


  earth :# e2fsck -f -b 8193 /dev/damaged_partition

The -f option forces the file system check and overrides e2fsck's error so that -- since the superblock copy is intact -- everything is fine.


Virtual Consoles

Linux is a multiuser and multitasking system. The advantages of these features can be appreciated, even on a stand-alone PC system.

In text mode, there are six virtual consoles available. Switch between them using + F1 to  + F6. The seventh console is reserved for X11. More or fewer consoles can be assigned by modifying the file /etc/inittab.

To switch to a console from X11 without leaving X11, use  +  + F1 to +  + F6.  + F7 then returns to X11.


Keyboard Mapping

To standardize the keyboard mapping of programs, changes were made to the following files:


/etc/inputrc
/usr/X11R6/lib/X11/Xmodmap
/etc/skel/.Xmodmap
/etc/skel/.exrc
/etc/skel/.less
/etc/skel/.lesskey
/etc/csh.cshrc
/etc/termcap
/usr/lib/terminfo/x/xterm
/usr/X11R6/lib/X11/app-defaults/XTerm
/usr/share/emacs/<VERSION>/site-lisp/term/*.el
/usr/lib/joerc

These changes only affect applications that make use of terminfo entries or whose configuration files are changed directly (vi, less, etc.). Other non-SuSE applications should be adjusted to these defaults.

Under X, the compose key (``multikey'') can be accessed using the key combination  + (right). Also see the corresponding entry in /usr/X11R6/lib/X11/Xmodmap.


Local Adjustments -- I18N/L10N

SuSE Linux is, to a very large extent, internationalized and can be modified for local needs in a flexible manner. In other words, internationalization (``I18N'') allows specific localizations (``L10N''). The abbreviations I18N and L10N are derived from the first and last letters of the words and, in between, the number of letters omitted.

Settings are made via LC_* variables defined in the file /etc/sysconfig/language. This refers not only to ``native language support'', but also to the categories Messages (Language), Character Set, Sort Order, Time and Date, Numbers, and Money. Each of these categories can be defined directly via its own variable or indirectly via a variable in the file language (see [5]locale).

  1. RC_LC_MESSAGES, RC_LC_CTYPE, RC_LC_COLLATE, RC_LC_TIME, RC_LC_NUMERIC, RC_LC_MONETARY: These variables are passed to the shell without the RC_ prefix and determine the above categories. The files concerned are listed below.

    The current setting can be shown with the command locale.

  2. RC_LC_ALL: This variable (if set) overwrites the values of the variables mentioned in item 1.

  3. RC_LANG: If none of the above variables are set, this is the ``fallback''. By default, SuSE Linux only sets RC_LANG. This makes it easier for users to enter their own values.

  4. ROOT_USES_LANG: A yes or no variable. If it is set to no, SuSE @nohyphen root always works in the POSIX environment.

The other variables can be set via the YaST sysconfig editor.

The value of such a variable contains the language code, country code, encoding, and modifier. The individual components are connected by special characters:


LANG=<language>[[_<COUNTRY>].Encoding[@Modifier]]

Some Examples

You should always set the language and country codes together. Language settings follow the standard ISO 639 (http://www.evertype.com/standards/iso639/iso639-en.html and http://www.loc.gov/standards/iso639-2/). Country codes are listed in ISO 3166, see (http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html). It only makes sense to set values for which usable description files can be found in /usr/lib/locale. Additional description files can be created from the files in /usr/share/i18n using the command localedef. A description file for en_US.UTF-8 (for English and United States) can be created with:


earth :# localedef -i en_US -f UTF-8 en_US.UTF-8

LANG=en_US.ISO-8859-1

This sets the variable to English language, country to United States, and the character set to ISO-8859-1. This character set does not support the Euro sign, but it will be useful sometimes for programs that have not been updated to support ISO-8859-15. The string defining the charset (ISO-8859-1 in our case) will then be evaluated by programs like Emacs.

LANG=en_US.UTF-8

If you use a Unicode xterm, it is necessary to specify UTF-8 as well. To achieve this, make a small shell script called uxterm to start xterm with UTF-8 loaded each time. See File 27.

File: dat:suse.l10n.uxterm

uxterm to Start a Unicode xterm

#!/bin/bash
export LANG=en_US.UTF-8
xterm -fn \
'-Misc-Fixed-Medium-R-Normal-18-120-100-100-C-90-ISO10646-1' \
-T 'xterm UTF-8' $*

SuSEconfig reads the variables in /etc/sysconfig/language and writes the necessary changes to /etc/SuSEconfig/profile and /etc/SuSEconfig/csh.cshrc. /etc/SuSEconfig/profile is read or ``sourced'' by /etc/profile. /etc/SuSEconfig/csh.cshrc is sourced by /etc/csh.cshrc. This makes the settings available system-wide.


Settings for Language Support

Files in the category Messages are, as a rule, only stored in the language directory (e.g. , en) to have a fallback. If you set LANG to en,_US and the ``message'' file in /usr/share/locale/en_US/LC_MESSAGES does not exist, it will fall back to /usr/share/locale/en/LC_MESSAGES.

A fallback chain can also be defined, for example, for Breton $\rightarrow$ French or for Galician $\rightarrow$ Spanish $\rightarrow$ Portuguese:


LANGUAGE="br_FR:fr_FR"
LANGUAGE="gl_ES:es_ES:pt_PT"

If desired, use the Norwegian variants ``nynorsk'' and ``bokmål'' instead (with additional fallback to no):


LANG="nn_NO"
LANGUAGE="nn_NO:nb_NO:no"

or


LANG="nb_NO"
LANGUAGE="nb_NO:nn_NO:no"

Note that in Norwegian, LC_TIME is also treated differently.

Possible Problems

  • The thousand comma is not recognized. LANG is probably set to en, but the description the glibc uses is located in /usr/share/locale/en_US/LC_NUMERIC. LC_NUMERIC, for example, must be set to en_US.

For More Information


next up previous contents index
Next: The SuSE Linux Boot Up: System Previous: The Linux Kernel   Contents   Index
root 2003-11-05