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