Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to start the Linux system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to talk to you about how to start the Linux system, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

The startup process of the Linux system is as follows:

BIOSBasic Input Output System

MBRstage1 (the first stage), the first 512-byte image of the hard disk. If the hard disk is hung up, you can rewrite this file.

GRUB

Load kernel

The init process is 1

Runlevel

The Linux kernel file is saved in:

The first 512 bytes of the first sector of a bootable device must be the last two bytes of 55AA

The boot code is the first 446 bytes

Stage2 is the second phase, and then various file systems are loaded

Grub can boot all operating systems

/ boot/grub/grub.conf (config.ini)

Configuration format

Title CentOS

Root (hd0,1)

Kernel / boot//boot/vmlinuz-2.6.32-279.el6.i686 ro root=UUID=77272833-B6BB-4D53-B043-9541D1102EBD

Initrd / boot/initramfs-2.6.32-279.el6.i686.img

Title redhat RHEL6

Root (hd1,0)

Kernerl / boot/vmlinuz ro root=UUID= {Root partition}

Initrd / boot/initrd.img

/ boot/vmlinuz kernel file (very compact)

/ boot/vmlinuz-2.6.32-279.el6.i686

/ boot/initramfs kernel module (some modules that are not commonly used in the kernel are packaged)

/ boot/initramfs-2.6.32-279.el6.i686.img

Can be loaded dynamically when needed

The early Red Hat 5initrd was replaced by Red Hat 6initramfs.

1. The command dmesg displays the kernel startup information

2.cd / var/log/

Less dmesg

Top command to view system progress

Init is the first process that the system runs (the parent of all processes)

Calling / etc/rc.d/rc.sysinit is responsible for initializing the system, mounting the file system, and starting the corresponding service according to the run level

Run runlevel View level

Linux run level:

0 shutdown

1 single user mode single

2 multi-user mode without network

3 command line multi-user mode is commonly used

4 unused

5 x11 graphical interface mode is better than 3 graphical interfaces, the other is the same

6 restart

Inint 5

The run level is saved in the configuration file: a file is used to modify the configuration

/ etc/inittab

Id:5:initdefault

/ etc/init/ different functions of saving configuration files are saved in different files, and the function is similar to inittab.

Eg.

Vi / etc/init/control-alt-delete

Exec / sbin/shutdown-r now "Control-Alt-Delete pressed"

Comment out and add #

Eg.

Tty.conf terminal profile

Cat tty.conf

Cat start-ttys.conf (default startup terminal)

Eg.

System service

Cd / etc/rc.d/

Ls

Cd rc5.d/

Ls

The command runlevel displays the current and previous runlevel

The command init modifies the current runlevel

Init 3

Recoverable root password in single user mode

Pass parameter 1 or single to the kernel to enter single-user mode

Single-user mode does not perform any services

Single-user mode logs in directly as root user and does not require a password

At startup, press e to modify boot parameters to add parameters to the kernel

Then press b to start

Prevent others from changing passwords in this way

You can modify the / boot/grub/grub.conf file to add password permissions for modification

Password-- md5 $1$ aoWpTe$/MWUUYbB1F.2RUZK8nbWU0

The encrypted password can be generated through the grub-md5-crypt command

If you forget about this encryption, you can only drag the hard drive down and boot to another Linux system, then delete the configuration file and edit the boot file.

The most secure encryption. Partition-level encryption.

After reading the above, do you have any further understanding of how to start the Linux system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report