Create a new system root directory/mnt/sysroot:
#mkdir/mnt/sysroot
2. Add a piece of hard disk/DEV/SDB to format the target disk partition
Two:
On host:/DEV/SDB1,/DEV/SDB2
/DEV/SDB1 Mount to/mnt/sysroot/boot(target host root file system creation complete and then mount)
/DEV/SDB2 Mount to/mnt/sysroot
Create a root file system for the destination host
# mkdir-pv/mnt/sysroot/{etc/rc.d, USR, var, proc, Sys, Dev, lib, lib64, Bin, sbin, boot, SRV, mnt, media, home, Root
Then through the bincp.sh script to transplant Bash and other to the target host root file system:
The contents of the bincp.sh script are as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4B/AE/wKioL1QvygiyV3qjAAKQjB4ofRs683.jpg "title=" Qq20141004181919.png "alt=" Wkiol1qvygiyv3qjaakqjb4ofrs683.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/AB/wKiom1Qvyk6iNp2JAACEPSel4cg064.jpg "title=" 3.png " alt= "Wkiom1qvyk6inp2jaacepsel4cg064.jpg"/>
3. Install GRUB to target disk
# Grub-install--root-directory=/mnt/sysroot/dev/sdb
4. Copy kernel and INITRD files
# Cp/boot/vmlinuz-version/mnt/sysroot/boot/vmlinuz
# cp/boot/initramfs-version.img/mnt/sysroot/boot/initramfs.img
5. Provide configuration files for grub
# vim/mnt/boot/grub/grub.conf
Default=0
Timeout=5
Title mageedu Little Linux
Root (hd0,0)
Kernel/vmlinuz ro root=/dev/sda2 Quiet selinux=0 init=/bin/bash
Initrd/initramfs.img
Micro-Linux system production completed
This article from "Happy Heart every Day" blog, please be sure to keep this source http://as007012.blog.51cto.com/6215447/1560614
Build a simple bootable Linux based on the host