In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to build chroot under Linux. I hope you will get something after reading this article. Let's discuss it together.
Chroot is an operation in the unix system that changes its explicit root directory for the running software process and its child processes. A program that runs in this environment and sets the root directory through chroot cannot access files outside the specified root directory, read or change its contents.
Using yum, the installation package manager for Red Hat and CentOS systems, it is very easy to create a chroot environment. The steps are as follows:
\ 1. Create a new directory for chroot, for example:
Mkdir-p / var/jail/chroot
\ 2. To build a chroot environment, you first need to initialize the rpm database.
Mkdir-p / var/jail/chroot/var/lib/rpmrpm-- rebuilddb-- root=/var/jail/chroot
3. To save time, download the CentOS distribution manually and install it using the rpm command:
Wget http://mirror.centos.org/centos/6/os/i386/Packages/centos-release-6-0.el6.centos.5.i686.rpm (or whatever version you want to use) rpm-I-root=/var/jail/chroot-nodeps centos-release-6-0.el6.centos.5.i686.rpm
\ 4. Use the YUM tool to install the remaining packages of the CentOS distribution to the virtual chroot environment.
Yum-- installroot=/var/jail/chroot install-y rpm-build yum
\ 5. Finally, when the whole process is over (which will take a while), you can initialize chroot and try the new system:
Chroot / var/jail/chroot
If all goes well, you already have a relatively simple working chroot environment. However, if you want to actually use this environment, you need other important filesystem essential components, such as / proc and / dev. You can follow the instructions in the link above.
The translator added: the proc file loads the script to determine whether the proc file has been loaded, and calls mount without loading:
Mount-l | grep "/ var/jail/chroot/proc" > / dev/nullif [$?! = 0] then sudo mount-t proc chroot_proc / var/jail/chroot/proc/fi
After reading this article, I believe you have some understanding of "how to build chroot under Linux". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
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: 0
*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.