 2010/03/11
|
Last update 2005/01/03
 The Labs - Design & Functionality For The NetLinux Resources & Hints
- Introduction
- Distributions
- Tuning
- Filesystems
- Virtual Domains
- Kernel
- Linux In Linux (Virtualizing)
- Live-System Install
- Resources
RedHat and
SuSE distribution
brought
Linux
real mainstream exposure in 1998 and 1999, since then Linux-distribution
got the acknowledgement in the server-market as well on the desktop-world, yet
there it still has to catch up, specially in regards of devices drivers, which
is unfortunatly a matter of device developing companies to also support Linux.
I personally ran it for servers and workstation but since May 2000 only on some
dedicated machines where Linux is required such as
otherwise
for servers and workstation I prefere nowadays FreeBSD,
even for workstation purposes,
it is just more convienent: install, upgrade apps or kernel, performance
and overall system-integrity.
Something many people aren't aware, Linux isn't a complete Operating System as
such, it is just the kernel. Every distribution developed its own
UNIX-like disk-layout arround the Linux-kernel. In this light,
Linux "suffers" from this diversity:
RedHat

| | RedHat is probably best known
from all distributions, but this actually doesn't mean anything about
quality necessarly, it is average.
|
SuSE

| | SuSE is very well known in Europe
and provides the largest collection of compiled packages installable
from the CD, which is very handy to save download time. Comperable with
RedHat-distribution.
|
Debian

| | Debian is a non-profit undertake
with support of packages. The installation isn't that user-friendly
(as of version 2.2, and even 3.0) as no hardware is recognized automatically as
SuSE or RedHat does, yet the collection of packages make this
distribution very valuable over the commercial distributions mentioned
above.
Few things to know after install:
- use dselect to explore the available packages, or
apt-cache search term; if you run X11 install
gnome-apt.
- if you are used to *bsd-like port disk-layout,
download debports which gives you a nice
/usr/ports/ directory-structure, make install, deinstall
and clean is supported. Also consider to check
linuxports@sourceforge.
- if you fail to install .deb files (due missing dh_testdir as example),
do apt-get install debhelper.
- /etc/apt/sources.list has the sources (cdrom, ftp) of the
packages, use apt-get update to get up-to-date package list.
- server/client: to share the .deb files export from the server
/var/chache/apt/archives/ and also /etc/apt/ to all clients,
then at least the packages are shared in common.
|
Other distributions

| | There are other distributions like Slackware and
Mandrake (derived from RedHat), each one with its own flavour
and features. See the full collection of Linux-distributions.
|
Download

| |
|
IMHO I think the Linux-distributions should unify and provide
one or two main-stream distributions in order to become competetive in the
entire OS-market. For now SuSE and RedHat are leading, but
quality-wise they are far below any *BSD distribution (e.g. FreeBSD) in my
eyes: there are no packages (rpm doesn't catch up), there is no comformity between
the different dists (fall 2000):
Some fragments I found on the net and discovered by myself:
New Swap Space

| | |
% dd if=/dev/zero of=/your/swapfile bs=1024 count=swap_size
|
|
% chmod 600 /your/swapfile
|
|
% mkswap /your/swapfile swap_size
|
|
% swapon /your/swapfile
|
Maximum swap_size call man mkswap to read more
Also add an entry in /etc/fstab:
|
/your/swapfile none swap sw 0 0
|
|
Open Files

| | Edit /usr/src/linux/include/linux/limits.h under Kernel-2.0
|
#define OPEN_MAX 1024 /* # open files a process may have */
|
and recompile kernel.
With Kernel 2.2 you can
|
echo 32768 > /proc/sys/fs/file-max
|
|
echo 65536 > /proc/sys/fs/inode-max
|
|
More Files

| | |
echo 8192 >/proc/sys/kernel/file-max
|
|
echo 32768 >/proc/sys/kernel/inode-max
|
put it into /etc/rc.d/rc.local
|
Memory

| | Server: Memory is cheap, upgrade it to the max, e.g. 128MB at least, more is
better when you run a web-server so swapping is never required in the best case.
Workstation: I use GIMP and
PicArt daily, which means huge RGBA images
are handled, for that reason I upgraded my workstation to 768MB
to have it running smoothly on the Athlon 1GHz (was using PPro 200 with 256MB before).
|
Mac Disks

| | To read mac disks (floppy or zip) under Kernel-2.2 you may acquire:
compile it, and copy hfs.o into /lib/modules/2.0.xx/fs/ and then call insmod hfs
and mount -t hfs /dev/sdb /mnt/zip (as example)
|
Memory Filesystem (RAM Disk)

| | To speed up disk-performance you might copy disk-content on
a memory-based filesystem called RAMFS (Kernel-2.4) or RAMDISK (Kernel-2.2),
under *BSD system it's called MFS.
Kernel 2.4
You need to have RAMFS enabled in your kernel, and then:
|
% mkdir /mnt/mfs
|
|
% mount -t ramfs ramfs /mnt/mfs
|
With kernel 2.4 the memory-fs under Linux grows and shrinks as
required like under FreeBSD
Kernel 2.2
You need to have RAMDISK
enabled in your kernel, and then /dev/ram* should
and then /dev/ram* should
exist already, read man ram otherwise. To setup and enable
a ramdisk:
|
% mke2fs /dev/ram0
|
|
% mkdir /mnt/mfs
|
|
% mount /dev/ram0 /mnt/mfs
|
The size of ramdisks are define via the kernel, or can be adjusted
in the lilo.conf:
|
:
|
|
image=/boot/vmlinuz
|
|
label=linux
|
|
root=/dev/hda2
|
|
ramdisk_size=10000
|
|
Software RAID

| | Software RAID is an easy way to connect two or more hard-disks together
and improve read/write speed:
|
Linux has been suffering a real state-of-the-art filesystem as ext2
fulfills the basic needs, but it's a pain to recover once your server crashed (can happen very rarely),
but when it happens it just takes forever to bring an ext2-filesystem back into
consistancy.
Ext3

| | With ext3 you can change any ext2 to ext3 on-the-fly (without reformating the disk):
- mounted disk: tune2fs -j /dev/hd... does the job, a .journal is created in the root directory of the mounted device
- unmounted disk: change /etc/fstab the ext2 to ext3, the journal is not seen.
More infos see at Using ext2 fs in 2.4 kernels and Red Hat: ext3 information.
|
Misc

| |
|
Have "IP Aliasing" in kernel enabled (and maybe need to recompile the kernel)
then add in /etc/rc.d/rc.local:
|
echo "adding virtual homes"
|
|
/sbin/ifconfig eth0:0 domain2.com
|
|
/sbin/ifconfig eth0:1 domain3.com
|
You may have to add also:
|
/sbin/route add -host domain2.com dev eth0:0
|
|
/sbin/route add -host domain3.com dev eth0:1
|
Of course the DNS needs to be valid and resolveable so these additional virtual
domains work, check dnstool.
A typical linux procedure is to download the most recent kernel
and compile it.
Extract it in /usr/src/ (usually creates linux/ itself) and then use
one of the three choices:
|
% make config # terminal based config (not recommended)
|
|
% make menuconfig # terminal based config (recommended, needs ncurses)
|
|
% make xconfig # x11 based config (recommended)
|
and walk through all options. Then call
|
% make dep
|
|
% make # make kernel
|
|
% make install # install kernel (check /boot/* and /etc/lilo.conf)
|
|
% make modules # make modules
|
|
% make modules_install # install modules
|
If you ever tried *BSD system, you realize how messy this Linux kernel/lilo
thing truly is:
- deselect SYMTAB export (one of the first config questions in kernel config)
- pay close attention of your /vmlinuz which may point to /boot/vmlinuz or
/boot/vmlinuz-x.x.x
- keep backup of your existing kernel (e.g. cp vmlinuz vmlinuz.old)
- edit /etc/lilo.conf, and run /sbin/lilo as root
Once again we recommend Debian/Linux as it behaves
best with a clean UNIX system-layout.
| Linux7. Linux In Linux (Virtualizing)
|
UML (User Mode Linux) is truly a nice piece of software as it allows to run multiple Linux-kernels and filesystem (guest) within
on a Linux-machine (host), a feature mainframes have:
- Download a root-filesystem e.g. root_fs_debian2.2_small
and make a sym-link
|
ln -s root_fs_debian2.2_small root_fs
|
- Download the UML-kernel e.g. linux-2.4.0-test12
and execute the kernel
login as root (password 'root' too).
The advantage is obvious:
- great test-bed for other Linux variants
- fastest virtualization (faster than vmware or plex86)
- advanced resource accounting: nice the guest-Linux appropriatly on the host
- true virtualized web-hosting
and beside, it prooves the Linux design being consistant in itself. The
file-system is a flat-file and easily be backed-up or moved arround on
other machines.
More Infos

| |
|
| Linux8. Live-System Install
|
Here the procedure step-by-step for a Debian/Linux-2.2
(for other distributions it may work, but the directory layout may
look slightly different) install:
- assuming your 2nd disk is /dev/hdc,
make two partitions (or more with different mounts) with fdisk /dev/hdc:
|
hdc1 280MB type 83
|
|
hdc2 42MB type 82 (swap)
|
then call
|
mke2fs /dev/hdc1
|
|
mkswap /dev/hdc2
|
- then transfer Linux live-system to your 2nd disk:
|
mkdir /mnt/newdisk
|
|
mount /dev/hdc1 /mnt/newdisk
|
|
cd /mnt/newdisk
|
|
cp -a /sbin .
|
|
cp -a /bin .
|
|
cp -a /lib .
|
|
cp -a /etc .
|
|
cp -a /var .
|
|
cp -a /dev .
|
|
cp -a /sbin .
|
|
cp -a /usr .
|
|
cp -a /root .
|
- and then the special dirs
|
mkdir proc tmp
|
|
chmod 1777 tmp
|
|
mkdir home
|
- and the last copying:
|
cp -a /boot .
|
|
ln -s boot/vmlinuz vmlinuz
|
- as next LILO:
edit /mnt/newdisk/etc/lilo.conf, again, my 2nd dist is /dev/hdc,
these specs are important:
|
boot=/dev/hdc
|
|
disk=/dev/hdc
|
|
bios=0x80 # make hdc be hda, useful for our case
|
|
root=/dev/hda1 # here again the hda referenced
|
this way you can install lilo on /dev/hdc, but it will treat
it as hda (see LILO-HowTo), call lilo then like this:
|
lilo -r /mnt/newdisk -C etc/lilo.conf
|
- then edit /mnt/newdisk/etc/fstab:
|
/dev/hda1 / ext2 defaults,errors=remount-ro 0 1
|
|
/dev/hda2 none swap sw 0 0
|
|
proc /proc proc defaults 0 0
|
-
other files to edit:
- /mnt/newdisk/etc/hosts
- /mnt/newdisk/etc/hostname
- /mnt/newdisk/etc/network/interfaces
Then unplug the 2nd disk (hdc) and put it into
your other system
and look Linux booting.
This "Live-System Install" is particularly useful to install Linux
medias like PCMCIA ATA disk, or other medias which aren't supported
using the CD-Install (see Stylistic-1000 Linux install).

Hipocrisy of the finest: "I agree that no single company can create all the hardware and software. Openness is central because it's the foundation of choice." -- Steve Balmer (Microsoft) blaming Apple regarding iPhone, February 18, 2009Last update 2005/01/03 
All Rights Reserved - (C) 1997 - 2009 by The Labs.Com |