Mateen Ahmed

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 14 April 2013

Reinstall a corrupted boot partition.

Posted on 10:00 by Unknown

Reinstall a corrupted boot partition.

 Issue
In a system where the "/boot" partition is a separate partition, when /boot is corrupted or be
formatted mistakenly, you can not boot the system but do not want to reinstall the whole
system.
Environment
• Red Hat Enterprise Linux, CentOS, Fedora/
• /boot partition is installed on the first partition of your first disk
• x86 architecture
Resolution
Reinstall /boot partition manually with the following steps:
1. Boot the system into rescue mode with the help of CD or DVD:
   At boot prompt, type "linux rescue".
This will start the rescue mode program.
You will be prompted for your keyboard and language requirements.
Enter these values as
you would during the installation of Red Hat Enterprise Linux.
Next, a screen will appear telling you that the program will now attempt to find a Red Hat
Enterprise Linux installation to rescue. Select "Continue" on this screen.
2. At the "sh-3.1" prompt, chroot to /mnt/sysimage:
# chroot /mnt/sysimage
3. Make sure the boot partition is labeled as described in /etc/fstab. (Assuming the boot partition is /dev/sda1):
# e2label /dev/sda1 /boot
4. Make sure the boot partition is mounted:
# mount /dev/sda1 /boot
5. Mount the CD to install the following rpms:
# mkdir /mnt/iso
# mount -o loop,ro /dev/hdc /mnt/iso
# cd /mnt/iso/Server
# rpm -Uvh --replacefiles --replacepkgs grub-0.97-13.i386.rpm
# rpm -Uvh --replacefiles --replacepkgs redhat-logos-4.9.16-1.noarch.rpm
# rpm -ivh --replacefiles --replacepkgs kernel-2.6.18-8.el5.i686.rpm
6. Install the GRUB:
# grub-install /dev/sda
7. If /boot/grub/grub.conf is lost, you need to create it manually. The following is a sample of
grub.conf, please make sure the the file "vmlinuz-2.6.18-8.el5" and "initrd-2.6.18-8.el5.img"
exist under the directory of /boot (which should be installed after step 4).
8. default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.18-8.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/
initrd /initrd-2.6.18-8.el5.img
9. Make a soft link to grub.conf:
# cd /boot/grub
# ln -s grub.conf menu.lst
Then reboot the system.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Linux Kernel /etc/sysctl.conf
    /etc/sysctl.conf can be a powerful way of changing kernel settings at run-time. If you have sysctl.conf support compiled into your kernel, y...
  • Domain name formulation
    The right-most label conveys the top-level domain; for example, the domain name  www.example.com  belongs to the top-level domain com. The h...
  • How To Add a non-login User in Linux so that he/she doesn't have shell.
    useradd & usermod commands are used to add and modify the users in linux. When invoked without the -D option, the useradd command creat...
  • To Increase Networking Performance Network Stack (Buffers Size)
    By default the Linux network stack is not configured for high speed large file transfer across WAN links. This is done to save memory resour...
  • SVN Server on RHEL6
    Subversion (SVN) is a version control system initiated in 2000 by CollabNet Inc. It is used to maintain current and historical versions of f...
  • Types of NameServer
                                                            There are four primary nameserver configuration:    Master Server:  The primary mast...
  • Apache Security with SELinux
    Security with Apache is an important topic, of which SELinux is a part. The reason for discussing SELInux at this point is so that you have ...
  • How do I hide the Apache version number under Linux server?
    You can easily hide Apche (httpd) version number and other information. There are two config directives that controls Apache version. The S...
  • Configuring ssh Server
                                                          SSH SERVER CONFIGURATIONS ssh command is a client remote login program to connect remo...
  • TOP - Process Activity Command
    The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-int...

Blog Archive

  • ▼  2013 (19)
    • ►  July (1)
    • ►  June (6)
    • ►  May (1)
    • ▼  April (11)
      • To Increase Networking Performance Network Stack (...
      • Linux Kernel /etc/sysctl.conf
      • User Accounts and Strong Password Policy
      • Nice Process Handling In Linux
      • Hacking Password Protected Single User Mode
      • Minimal Services Set-Up For a CentOS
      • Samba as a PDC with tdbsam as a backend on CentOS
      • Your Console
      • Kdump Configuration
      • Auto Login to GUI and to TTY terminal in RHEL/CENTOS
      • Reinstall a corrupted boot partition.
  • ►  2012 (12)
    • ►  December (11)
    • ►  November (1)
Powered by Blogger.

About Me

Unknown
View my complete profile