Gentoo Source Installation Diagram

Source: Internet
Author: User
Tags time and date ftp client

Gentoo Source Installation

First, pre-preparation

(1) Download the following three files

Second, configure the installation environment

(1) booting to LIVECD environment with CD-ROM

(2) Configuring the network for the current LIVECD environment

When installing Gentoo, the server-led LIVECD environment must be able to connect to the extranet. Because the kernel and other related software need to be downloaded online during the installation process. And we want to use SSH Remote installation operation, so the server boot current LIVECD environment also to turn on the sshd service, so that the server can be used under the Linux SSH or Windows Putty Remote connection. So the network settings here are mainly for two purposes: one is to enable the current server boot LIVECD environment to connect to the external network, the second is to open the SSHD service, so that the server can be remotely connected with SSH.

Network planning for the server:

The server has three network cards: eth0, eth1, eth2. Only the eth0 and eth2 two NICs are used here.

Eth0 IP Address: 192. 168.10.200, for remote connection.

Eth2 IP Address: Use the DHCPCD command to obtain IP automatically, to join the extranet via NAT.

Set IP address:

Check if the server can connect to the network, Ping Baidu's website here.

Can ping through Baidu, connect the outside network OK.

Turn on the SSHD service and set the root password:

LiveCD ~#/etc/init.d/sshd Start

LiveCD ~# Password root

Attention:

Root here is the root user of the current LIVECD environment. The password is set because the SSHD service default remote connection logon user must set a password. Here the root user password is set to: 123456

(3) Connect to the server remotely from another host through an sshd service that is enabled in the LIVECD environment

Under Linux, you can use SSH commands to connect remotely to a server that has the SSHD service enabled, and you can use the Putty tool under Windows. I use putty here.

Click on the "Open" button below, according to the prompt to enter the user name: root, Password: 123456; the first time you log in, you will be prompted to save the key, click "Yes".

Iii. Establishment of partitions

500GB HDD Partition planning:

/dev/sda1/boot 200M

/dev/sda2/20gb

/dev/sda3 Swap 20GB

/dev/sda5/home 20GB

/dev/sda6/usr/local 20GB

/dev/sda7/var 20GB

/dev/sda8 100GB reserved Space 100GB

/DEV/SDA9 100GB reserved Space 100GB

/DEV/SDA10 200GB Multiply all space

(1) Create a partition from Fdisk:

When the partition is complete, enter W to write to the partition.

Attention:

At the time of creation, because the/dev/sda3 is a swap partition, the partition type to be modified is 82,/dev/sda1 as the boot partition, so it should be marked as a bootable partition.

(2) Re-reading SDA partition table

(3) Create a EXT4 file system

(4) Creating a swap partition

(5) Activate swap partition

Iv. create the relevant mount directory and mount the file system

According to the partition plan, establish the related mount directory, and mount the file system.

/dev/sda1/boot 200M

/dev/sda2/20gb

/dev/sda3 Swap 20GB

/dev/sda5/home 20GB

/dev/sda6/usr/local 20GB

/dev/sda7/var 20GB

Attention:

In Linux, all directories are mounted under the root directory "/". So first mount the file system that was originally planned as the root partition to the root "/" directory under this mount point, and then set up other related mount points on this root partition file system.

V. Setting the system time and date

Modified to the current time and date: July 24, 2012 22:17.

Vi. Uploading relevant documents

Upload the following two files to the/mnt/gentoo directory, which is the/dev/sda2 file system that is planned for the root partition.

This is pre-downloaded, you can also use links or wget command to download these two files online in terminal.

Open Windwos under the FTP client tool FileZilla Client, select "File" à "site manager", such as set up sftp;

Click Connect and upload the local two files on the root partition file system on the server.

Once the upload is complete, view the contents of the/dev/sda2 root partition file system and see the two files that have just been uploaded.

Nine, set the time zone

Set time zone information: Use the correct entries in/usr/share/zoneinfo, as appropriate. We use Shanghai here.

When the time zone is set, the times will be recalculated according to your timezone, and we set up Shanghai in the East eight area, so it will be added eight hours on the basis of the original time. Here we need to recalibrate the current time.

X. Setting the hostname to Gentoo

Xi. Kernel Configuration

(1) Download kernel and other dependent packages and unzip the configuration

Attention:

Gentoo-sources: For general use, only a general security patch is played.

Hardened-sources: Server usage, increased security and stability.

(2) Configure the kernel-related function module according to the specific situation

The following screen appears and the custom kernel module is selected as appropriate.

(3) Custom EXT4 file system

Before the hard drive partition is planned, the EXT4 file system is used. Here is an example of customizing the EXT4 file system. Others are subject to individual circumstances.

Press the UP and DOWN ARROW keys to move down to find the "File Systems" menu.

After choosing to enter the "File Systems" menu, locate the EXT4 file system and choose to compile it into the kernel.

Press "tab" key to switch to "Exit" button and enter, this action is made two times. The following screen will appear asking if you want to save the new configuration, select "Yes" here.

(4) Compile kernel

My server is 4-core, so when make is added with parameter-j4, it can speed up the compilation.

(5) Install the kernel

After the compilation is complete, the Bzimage binary kernel file is generated. You can tell where the file is saved, depending on the last line when the compilation is complete.

12. Modify the Fstab file

The contents of the amendment are as follows:

13. Configure the Network

Set IP address: 192.168.10.240, default gateway is: 192.168.10.1

Set the NIC eth0 to boot.

If there is no net.eth0 under/etc/init.d/, you need to create the file with the ln command first.

The SSHD service is also set to boot.

14. Set the user root password for the new Gentoo system installation

XV, edit set some configuration files

LiveCD CONF.D # nano-w/etc/conf.d/clock

Timezone= "Asia/shanghai"

LiveCD CONF.D # nano-w/etc/rc.conf

LiveCD CONF.D # nano-w/ETC/CONF.D/RC

LiveCD CONF.D # nano-w/etc/conf.d/keymaps

16. Installation System Tools

LiveCD CONF.D # emerge Syslog-ng

LiveCD CONF.D # emerge Logrotate

LiveCD CONF.D # emerge Vixie-cron

LiveCD CONF.D # emerge DHCPCD

LiveCD CONF.D # emerge Vim

LiveCD CONF.D # rc-update Add syslog-ng Default

LiveCD CONF.D # rc-update Add vixie-cron Default

17. Install the Boot program grub

(1) Download grub online and compile the installation

LiveCD CONF.D # emerge Grub

(2) Configuring the grub.conf file

(3) Installing GRUB to SDA

LiveCD CONF.D # Grub

18. Restart the system

Exit the chroot environment, unmount all file systems, and restart.

LIVECD/# Reboot

Finally, remove the disc. This completes the installation of the Gentoo 64bit system. Such as:

Gentoo Source Installation Diagram

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.