In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to carry out linux rc.sysinit repair, in view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Delete all files in the boot directory
# delete / boot, and then restart
[root@serv01 boot] # rm-rf *
[root@serv01 boot] # ls
[root@serv01 boot] # reboot
# will find an error
Error 15
# We shut down the virtual machine, then use the CD to drive, pay attention to adjust the memory to 800m; restart the computer, press the ESC key at the moment of startup, enter Boot Menu, and select CD-ROM Drive
# enter the boot interface, select Rescueinstalled system,Choose a language, select English,Keyboad Type, select us,Rescue method, select Local CD/DVD,Setup networking, select no,Rescue, select Contiune,Rescue, select ok, and select ok,shell start shell again in the next interface to start shell.
# found that you are entering bash, and cd / boot is not allowed at this time
# enter chroot/mnt/sysp_w_picpath to enter /, then enter / boot, and find that bash becomes sh
# configure yum source
Ls
Ls / iso
Mount / dev/cdrom / iso
# reinstall the kernel
Yum reinstall kernerl-y
# you can also install rpm-ivhkenerl-xxx-- force-- replacefiles using rpm
# install grub
Grub-install / dev/sda
# exit sh
Exit
# enter bash and restart
Reboot
# enter grub and execute the following (press Tab)
Root (hd0,0)
Kernel / vmlinuz-2.6.32-131.0.15.el6.x86_64
Initrd / initramfs-2.6.32-131.0.15.el6.x86_64.img
Boot
# enter grub again and execute the following in turn
Root (hd0,0)
Kernel / vmlinuz-2.6.32-131.0.15.el6.x86_64
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
Boot
# if the repair is successful, you can edit the nf file and do not reboot next time. The nf file is as follows
[root@serv01 opt] # cd / boot/grub/
[root@serv01 grub] # vim nf
[root@serv01 grub] # cat nf
Default=0
Timeout=5
Title RedHat Server 6.1
Root (hd0,0)
Kernel/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=/dev/sda2
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
[root@larrywen /] # ssh 192.168.1.11
Root@192.168.1.11's password:
Last login: Wed Jul 31 18:05:19 2013 from192.168.1.1
# it is recommended to put the / boot partition in the first place
2. Rc.sysinit file is missing
# if the rc.sysinit file is missing, enter repair mode. The method is the same as above. Just reinstall (copy) this file.
[root@serv01 grub] # ls / etc/rc.d/rc.sysinit
/ etc/rc.d/rc.sysinit
# installation error
[root@serv01 grub] # yum install / etc/rc.d/rc.sysinit
# reinstall
[root@serv01 grub] # yum reinstall / etc/rc.d/rc.sysinit
[root@serv01 ~] # rpm-qf / etc/rc.d/rc.sysinit
Initscripts-9.03.23-1.el6.x86_6
# other system files are missing, similar operations
3. Grub.conf file is deleted
[plain]
# you can see that / etc/grub.conf/boot/grub/grub.conf is the same file
[root@serv01 ~] # ls / etc/grub.conf/boot/grub/grub.conf-l
-rw-. 1 root root 817 Jul 30 23:47 / boot/grub/grub.conf
Lrwxrwxrwx. 1 root root 22 Jul 23 00:57 / etc/grub.conf->.. / boot/grub/grub.conf
# cannot boot solution after deleting grub.conf file
# first step, check the disk partition
[root@serv01] # df-h
Filesystem Size Used Avail Use% Mounted on
/ dev/sda2 9.7G 1.1G 8.1g 12% /
Tmpfs 188m 0 188m 0% / dev/shm
/ dev/sda1 194M 25M 160M 14% / boot
/ dev/sda5 4.0G 137m 3.7G 4% / opt
/ dev/sr0 3.4G 3.4G 0100% / iso
# enter the directory to delete the grub.conf file
[root@serv01 ~] # cd / boot/grub/
[root@serv01 grub] # rm-rf grub.conf
[root@serv01 grub] # reboot
# enter these commands in turn
Root (hd0,0)
# holding down the tab key in this step will make it up automatically
Kernel /
# then add root=/dev/sda2 at the end. Note that your machine is not necessarily / dev/sda2. You need to check which partition the root partition belongs to through df-h.
Kernel / vmlinuz-2.6.32-131.0.15.el6.x86_64ro root=/dev/sda2
# holding down the tab key in this step will also make it up automatically.
Initrd /
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
# Note: if you have multiple kernels, you need to choose by yourself.
# finally, enter boot to restart
# after restarting, go to the boot directory and find that this file is not generated
[root@serv01 ~] # cd / boot/grub/
[root@serv01 grub] # ls grub.conf
Ls: cannot access grub.conf: No such fileor directory
# the next time we start, we find that we still need to reboot. At this time, we recreate the file and enter the following.
# here's a tip. When we use vim to edit a file, we can read the command in command mode and easily read and copy (! Indicates the execution of a command)
R! ls/boot/initramfs-2.6.32-131.0.15.el6.x86_64.img
[root@serv01 grub] # vim grub.conf
[root@serv01 grub] # cat grub.conf
Default=0
Timeout=5
Title RedHat Server 6.1
Root (hd0,0)
Kernel/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=/dev/sda2
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
[root@larrywen grub] # ls
Device.map splash.xpm.gz
[root@serv01 grub] # find. -name "* stage*"
. / minix_stage1_5
. / stage1
. / xfs_stage1_5
. / ufs2_stage1_5
. / ffs_stage1_5
. / e2fs_stage1_5
. / stage2
. / jfs_stage1_5
. / iso9660_stage1_5
. / vstafs_stage1_5
. / fat_stage1_5
. / reiserfs_stage1_5
# deleting all files with stage does not affect it. Restart is still normal.
[root@serv01 grub] # find. -name "* stage*" | xargs rm-rf {}\
[root@serv01 grub] # ll
Total 8
-rw-r--r--. 1 root root 63 Jul 23 00:57 device.map
-rw-r--r--. 1 root root 170 Jul 31 00:30 grub.conf
Lrwxrwxrwx. 1 root root 11 Jul 23 00:57 menu.lst->. / grub.conf
-rw-r--r--. 1 root root 1341 May 7 2010splash.xpm.gz
Enter the boot directory, delete all the files, and restore it with continuous connection.
[plain]
[root@serv01 ~] # cd / boot
[root@serv01 boot] # ls
Config-2.6.32-131.0.15.el6.x86_64 initramfs-2.6.32-131.0.15.el6.x86_64.img System.map-2.6.32-131.0.15.el6.x86_64
Efi lost+found vmlinuz-2.6.32-131.0.15.el6.x86_64
Grub symvers-2.6.32-131.0.15.el6.x86_64.gz
[root@serv01 boot] # rm-rf *
[root@serv01 boot] # ll
Total 0
# step 1: install grub
[root@serv01 boot] # grub-install / dev/sda
Probing devices to guess BIOS drives. Thismay take a long time.
Installation finished. No error reported.
This is the contents of the device map / boot/grub/device.map.
Check if this is correct or not. If any ofthe lines is incorrect
Fix it and re-run the script `grub-install'.
(fd0) / dev/fd0
(hd0) / dev/sda
# step 2: install kernel
[root@serv01 boot] # yum reinstall kernel-y
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Setting up Reinstall Process
Rhel-iso | 4.0 kB 00:00...
Resolving Dependencies
-> Running transaction check
-- > Package kernel.x86_640:2.6.32-131.0.15.el6 will be installed
-> Finished Dependency Resolution
Dependencies Resolved
=
Package Arch Version Repository Size
=
Reinstalling:
Kernel x8631 64 2.6.32-131.0.15.el6 rhel-iso 23 M
Transaction Summary
=
Reinstall 1 Package (s)
Total download size: 23 M
Installed size: 108 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: kernel-2.6.32-131.0.15.el6.x86_64 1 Compact 1
Duration: 263 (ms)
Installed products updated.
Installed:
Kernel.x86_64 0VOR 2.6.32-131.0.15.el6
Complete!
[root@serv01 boot] # ls
Config-2.6.32-131.0.15.el6.x86_64 initramfs-2.6.32-131.0.15.el6.x86_64.img System.map-2.6.32-131.0.15.el6.x86_64
Grub symvers-2.6.32-131.0.15.el6.x86_64.gz vmlinuz-2.6.32-131.0.15.el6.x86_64
# enter the grub directory, and then create a new grub.conf file
[root@serv01 boot] # cd grub/
[root@serv01 grub] # ll
Total 268
-rw-r--r--. 1 root root 30 Jul 31 00:44 device.map
-rw-r--r--. 1 root root 13396 Jul 31 00:44 e2fs_stage1_5
-rw-r--r--. 1 root root 12620 Jul 31 00:44 fat_stage1_5
-rw-r--r--. 1 root root 11764 Jul 31 00:44 ffs_stage1_5
-rw-r--r--. 1 root root 11772 Jul 31 00:44 iso9660_stage1_5
-rw-r--r--. 1 root root 13300 Jul 31 00:44 jfs_stage1_5
-rw-r--r--. 1 root root 11956 Jul 31 00:44 minix_stage1_5
-rw-r--r--. 1 root root 14444 Jul 31 00:44 reiserfs_stage1_5
-rw-r--r--. 1 root root 512 Jul 31 00:44 stage1
-rw-r--r--. 1 root root 126040 Jul 31 00:44stage2
-rw-r--r--. 1 root root 12040 Jul 31 00:44 ufs2_stage1_5
-rw-r--r--. 1 root root 11396 Jul 31 00:44 vstafs_stage1_5
-rw-r--r--. 1 root root 13980 Jul 31 00:44 xfs_stage1_5
[root@serv01 grub] # vim grub.conf
# the file content is as follows
[root@serv01 grub] # cat grub.conf
Default=0
Timeout=5
Title Redhat Server 6.1
Root (hd0,0)
Kernel/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=/dev/sda2 quiet
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
[root@serv01 grub] # reboot
Broadcast message from root@serv01.host.com
(/ dev/pts/0) at 0:47.
The system is going down for reboot NOW!
[root@serv01 grub] # Connection to192.168.1.11 closed by remote host.
Connection to 192.168.1.11 closed.
# reboot and then reconnect, successful, OK!
[root@larrywen Desktop] # ssh 192.168.1.11
Root@192.168.1.11's password:
Last login: Wed Jul 31 00:43:50 2013 from192.168.1.1
[root@serv01 ~] #
This is the end of the answer to the question on how to repair linux rc.sysinit. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.
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.