Tenth Week Linux

Source: Internet
Author: User

1. Please describe in detail the start-up process of the CentOS system (detailed to what each process system does)

The CentOS hosts are started in the following order

1. Post power-on self-test

2, the BIOS read the BIOS settings in the CMOS parameters to identify the underlying hardware, to find the boot device

3. MBR

1) Read the first 446 bytes of bootloader in the boot device MBR

2) The sector after the MBR is read to identify the grub and the region where the kernel kernel is located

3) Start Grub

4, GRUB Display Menu interface, select Run kernel kernel; config file is/boot/grub/grub.conf

1) provides menu and interactive interface

2) Load the user-selected kernel or operating system

3) provides a protection mechanism for the menu

5, KERNEL itself initialization

1) Detect all the hardware devices that can be identified

2) Load the hardware driver (it is possible to load the driver with RAMDisk)

3) Mount the root file system in read-only mode

4) The first application running user space:/sbin/init

6. INIT

Run/sbin/init programs, Profiles/etc/inittab and/etc/init/*.conf

Set the default run level such as Id:3:initdefault

Run the system initialization script /etc/rc.d/rc.sysinit

1) Set the host name;

2) Set welcome information;

3) Activate Udev and SELinux

4) Mount the file system defined in the/etc/fstab file;

5) Detect the root file system and re-mount the root file system in read-write mode;

6) Set the system clock;

7) Activate swap device;

8) Set kernel parameters according to/etc/sysctl.conf file;

9) activating LVM and software RAID devices

10) Load drivers for additional devices

11) Cleanup operation

Close the service that needs to be shut down in the corresponding script, start the service that needs to start (actual service command is located at/ETC/RC.D/INIT.D)

Set up a login terminal

2. Add a new piece of hardware to the CentOS 6 running on the virtual machine, providing two primary partitions;

(1) Create a new two primary partition for the hard disk, and install grub for it;

(2) Provide kernel and RAMDisk files for the first primary partition of the hard disk, and provide rootfs for the second partition;

(3) for Rootfs to provide bash, LS, cat programs and the library files that depend on;

(4) Provide the configuration file for grub;

(5) The new hard disk is set as the first boot item and can start the target host normally;

3. Make a kickstart file and a boot image. Describe its process.

4. Write a script

(1) can accept four parameters: Start, stop, restart, status

Start: Output "starting script name finished."

...

(2) Any other parameters, all error exits;

5, write a script to determine whether a given user is logged into the current system;

(1) If the login, the user login, the script terminates;

(2) Every 3 seconds, check whether the user is logged in;

6, write a script, display the user selected to view the information;

CPU) Display CPU Info

MEM) Display Memory info

Disk) Display Disk info

Quit) quit

Not these four options, the prompt error, and ask the user to re-select, only to give the correct choice;

7. Write a script

(1) Return a user's UID and shell with function implementation; The user name is passed through the parameters;

(2) Prompt the user to enter a user name or enter "quit" to exit;

When the user name is entered, the calling function displays the user information;

Exit the script when the user enters quit, and further: after displaying the user-related information you typed, remind the output user name or quit again:

8, write a script to complete the following functions (using functions)

(1) Prompt the user to enter the name of an executable command; Get all the library files that this command relies on;

(2) Copy the command file to the corresponding Rootfs path in the/mnt/sysroot directory, for example, if the original path of the copied file is/usr/bin/useradd, it is copied to the/mnt/sysroot/usr/bin/directory;

(3) Copy the library files that this command relies on to the corresponding Rootfs path in the/mnt/sysroot directory, and the rules related to the above command;


This article is from the "Chase Dream" blog, please be sure to keep this source http://sihua.blog.51cto.com/377227/1847485

Tenth Week Linux

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.