Grub legacy Practice of making small Linux

Source: Internet
Author: User
Tags create directory

1.add a new disk to CentOS 6, the command is reasonable, good to remember;

2. then, in the system, enter echo "---" >/sys/class/scsi_host/host2/scan, this line of command, let the system re-read the SCSI interface disk ;

3. check to see if the disk exists and deploy three partitions on disk with a swap partition of 1G, 200M partition and all remaining space.

4. create the/mnt/boot/mnt/sysyroot partition and mount the swap partition of the disk, and the primary partition is also mounted;

~ mount swap partition :

[Email protected] ~]# mkswap/dev/sda2

[Email protected] ~]# swapon/dev/sda2

~ mount the main partition is relatively simple, with the Mount command can be;

5. Installing the GRUB program

[Email protected] ~]# Grub-install–root-directory=/mnt/dev/sdb

6. Copy the kernel files and RAMDisk files to the boot partition under the target system;

7. Create directory hierarchies for the root partition of small Linux;

[Email protected] ~]# mkdir-pv/mnt/sysroot/{bin,boot,dev,etc,lib,lib64,proc,sys,mnt,media,tmp,var,usr/{local/{ Bin,sbin,lib,lib64},bin,sbin,lib,lib64},sbin}

8. provide configuration files to grub;/mnt/boot/grub/gtub.conf

Default=0

Timeout=5

Hiddenmenu

Title Minilinux

Root (hd0,0)

kernel/vmlinuz-2.6.32-696.el6.x86_64 ro Root=/dev/sda3 selinux=0 init=/bin/bash

Initrd/initramfs-2.6.32-696.el6.x86_64.img

9. Copy the/bin/bash command and its shared library file to the corresponding directory under/mnt/sysroot/

can copy other commands, such as I copy the LS command, of course, you have to copy the library file, with which to see the location of the command, with the LDD command to view the location of the library file.

Then, according to their location, copy to the corresponding location; for example:

The library files are then displayed.


Perform the sync command multiple times to write data from memory to disk

12. You can create a new virtual machine, but the disk will use the disk that we set up just now. The rest is normal;


The BusyBox version of Small Linux will be updated afterwards;






Grub legacy Practice of making small Linux

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.