Install Gentoo livedvd to the hard disk

Source: Internet
Author: User
Tags time zones

There is no doubt about the importance of Linux, But I have played many release versions before. I first played fedora, and later installed rhel5 to find the server version. After hearing about centos, on the basis of rhel5, replaced the RedHat logo and updated it to centos5 through yum. As for the desktop release, there are n optical dial disks, and many Linux operating systems have been used with livecd, ubuntu, opensuse, GOS, jolicloud, and mono. This time I plan to migrate to Gentoo, and I don't want to change it. So this article is the installation notes.

First, I want to add some background knowledge ~

Experts skip this step directly (many of them are from official documents. Gentoo's documents are well-known and detailed, so that few people have carefully read them. What I am not familiar with is what I hate ...)

1. Gentoo pronunciation
Gentoo is pronounced as "gen-too" ("G" in "Gentoo", which is similar to "G" in "gentle "), the phonetic alphabet is roughly [Gen · t ← | 'd like ent ←] (the pronunciation reading is wrong, but there is nothing to face, such as Linux. the phonetic alphabet is ['li: n Bytes Ks], you can listen to the recording of Linus Torvalds ~)

2. Gentoo basics and features
"Gentoo depends on giving users the right to choose." "When you install Gentoo, you will understand clearly-how can you choose to compile software, how to install Gentoo and which system log program to use." "Gentoo is a fast and modern metadatabase with a concise and flexible design philosophy. Gentoo is built based on free software and does not conceal any underlying details from users ."

3. What are stage1, stage2, and stage3?
GentooIn stage refers to several stages of installation, "Gentoo still provides stage1 and stage2 tarball. But they are prepared for the development (the release engineering team generates the stage3 tarball from the stage1 tarball )"
GrubStage: "Grub contains several images files, two basic (required) stages files (stage1 and stage2), and optional stages (also known as stage1.5 ), and two network-guided images files nxgrub and xegrub ). Stage1 is a necessary image file used to guide gurb. Usually it is embedded into MBR. Or in the boot sector of a partition. Because the PC Boot Sector is 512 bytes, stage1 is also 512 bytes. Stage1 is used to load stage 2 or stage 1.5 from a local disk. Due to the size limitation, stage1 encodes the location of stage2 or stage 1.5. That is to say, stage1 cannot identify the file system format. Stage2 is the core image of grub. It handles almost everything (except loading itself). It can usually put it on the file system, but it is not necessary. Once you execute grub-install and Install Boot Loader, The stage1 file is not required. You can move it to any location because it has been embedded into MBR or PBR. Stage1 and stage2 files are generally located in the/boot/GRUB/directory. There are many stage 1.5 files in this directory, all of which are named in the file system format. They aim to build a bridge between stage1 and stage2, that is, loading stage 1.5 and stage2 in Stage 1. The difference between stage1 and stage 1.5 is that stage1 cannot identify the file system, and stage 1.5 can ."

4. What is squashfs file system?
Squashfs is a read-only file system that compresses the files and directories stored on it and supports a maximum of 1024 KB of segments to provide a greater compression ratio. It is now widely used in live-CD production. For example, the size of the image. squashfs file in gentoo10.1 livedvd is 2.52 GB. After mounting the file, the size of the file is about 9 GB. The compression ratio is evident.

5. portage, emerge, and ebuilds
PortageIs a software package management system of Gentoo, which is fully written in Python and bash.EmergeTools to use portage, and also GUI tools, such as Kuroo. When talking about (software) packages, we usually refer to the name of the packages provided by the portage tree for Gentoo users. The Portage tree isEbuildsA collection of files that contain the portage management tool maintenance software (installation, search, query ,...) all required information, which is stored in the/usr/portage directory by default. Gentoo does not actually "save" any software packages. On the contrary, Gentoo provides such ebuild scripts that can resolve dependencies, obtain source code, and compile into executable files for a specific version of software you need.

Official installation ~

Select an appropriate Installation Method
1. Use the minimal installation CD, such as a install-x86-minimal-20091103.iso, provided by gentoo.org, to download the stage3 package and portage snapshots online during installation
2. Use the universal install CD provided by gentoo.org, such as a install-hppa-universal-2008.0.iso, without networking and a graphical Installation Wizard Based on GTK or ditk.
3. Install livedvd of Gentoo's tenth anniversary edition on the hard disk directly. I chose this method. All kinds of software have been configured, which is very convenient.
PS: As for how to guide, it depends on my personal preferences. I am used to directly burn it into a CD. Of course, I can also use other methods to guide it, for example, through grub.

Procedure:

1. boot, select boot from the CD, When prompted, start livecd:# Gentoo NOx

2. Partition first. cfdisk is recommended., I have installed opensuse before, and it is a dual-start with windows, so there is basically no need to change anything. first check the partition status:# Cfdisk/dev/SDA

For example, my previous two Linux partitions (/boot I didn't take them out separately),/dev/sda2 is the ext3 partition, And/dev/sda3 is the swap partition.

Format partition:# Mkfs. ext3/dev/sda2

Activate swap partition:# Swapon/dev/sda3

3. Mount/dev/ext3Partition to the Gentoo directory and enter# Mount/dev/sda2/mnt/Gentoo

4. Copy an objectIn/mnt, there should be the livecd Directory, which is the content in the image. squashfs file mentioned above. If it does not exist, you can mount it by yourself:# Mount-o loop/mnt/CDROM/image. squashfs/mnt/livecd

Copy all files:# Cp-AF/mnt/livecd/*/mnt/Gentoo/<br/>

5.Then mount the proc and Dev directories., Enter:# Mount-T proc/mnt/Gentoo/proc <br/> # Mount-O bind/dev/mnt/Gentoo/dev <br/>

6. Modify the root password, Enter:# Passwd Root

Copy the shadow file to the system to be installed, and set the root password as follows:# Cp/etc/shadow/mnt/Gentoo/etc/shadow

7. Change the environment, Input# Chroot/mnt/Gentoo

This is for operational habits. It is also possible not to change.

8. Compile the kernelDirectly use the genkernel tool. By default, It is enough,# Genkernel

If you need to select which ones you want to compile, you can add the parameter-menuconfig. It takes about half an hour to complete the compilation.

9. Modify/etc/fstab, Input# Nano/etc/fstab

Add the following two lines

/Dev/sda2/ext3 defaults 0 1 <br/>/dev/sda3 none swap SW 0 0

10. Install grub to MBR, Input# Grub-install -- root-directory =/-- no-floppy hd0

11. Modify the grub. conf fileModify the kernel name and partition location. Enter:# Nano/boot/GRUB/grub. conf

My

Default 0 <br/> timeout 30 <br/> splashimage = (hd0, 1) /boot/GRUB/splash.xpm.gz </P> <p> title Gentoo Linux 2.6.30-R5 <br/> root (hd0, 1) <br/> kernel/boot/kernel-genkernel-x86_64-2.6.30-gentoo-r5 root =/dev/ram0 real_root =/dev/sda2 <br/> initrd/boot/initramfs-genkernel-x86_x64-2.6.30-gentoo-r5 </P> <p> title windows <br/> rootnoverify (hd0, 0) <br/> chainloader + 1 <br/>

11. prevent the system from modifying the root password just set after startup, Input# Rm/etc/runlevels/default/pwgen

12. Restart, Input# Reboot

 

You can log on to Gentoo without an accident. The default KDE interface has a Gentoo user who can log on automatically and modify it by himself. Other configurations are available, such as displaying Chinese characters, installing Chinese input methods, configuring time zones, configuring Kde, and installing other software.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.