In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you how to make a relatively simple Linux system, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Create a new virtual machine (name: linux, type: Linux, version: Ubuntu (64bit))
Except for the virtual hard disk size setting of 2 G, other options default.
two。 Add the above virtual hard disk to a virtual machine where ubuntu has been installed.
First, select Settings-> Save-> Controller: SATA- > add Virtual hard disk on the installed ubuntu.
Find the virtual hard disk created in step 1.
3. Start the installed ubuntu. Partition the virtual hard disk.
Figure / dev/sdb is the virtual hard disk of step 1.
Partition command: sudo fdisk / dev/sdb
There is only one primary partition:
4. Install grub boot to the virtual hard disk.
a. Format / dev/sdb1 into the ext4 file system. As shown in the figure:
b. Mount / dev/sdb1 to / mnt.
Command: sudo mount-t ext4 / dev/sdb1 / mnt/
c. Install grub.
5. Add grub.cfg
The easiest way is to copy / boot/grub/grub.cfg to / mnt/boot/grub/, on the ubuntu virtual machine and modify it.
a. Modify all uuid and replace the original uuid with the uuid (sdb1) shown in the figure (each partition has a unique uuid).
b. Modify 147165182 lines as shown in the picture.
6. Copy vmlinux and ramdisk.
7. Write an init program to test whether the kernel can start.
Compile command: gcc-static main.c-o init, then copy init to / mnt.
8. Create three proc,sys,dev folders under / mnt, and / mnt contains the following:
9. Start the linux virtual machine, as shown in the figure, indicating that the kernel and init are running successfully.
10. Copy sh and ls command programs and dynamic libraries. (more commands can be copied)
Note: the bash of a ubuntu system cannot be treated as an init process here. Sh is actually a dash.
a. First create a bin,lib/x86_64-linux-gnu,lib64 folder under / mnt.
B.sudo cp / bin/sh / bin/ls. / bin/
c. Check which dynamic libraries are required for sh,ls, as follows:
d. Copy the dynamic library of step c to lib/x86_64-linux-gnu and lib64.
11. Start the linux virtual machine, modify the init=/bin/sh of grub.cfg before startup, or modify it at startup. The results are as follows:
On how to make a relatively simple Linux system to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 257
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.