Create a simple bash System

Source: Internet
Author: User

[Partitioning disks]

# Fdisk/dev/SDB

N

P

1

Enter

+ 200 m

N

P

1

Enter

+ 512 m

# Mke2fs-T ext4/dev/sdb1

# Mke2fs-T ext4/dev/sdb2

---------------------------------------- ------

[Install grub]

# Mkdir/mnt/boot

# Mout/dev/sdb1/mnt/boot/

# Grub-install -- root-directory =/mnt/dev/SDB

# Sync

---------------------------------------- ------

[Compile the grub configuration file]

# Cd/mnt/boot/GRUB

# Vim grub. conf

Default = 0

Timeout = 6

Title Test OS

Root (hd0, 0)

Kernel/vmlinuz Ro root =/dev/sda2 SELinux = 0 init =/bin/bash

Initrd/initramfs

# Sync

---------------------------------------- ------

[Copy the kernel to create a required directory for startup]

# Mkdir/mnt/sysroot

# Mount/dev/sdb2/mnt/sysroot

# Cp/boot/vmlinuz-2.6.32-431.el6.x86_64/mnt/boot/vmlinuz

# Cp/boot/initramfs-2.6.32-431.el6.x86_64.img/mnt/boot/initramfs

# Cd/mnt/sysroot

# Mkdir-PV bin sbin usr/{bin, sbin, lib64} lib64 etc home root Dev MNT proc sys var TMP Media

# Sync

---------------------------------------- ------

[Copy database files]

# Which bash

# LDD/bin/bash

# Cp/lib64/libtinfo. so.5/mnt/sysroot/lib64/

# Cp/lib64/libdl. so.2/mnt/sysroot/lib64/

# Cp/lib64/libc. so.6/mnt/sysroot/lib64/

# Cp/lib64/ld-linux-x86-64.so.2/mnt/sysroot/lib64/

# Sync

---------------------------------------- ------

[The original machine is suspended, and the new machine is loaded to the disk to start]


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.