Self-made Linux and kernel compilation 1, partitioning and creating file systems
Fdisk/dev/sdb
Divided into two necessary partitions
/DEV/SDB1 corresponding/boot/dev/sdb2 corresponding to the root/
Mkfs.ext4/dev/sdb1
Mkfs.ext4/dev/sdb2
650) this.width=650; "src=" Http://i.imgur.com/f7HGYyB.png "/>
2. Mount Boot
Mkdir/mnt/boot
Mount/dev/sdb1/mnt/boot
3. Installing GRUB
Grub-install--root-directory=/mnt/dev/sdb
650) this.width=650; "src=" Http://i.imgur.com/ziLMB81.png "/>
4, Establish grub.conf:
Vim/mnt/boot/grub/grub.conf
Title Qzxlinuxroot (hd0,0) kernel/vmlinuz-2.6.32-642.el6.x86_64 root=/dev/sda2 selinux=0 INIT=/BIN/BASHINITRD/ Initramfs-2.6.32-642.el6.x86_64.img
5. Restore kernel and Initramfs files
cp/boot/vmlinuz-2.6.32-642.el6.x86_64/mnt/boot/
Cp/boot/initramfs-2.6.32-642.el6.x86_64.img/mnt/boot
6. Create a level directory
Mkdir/mnt/sysroot
Mount/dev/sdb2/mnt/sysroot
Mkdir–pv/mnt/sysroot/{etc,lib,lib64,bin,sbin,tmp,var,usr,sys,proc,opt,home,root,boot,dev,mnt,media}
650) this.width=650; "src=" Http://i.imgur.com/l19hkMP.png "/>
7, Vim/mnt/sysroot/etc/fstab
/dev/sda1/boot ext4 Defaults 1 1/DEV/SDA2/EXT4 defaults 1 2
8. Copy bash and related library files 9, copy related commands and related library files
such as: Ls,cat,vim,reboot,hostname, etc.
650) this.width=650; "src=" Http://i.imgur.com/O1u2Kql.png "/>
Success
Self-made Linux and kernel compilation