Install e-file Debian on the dragon core machine through NFS // transfer from Wu zhangjin's blog

Source: Internet
Author: User
Install e-file Debian on the dragon core machine through NFS

In the dragon core machine mounted system, a lot of methods, most of them listed here: http://dev.lemote.com/drupal/node/62
In fact, the goal of installing the system is to put the file system and kernel that support the MIPs/loongson command to a certain partition of a storage device on the machine.
Therefore, there are many other ways to do this. Isn't it? Here we will introduce how to install e-file Debian on the kernel machine through NFS.

1. Prepare the kernel and File System

There are not many items to prepare,

1. A kernel that supports mounting the file system from nfsroot and can run on the dragon core machine.

For details about how to compile the kernel, if you cross-compile the kernel, we will not mention it here. You can refer to it here:
Http://dev.lemote.com/code/linux_loongson

To support nfsroot, in addition to basic network support, the following options are required:

To automatically obtain the IP address, you must have a DHCP server in your network. If you do not have a DHCP server, configure one by yourself (which will be introduced later ).

Networking ---> Networking Support
Networking options ---> PACKET socket
UNIX domain sockets
TCP/IP networking
IP: kernel level autoconfiguration
IP: DHCP support

To support nfsroot,

File systems --->
Network file systems --->
<*> NFS client support
Root file system on NFS

Okay, you can compile the kernel. For the latest kernel source code, you can download it from here.
-Dev version: http://dev.lemote.com/cgit/rt4ls... oongson-Dev-to-Ralf
-Stable version: http://dev.lemote.com/cgit/rt4ls.git/log? H = to-Ralf

2. Prepare a File System

Download it directly from here: http://www.lemote.com/upfiles/ OS /Debian-en/debian-en.tar.gz

2. Set up basic services

In order to install the system from nfsroot, We need to install three basic services on our own host (that is, in addition to the Dragon core machine, you need another machine,

One is the TFTP service used to load the kernel.
The other is DHCP, which is used to assign an IP address to the Dragon core machine,
Another is the nfsroot service, which is used to place the file system and start it from there.

The following describes how to build these three services on Ubuntu:

1. TFTP service

Install service package

$ Sudo apt-Get install tftpd-HPA

Start the service and use/tftproot as the main directory of the TFTP service. (do not think about other methods. This is the easiest way)

$ Sudo mkdir/tftproot
$ Sudo in. tftpd-S-l/tftproot

After the kernel is started, copy the kernel to/tftproot.

2. Dhcp Service

If your network has this service, do not configure it again. Otherwise, configure one by yourself.

$ Sudo apt-Get install dhcp3-server
$ Vim/etc/DHCPD. conf
Ddns-Update-style none;
Subnet 192.168.1.0 netmask 255.255.255.0 {
Range 192.168.1.121 192.168.1.121;
}
$/Usr/sbin/DHCPD

With the above configuration, you can allocate a 192.168.1.121 address to your machine. If you want other addresses, you can modify this configuration.

3. Install the NFS service

This is also very easy.

$ Sudo apt-Get install nfs-kernel-Server
$ Vim/etc/exports
/Opt/yeeloongos/192.168.1. * (RW, no_root_squash, sync)
$/Etc/init. d/nfs-kernel-Server start
$ Exportfs
/Opt/yeeloongos
192.168.1 .*

This configuration file/etc/exportsis the root directory for configuring the nfsservice, that is, the root directory of our file system. Here we can extract debian-en.tar.gz to/opt/yeeloongos.

$ Tar zxf debian-en.tar.gz-C/opt/yeeloongos

In addition, we also configure which machines can access our services. The configuration here is to allow access from all machines whose IP address is 192.168.1.

3. Start Installation

Unzip to this directory.

Assume that the IP address of your host is 192.168.1.1, that DHCP server is 192.168.1.1, And that TFTP server is 192.168.1.1. Otherwise, replace it with another IP address.

1. Start a system through nfsroot

Start the instance, press del until the pmon> prompt line appears.

Pmon> ifaddr rtl0 192.168.1.121 // configure a temporary IP address, which is only valid in pmon. to configure a persistent IP address, use set ifconfig rtl0: 192.168.1.121
Pmon> load TFTP: // 192.168.1.1/vmlinux // load the kernel that supports nfsroot
Pmon> g root =/dev/nfs RW nfsroot = 192.168.1.1:/opt/yeeloongos IP = 192.168.1.121: 192.168.1.1: 192.168.1.1: 255.255.255.0: yl: eth0ff console = tty no_auto_cmd

If there is no problem, you should be able to access a basic file system.
Description of each field of the IP Address: IP = <client-IP >:< nfssever-IP >:< gateway-IP & gt ;:< netmask >:< host-name>: <device>: <auto-conf>
For more information, see here: http://fscked.org/writings/clusters/nfsroot.txt

2. format the original partition.

$ Mkfs. ext3/dev/hda1 // if you have important data, remember to save it. The format is the partition on the godson machine, not your host.

3. Install the File System

Copy debian-en.tar.gz to the/opt/yeeloongos/home/root/directory on your ECs instance, and install it on the/dev/hda1 partition on the ECS instance.

$ Mkdir/mnt/hda1
$ Mount/dev/hda1/mnt/hda1 // mount the hda1 partition on the dragon core machine to the/mnt/hda1 directory.
$ Mount-O remount, RW // re-mount the root partition to ensure read/mnt/hda1
$ Tar zxf/home/root/debian-en.tar.gz-C/mnt/hda1 // wait patiently for a group and it takes some time to decompress the package

4. Install the kernel

The kernel in debian-en.tar.gz is a little old. You just compiled the kernel and put it under/boot,

You can first copy the kernel to/opt/yeeloongos/home/root on the host, and then to/mnt/hda1/boot/on the dragon core machine.

Configure boot. cfg or directly set the following variables through pmon.

Pmon> set Al "/dev/fs/ext2 @ wd0/boot/Name of the kernel you just compiled"
Pmon> set karg "root =/dev/hda1 console = tty no_auto_cmd"

That is all ~~

[This post was last edited by Falcon]

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.