COMP 3000 2011 report ttian1: Difference between revisions

From Soma-notes
Ttian1 (talk | contribs)
Ttian1 (talk | contribs)
Line 13: Line 13:
As introduced in the handbook, the first thing I  need to do is to partition my hard disk(the virtual one in fact). I login as root and use “fdisk /dev/sda” command to do partition, but I get a bad partition table and I can not mount my partition.
As introduced in the handbook, the first thing I  need to do is to partition my hard disk(the virtual one in fact). I login as root and use “fdisk /dev/sda” command to do partition, but I get a bad partition table and I can not mount my partition.


As a result, I use “cfdisk /dev/sda” command and I get a good partition table.
As a result, I try “cfdisk /dev/sda” command and I get a good partition table.
[[File:Partition_the_disk.jpg|thumb|right|Partition]]
[[File:Partition_the_disk.jpg|thumb|right|Partition]]
After that, I use “mkfs.ext4 /dev/sda1” command to build my file system.
After that, I use “mkfs.ext4 /dev/sda1” command to build my file system.

Revision as of 02:01, 19 December 2011

Background

The name of the distribution I choose is CRUX. It is a lightweight, i686-optimized Linux distribution. It is delivered by a tar.gz-based package system with BSD-style initscripts(initialization scripts follow the BSD-style)<ref name="BSD-style"> BSD-style initscripts. Retrieved December 12, 2011 from http://crux.nu/Main/Handbook2-7#ntoc50</ref> and also utilizes a ports system to install and upgrade applications.<ref name="About Crux"> About CRUX Linux. Retrieved October 18, 2011 from http://crux.nu/</ref> The ports system is a term refers to a remote repository containing ports and a client program capable of downloading ports from that repository.<ref name="ports-system"> About Ports system. Retrieved December 12, 2011 from http://crux.nu/Main/Handbook2-7#ntoc32</ref> BSD is a definition which stands for Berkeley Software Distribution and it has been considered a branch of UNIX—"BSD UNIX". <ref name="BSD"> Retrieved December 12, 2011 from http://en.wikipedia.org/wiki/Berkeley_Software_Distribution</ref>

VMsetting

Unlike other distributions, the primary goal of CRUX is not to be popular or to put as many features as possible into the system. In fact, CRUX is targeted at experienced Linux users especially. CRUX is first created by Per Liden (found through wikipedia) and the project has grown into a reasonable team whose members are all volunteers sharing a common philosophy. The team provides the core and optional packages for CRUX.

The crux-2.7.iso file is 226 MB. However, after installed, it will become 1.3GB and even more which depends on the ports and packages user want to install.

Installation/Startup

Attention: I follow the handbook and finish all the operations on it, but I can not run the kernel for CRUX. As a result, the basic operation is not feasible and I will use Hannah Montana Linux to do the basic operation section.

Firstly, I run the iso file through VMware and it shows me interface which looks like the scs.lambda machine, in other words a shell with command line. Then I follow the handbook <ref name="handbook">Handbook. Retrieved October 18, 2011 from http://crux.nu/Main/Handbook2-7 </ref> provided by the crux.nu to do the installation.

As introduced in the handbook, the first thing I need to do is to partition my hard disk(the virtual one in fact). I login as root and use “fdisk /dev/sda” command to do partition, but I get a bad partition table and I can not mount my partition.

As a result, I try “cfdisk /dev/sda” command and I get a good partition table.

Partition

After that, I use “mkfs.ext4 /dev/sda1” command to build my file system. Then I use “mount /dev/sda1 /mnt” to mount my sda1 partition, so I can do with sda1. After that I use “mkdir /mnt/var” command to make that directory which is for the later installation. Then I use “mount /dev/sda1 /mnt/var” command to mount the “var” directory. Then I use “setup” command to go into the CRUX setup windows to start the package installation script.

Setup

After the setup, I need to do some other work to compile my kernel. I use the following commands:

  1. Mount --bind /dev /mnt/dev
  2. Mount --bind /tmp /mnt/tmp

//Attention: the bind option for Mount command make the first parameter of the arguments inherits the properties of the second parameter.

  1. Mount –t proc proc /mnt/proc
  2. Mount –t sysfs none /mnt/sys
  3. Chroot /mnt /bin/bash
Compile kernel

//Attention: Chroot to change root for current running processes. Then initiate the password by using command “passwd”. Then use vim to edit files such as fstab, rc.conf, /rc.d/net and so on.

Then goes to the /usr/src/linux-2.5.35.6 directory to make instal.

Vim systemfile

Using command:

  1. Cd /usr/src/linux-2.6.35.6
  2. Make menuconfig --------//go into a configure script
  3. Make all

After install a lot of files, input “make modules_install” for another installation.

  1. Cp arch/x86/boot/bzImage /boot/vmlinuz
  2. cd System.map /boot

At last, edit the /etc/lilo.conf to boot the kernel I have just compiled and then run lilo to make the new system bootable.

I do learn a lot through the installation.

1. Because I use a virtual machine to run Crux, the label of the disk is sda, rather than hda.

2. Sometimes there are more than one way to do the same one thing in Linux, but one or more of them may never work well and meet kinds of problems such as “permission denied”. If so, just use other method and it may work well. For example, the partition in my distribution.

3. Learn quite a lot of commands and much familiar with the shell(bash) than before.

4. When download software which provides md5, check it before install to make sure it is the right one.

5. Os works on their corresponding CPU, such as x86 and i686.

6. Familiar with command “which” and “whereis”, as the command line does not show the directory.

7. Cat command is very useful to view files and vim is so powerful that I can use it to edit system files. And I think that is very dangerous.

8. Chmod 777 * is dangerous but useful sometimes.

9. Learn about the “mount”, “swapon” command and so on.

Usage Evaluation

From my point of view, as I am a fresh man to Linux, CRUX is really quite targeted to experienced users. Just as the developer says, I do have to do almost everything by myself by using the shell, even compile my own kernel! And the command line is only the “#” symbol, rather than shows almost the full directory in other distribution of Linux such as Ubuntu. So I have to be very familiar with the directory commands and clearly know what I am doing and where I am, or I have to use “cd ..” command to go back to top directory and go into the directory I want a again and that makes me think that the CRUX is not very user friendly. However, as one of the features of CRUX, it really makes the screen “light and clean”. Another feature of CRUX is its ports system, and it makes it much easier to install and update package. CRUX does not contain the gcc C compiler. And it does not install KDE automatically, so the UI looks like the lambda machine we use at laboratory. And I think using Crux is much more difficult than using Ubuntu. At last, I want to say that I choose Crux because it sounds cool and it is a lightweight distribution of Linux. Though it really takes me a lot of time to do with and be familiar with it, I love this distribution because it forces me to learn much more about Linux from the surface to the kernel.

Reference

<references />