Monday 31 December 2012

TOP 100 LINUX TIPS AND TRICKS - 4


Tip 31: Added processors
Dual processors are becoming more and more popular in computers. Of course, you won't be able to see
much performance increase in Linux unless you tell Linux about the second CPU. Here is how to do it.
Go in the kernel, and enable SMP. SMP means Symetric Multi-Processing and tells the kernel that more than
one processor can be used.
After a reboot, Linux should tell you that it has detected 2 processors and what their status are.

Tip 32: Detecting an ISA device
ISA devices like modems should be detected automatically by the kernel. One case where they would not be
detected is if the device is Plug and Play. The kernel won't be able to detect ISA PnP devices unless they
have been prepared by a program called isapnptools.
The trick is to use this program in initiation scripts. It will detect the ISA PnP devices and make them
available to kernel modules and applications.
For example if you want to access an ISA PnP sound card, you will need to compile sound as a module in the
kernel, and use isapnptools before loading the module.

Tip 33: Find hardware information
When the Linux system boots, it will try to detect the hardware installed in the computer. It will then make a
fake file system called procfs and will store important information about your system in it.
You can get information about your system simply by browsing the directory /proc. The files in there will
contain information such as the processor you have, the amount of memory and the file systems the kernel
currently supports.
A usefull application exists to browse the /proc file system. It is called Xproc and is available from
http://devplanet.fastethernet.net/files.html:

Tip 34: Blinking leds on the keyboard
Keyboard leds are pretty boring. Usualy you know if the num lock is on or if you are writing in upper case
letters. Could we make them do something more useful? Of course.
The keyboard leds can be controlled by a device driver called the misc driver. That driver can control all
kinds of misc things. You could write your own driver to make them blink or light up at any system event.
A program called tleds is available from http://www.hut.fi/~jlohikos/tleds.html. That program will have them
blink based on network usage. One will blink when packets go in, and the other when packets go out.

Tip 35: Reading a foreign file system
File systems are defined in the kernel. The kernel supports many file systems, but they need to be compiled
in, or compiled as a module. When you compile a file system in the kernel, all you need to do is use mount
with the -t option and the right file system type.
If you have compiled a driver for a file system as a module, then you need to load the module first.
Here are a few of the available file systems:
·  msdos: This is the FAT file system used by DOS.
·  vfat: This is the FAT32 file system used by Windows 95 and Windows 98.
·  ext2: This is the default Linux file system.
·  iso9660: This is the default CD-ROM format.

Tip 36: Can't mount root fs
When you boot a system, this is an error that will halt the system. This error means that the kernel can't
mount the root file system, so it can't get all of its configuration files.
There are a few cases where this happens:
·  No IDE support in the kernel. If your main hard drive is an IDE, and you have recompiled
without including "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support" or some other
basic IDE device drivers.
·  File system not supported. Usually the root file system should be of type ext2. You need to
make sure that ext2 is compiled in the kernel, and not as a module because you can't load
modules without first mounting the root file system.
·  The drive is not ready. If you have removed the drive, the hard disk died or the BIOS didn't
detect the device for some reason, then the kernel won't be able to mount it.

Tip 37: Linux on a 286?
Linux is a multi-user, multitasking operating system which requires a 386 processor or more to run. This is
because the lower PC processors don't have what is needed for the Linux kernel.
Linux being open source, is being ported to many architectures. And one group decided to modify the kernel
so it would run on a 286 processor. The project page is http://www.uk.linux.org/ELKS-Home/index.html.

Tip 38: Linux without a hard drive
Modern Linux distributions require around 100 megs to 200 megs of hard disk space to install. But is it
possible to run Linux on a system without a hard drive? Yes it is.
The Linux Router Project is a full-featured Linux distribution that fits on one diskette. It was made for
routers, and use modules to add the software packages you need, including DNS servers, Web servers, email
and routing. You can find more information on the Linux Router Project at http://www.linuxrouter.org.

Tip 39: Shutdown and power off
Linux, like most other operating systems, must be shutdown in a specified manner. You can't turn the power
off on a computer running Linux, or you may lose some data.
Here are the steps that need to be done when you want to shutdown:
·  The operating system needs to stop all the running processes and logout the users.
·  Various servers need to be shutdown in a proper way.
·  All the mounted file systems need to be unmounted safely and unwritten data need to be stored
on the disk.
The system can then be turned off safely.
To accomplish all these tasks, the shutdown command exists. That command has a lot of options, and you
should explore them before trying anything at random. Another way to shutdown a Linux system is to set the
runlevel to 0, the default shutdown level, with the init program.

Tip 40: LPD started but no device found
The printer daemon is called LPD. It will be started at boot time and assume that a printer is connected to the
printer port. But a problem may occur when the daemon is started and no device is found.
The most common cause for this problem is a configuration problem in the kernel. Make sure that parallel
port, PC-style parallel port, and printer support is enabled in the configuration, and that modules are loaded.

No comments:

Post a Comment