Welcome to the tutorial guide. The tutorial will provide a user with guidance and instructions for installing Annvix, booting the install CD.
A user will note that there is no pretty GUI to guide a user through the installation process.
How to boot the install CD?
Let’s go through the process of booting the install CD. Please note that the Annvix installation CD is what a user needs to install Annvix.
• A user can download the ISO image, which will require a user to do a network install to install packages that are not part of the base operating system.
• In order to have a faster install, a user can download the RPM packages and store them on a local hard drive or somewhere on the network.
• After a user has written the ISO to CD, he/she can insert the CD and boot from it. At the prompt, a user will be able to select which kernel that he needs to use. A user can choose from install and install-nofb
• The CD will boot a small image into memory and then try to detect the CD-ROM device and load the actual Live image as a loopback filesystem, which will then boot the actual useable system.
• A user can now access a number of tools to gain help with the installation process.
• A user will be automatically logged into consoles one and two as the root user when the system has completed booting.
• Before a user progresses any further, he/she should assign root a new password. Please note that by default, the root user’s password is “root”!.
How to modify the keyboard layout
If a user is using a non-English keyboard, then a user can use the loadkeys command to load the keymap for the keyboard. If a user wants to find out what keymaps are available, then he/she can look in /usr/lib/kbd/keymaps/. An example will help us understand this:
# /bin/loadkeys be2-latin1
How to load additional modules
A user can load additional modules for the system. The system executed kudzu during boot, which detected what hardware was installed and made a file called /etc/sysconfig/hwconf which contains this information. Please note that Kudzu makes a note of what modules are required for certain devices in this file as well. A user will notice an entry like this as provided below:
-
class: NETWORK
bus: PCI
detached: 0
device: eth0
driver: pcnet32
desc: “Advanced Micro Devices [AMD]|79c970 [PCnet32 LANCE]”
network.hwaddr: 00:0C:29:B3:3B:D9
vendorId: 1022
deviceId: 2000
subVendorId: 1022
subDeviceId: 2000
pciType: 1
pcidom: 0
pcibus: 0
pcidev: 10
pcifn: 0
The information lets a user know which network card is installed on the system, and also tells a user what module (or driver) is required to operate it. In this case, a user will need to load the pcnet32 module. A user can do this by simply executing:
# /sbin/modprobe pcnet32
A user can use lsmod in order to verify that the module has been loaded. Please note that a user does not have to manually load network drivers. The install-pkgs script helps a user with this. A user can also use hdparm to tweak IDE hard disk performance.
How to configure a proxy
If a user is planning to connect to the internet through a proxy, then a user will have to define some environment variables. An example will help in understanding this. If a user is connecting to proxy.annvix.org on port 8080, then he/she will type following:
# export http_proxy=”http://proxy.annvix.org:8080″
# export ftp_proxy=”http://proxy.annvix.org:8080″
# export RSYNC_PROXY=”http://proxy.annvix.org:8080″
If a users proxy requires him/her to login (provide authentication), then please use the format “http://username:password@proxyserver”.
How to prepare the disks
A user can now start working on the actual system. A user can now start creating the filesystems that a user wants to use on the hard drive. The process of preparing the disks involves the steps of partitioning, formatting, and mounting the drives.
Partitioning Schemes
A user has got a number of ways in which he/she can partition the drive, and it all depends upon personal preference and on users requirements. A basic partition scheme is presented below:
Partition Filesystem Size Description
/dev/hda1 ext2 50M Boot partition (/boot)
/dev/hda2 swap 512M Swap partition
/dev/hda3 XFS 800M Root partition (/)
/dev/hda4 XFS rest of disk Home partition (/home)
This partition scheme makes the assumption that large volumes of data will be stored on the /home partition (i.e. web data, user mailboxes, etc.). A user can change this to /srv or /var according to his/her preference or make /dev/hda3 one large root partition.
There are a number of arguments to using more, or less, partitions. By segmenting parts of the disk to different mount points (i.e. a separate partition for /usr, one for /var, another for /tmp, etc.) a user can secure the system a little more by issuing mount options such as noexec or nosuid for various filesystems.
A user can mount /tmp with noexec and nosuid, likewise for /var, and possibly likewise for /home. Another argument is that if a rogue program is filling up logfiles, then only the /var partition would get stuffed; it wouldn’t impact the amount of space used on other partitions.
A user should note that a proper planning is important as a poor planning can lead to problems such as a user can end up with either too little space in some places, or wasted space in others.
A user should note that there is another important point to note which is about paying attention to upgrades. If a users system is a large root partition, when a user upgrades the system, then he/she will have to take pains to make sure that /home is not overwritten or otherwise tampered with. If a user has an existing system and wish to re-format the drives, /home will be lost with all of it’s data unless a user can make a backup. With /home on a separate partition, a user can freely format the root partition without touching the data stored on /home whatsoever.
Using RAID
If a user doesn’t want to use RAID, then he/she can skip ahead. As by using Linux software RAID is entirely optional and can be done during the installation with a few manual steps.
The first step is to ensure that the two drives are physically identical, and ideally placed on different controllers. Here we have the first drive as /dev/hda and the second as /dev/hde.
By using fdisk, a user can create partitions. Please view following partitions as below:
Device Mount point RAID device Size
/dev/hd?1 /boot /dev/md0 100M
/dev/hd?2 swap n/a 256M
/dev/hd?3 / /dev/md1 5G
/dev/hd?5 /usr/local /dev/md2 10G
/dev/hd?6 /var /dev/md3 10G
/dev/hd?7 /home /dev/md4 10G
/dev/hd?8 /srv /dev/md5 45G
The sizes are, of course, approximate. When a user is creating each partition, then he/she should pay attention to how many sectors are being used. Please view partitions on this drive and they are as following:
/dev/hda1 1-13
/dev/hda2 14-45
/dev/hda3 46-411
/dev/hda4 411-9729 (extended partition)
/dev/hda5 411-1628
/dev/hda6 1629-2845
/dev/hda7 2846-4062
/dev/hda8 4063-9729
When a user has completed the process of creating the partitions, then a user can change the partition types. For /dev/hda2, a user needs to change the type to “82″ for Linux swap. For the rest, with the exception of the extended partition, of course, a user will need to change them to type “fd” or Linux raid autodetect. This can be done by typing t to change type and then the partition number, and then the code of the type to change to (82 or fd).
When a user completes this then he/she can do the exact same thing on the second drive. Whereas on the first drive a user has specified partitions by size in fdisk (i.e. “+100M” to create the 100M /dev/hda1 partition), a user will need to specify by sector on the second drive. So, when creating the first partition, using starting sector “1″ and ending sector “13″. A user can do this for each partition. Then change the partition types as a user did for the first drive by changing the partition types. When a user has done then please check following work:
# fdisk -l /dev/hda
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 45 257040 82 Linux swap
/dev/hda3 46 411 2939895 fd Linux raid autodetect
/dev/hda4 412 9729 74846835 5 Extended
/dev/hda5 412 1628 9775521 fd Linux raid autodetect
/dev/hda6 1629 2845 9775521 fd Linux raid autodetect
/dev/hda7 2846 4062 9775521 fd Linux raid autodetect
/dev/hda8 4063 9729 45520146 fd Linux raid autodetect
# fdisk -l /dev/hde
Disk /dev/hde: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hde1 1 13 104391 fd Linux raid autodetect
/dev/hde2 14 45 257040 82 Linux swap
/dev/hde3 46 411 2939895 fd Linux raid autodetect
/dev/hde4 412 9729 74846835 5 Extended
/dev/hde5 412 1628 9775521 fd Linux raid autodetect
/dev/hde6 1629 2845 9775521 fd Linux raid autodetect
/dev/hde7 2846 4062 9775521 fd Linux raid autodetect
/dev/hde8 4063 9729 45520146 fd Linux raid autodetect
A user has to create every RAID device using the mdadm program. This is actually very simple. For each RAID device, a user will be executing mdadm somewhat like this:
# mdadm –create –verbose /dev/md0 –level=1 –raid-devices=2 /dev/hda1 /dev/hde1
Essentially, this is constructing a new array assigned to the device /dev/md0. It is a RAID1 array with two devices: /dev/hda1 and /dev/hde1. The mdadm manpage contains a lot of information, and if a user intends to do things like RAID1 or RAID5, etc.
A user can tailor the mdadm command to work with all of the devices, in this scenario a user would end up with md0 (hda1 and hde1), md1 (hda3 and hde3), md2 (hda5 and hde5), md3 (hda6 and hde6), md4 (hda7 and hde7), and md5 (hda8 and hde8).
If a user already has pre-existing RAID devices a user would like to use, the installer assembles them for a user during boot and they should be available for a user to use immediately without doing any kind of reconfiguration. If, for some reason, they are not available, a user can reconstruct the arrays using:
# mdadm -A /dev/md0 /dev/hda1 /dev/hdb1
Please note that the above would reassemble /dev/md0 with the /dev/hda1 and /dev/hdb1 devices.
When a user has completed this, a user can check the progress of the array construction:
# cat /proc/mdstat
This will indicate the status of the array construction, and will indicate which array it’s working on, how far it has left to go, the estimated finish time, etc. If a user wants to wait for the arrays to finish re-syncing before progressing with the install-pkgs command, a user can format and mount the partitions:
# mke2fs /dev/md0
# mkfs.xfs /dev/md1
# mkfs.xfs /dev/md2
# mkfs.xfs /dev/md3
# mkfs.xfs /dev/md4
# mkfs.xfs /dev/md5
# mount /dev/md1 /mnt/annvix
# mkdir -p /mnt/annvix/{boot,usr/local,home,var,srv}
# mkswap /dev/hda2
# mkswap /dev/hde2
# swapon /dev/hda2
# swapon /dev/hde2
# mount /dev/md0 /mnt/annvix/boot
# mount /dev/md2 /mnt/annvix/usr/local
# mount /dev/md3 /mnt/annvix/var
# mount /dev/md4 /mnt/annvix/home
# mount /dev/md5 /mnt/annvix/srv
After a user has done this, a user should check /proc/mdstat to see if it’s done everything. If everything is sorted then a user can go ahead with the process of install-pkgs command. The installer will make sure that the mdadm package is installed for a user. It is a good idea that a user runs the mdadm monitoring daemon so that to make sure to configure /etc/mdadm.conf and start the mdadm service (srv –add mdadm once installation is complete and a user has booted into the new system).
Continue on to Installing the base files.
Using fdisk to Partition
The program of choice to partition drives is fdisk. The sole argument to fdisk is the device to partition:
# fdisk /dev/hda
Once fdisk is started, a user will be at a command prompt that gives him/her a number of options (press m for help). In order to display the disk’s current partition configuration, a user can press p. If this is a fresh disk, there will be nothing to show. If the disk has previously been used, then a user will be able to view what partitions exist, how many blocks they are, what type of partition they are, etc.
If a user wants to remove the partitions to create new ones, then he/she can simply press d and give fdisk the corresponding partition number (ie. 1 for /dev/hda1, 6 for /dev/hda6, etc.) to delete. If a user makes a mistake, then he/she can press q to exit without writing the changes to disk; fdisk does not write any changes to disk until a user tell it to.
In order to create a first partition, let’s assume /boot,
- a user can press n to create a new partition.
- Then a user can select p for a primary partition, then give it the primary partition number (1 in this case). Please note that fdisk will ask a user for the first cylinder to use (just press enter),
- and then it will ask a user for the last cylinder or a size to use for the partition.
- Please enter the size of the partition; a user wants (say 50MB /boot partition so enter +50M).
- When this is done, if a user can press p to view the partitions, a user will see the new partition listed. Because the /boot partition needs to be bootable, press a to toggle the bootable flag for this partition.
The second partition is to be a 512MB swap partition.
- A user can press n again to create a new partition, and create it.
- When a user has created the partition, please press t to change the partition type.
- type the code 82, which is the code for Linux swap (press L to obtain a full list of partition codes).
- now if a user presses p to view the partitions, a user will see /dev/hda1 listed with a “*” in the bootable column and /dev/hda2 listed with a System type of Linux swap (/dev/hda1 should have a System type of Linux). For instance, it should look somewhat similar to:
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 4866 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 27 216846 83 Linux
/dev/hda2 28 81 433755 82 Linux swap
- If a user is creating one more partition, when asked for the last cylinder, then a user will just have to press enter and a user will get the maximum size of the disk.
- If a user is going to have more than four partitions, then he/she can only use the first three as primary partitions; the rest need to be extended partitions. For instance, a user may have /dev/hda1 as /boot, /dev/hda2 as swap, /dev/hda3 as /, /dev/hda5 as /usr, and /dev/hda6 as /var. /dev/hda4 in this configuration is a large partition that contains the extended partitions. For instance:
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 4866 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 27 216846 83 Linux
/dev/hda2 28 81 433755 82 Linux swap
/dev/hda3 82 742 5309482+ 83 Linux
/dev/hda4 743 4866 33126030 5 Extended
/dev/hda5 743 997 2048256 83 Linux
/dev/hda6 998 2272 10241406 83 Linux
/dev/hda7 2273 4866 20836273+ 83 Linux
Please note that /dev/hda4 has a System type of Extended; this just means that /dev/hda4 contains the other extended partitions (/dev/hda5 and higher).
- if a user is satisfied then he/she should press w to write the partition information to disk and exit fdisk.
Creating the Filesystems
When the partition creation is done, a user can place a filesystem on each device prior to being able to mount or use them. A user has a choice of filesystems, however, as Annvix supports ext2, ext3, ReiserFS, and XFS. All of these filesystems are journaling filesystems, with the exception of ext2.
- Please note that ext3 is ext2 with journaling capabilities. It is more reliable than ext2 due to the journaling support. It also includes a hashed b-tree indexing option that gives it more of a performance boost. Both ext2 and ext3 also support user quotas. The mke2fs program also is used to create these filesystems, however it is recommended that a user must pass the -j option to mke2fs in order to turn the journaling capabilities on.
- XFS is SGI’s powerful filesystem that is optimized for scalability and handling huge files and amounts of data. XFS provides extended ACLs which allow administrators and users to assign even finer user/group controls to files and directories. XFS also supports quotas. XFS filesystems are created with the mkfs.xfs program.
The use of ReiserFS as a filesystem on Annvix is highly discouraged. Due to support issues, lack of development for ReiserFS v3 and lack of acceptance by the Linux kernel maintainers regarding ReiserFS v4, we highly recommend not using ReiserFS at all.
IF a user wanted to make /boot (/dev/hda1) an ext2 filesystem, / (/dev/hda3) an ext3 filesystem, /var (/dev/hda5) an ext3 filesystem, and /home (/dev/hda6) an XFS filesystem, then as user should use something like:
# mke2fs /dev/hda1
# mke2fs -j /dev/hda3
# mke2fs -j /dev/hda5
# mkfs.xfs /dev/hda6
In this instance, /dev/hda2 would be a users swap partition. It is created using the mkswap program:
# mkswap /dev/hda2
Once the swap partition is created, a user can turn it on by using the swapon command:
# swapon /dev/hda2
Mounting the Filesystems
After the partitions have been created and formatted, a user can mount them. A special mount point, /mnt/annvix, exists to be the “root” of the new system. By using the above example, to mount the four partitions under /mnt/annvix, a user would use:
# mount /dev/hda3 /mnt/annvix
# mkdir /mnt/annvix/{boot,home,var}
# mount /dev/hda1 /mnt/annvix/boot
# mount /dev/hda5 /mnt/annvix/var
# mount /dev/hda6 /mnt/annvix/home
If you followed this tutorial guide then you would have learnt about installing Annvix which covers booting the installing the CD and preparing the disks.