Sponsored Content
Operating Systems Linux How to get back Linux Grub screen Post 62877 by locustfurnace on Monday 21st of February 2005 07:00:32 AM
Old 02-21-2005
Boot on your GNU/Linux distro's recovery CD or floppy recovery disk you made when you installed your system. Once booted up, mount your filesystem. Once you have your root partition mounted, just chroot to the mounted filesystems. The re run your grub installation.

Bascially, boot up, create a mount point, mount the necessary partitions accordingly. I am not sure of the command to re-run grub, as I only use LILO.

For example after booting the recovery medium:

cd /
mkdir /mnt2
mkdir /mnt/boot
mkdir /mnt/usr

mount /dev/hda1 /mnt2
mount /dev/hda2 /mnt/boot
mount /dev/hda3 /mnt2/usr

chroot /mnt2

Then re-run your grub bootloader as per instructions.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can't get GRUB to boot Linux!!!

I have installed Linux 7.2 on a IBM xseries 235 server with 5 scsi hard drives and ServerRaid-5i Ultra320 scsi controller. I started my installation by configuring the raid controller. I created 2 arrays, raid 1 and raid5. I then proceeded to install Linux and load the drivers. After the... (2 Replies)
Discussion started by: cstovall
2 Replies

2. UNIX for Dummies Questions & Answers

in need of serious help with Grub and Linux, Windows XP

Ok, here's the thing... I have a computer that has both Fedora Core 3 Linux and Windows XP Pro. I have it so the MBR loads in the Windows style (black screen with a 30 second pause to choose either Fedora Core or Windows) Now if I select Fedora Core, it starts its own OS selector (I believe it's... (11 Replies)
Discussion started by: mattzway
11 Replies

3. UNIX for Dummies Questions & Answers

Is there a way to get rid of GRUB and any OS selector so that Linux starts....

Is there a way to get rid of GRUB and any Linux OS selector so that Linux starts automatically without having to wait for GRUB to go through it's OS choice process? I want to keep the Windows OS selector and have it so when I select Linux, it goes right to Linux and not another selector. Know what... (0 Replies)
Discussion started by: mattzway
0 Replies

4. Solaris

Blank GRUB Screen

Hello. I had installed solaris 10 in morning , and all was running fine... I just logged out and logged in with another user ID oracle - It got stuck and then I pressed the button for restart. Now I see only word GRUB written in top line rest everything is black. What to do? (2 Replies)
Discussion started by: panchpan
2 Replies

5. Red Hat

Grub screen issue while booting......

Hi Gurus..... My system is dual boot, having Win XP & Red Hat Enterprise Linux 5. Initially I use to boot linux by pressing "tab" key, which was showing me two OS listed in Grub. Since last few days, I'm not able to get that grub screen even if I press "tab" or any key while my system... (5 Replies)
Discussion started by: Amol21
5 Replies

6. Red Hat

grub splash screen not displayed

I re-installed grub on /dev/sdb on a 3ware raid machine and now the grub splash screen is not displayed when booting. Server when boots up comes and halt in the grub menu and I need to manually load kernel and initrd to get the machine up. I have not changed any grub setting. I used the command... (0 Replies)
Discussion started by: anil510
0 Replies

7. UNIX for Advanced & Expert Users

Grub installation fails in Linux BMR..

Hi all, This topic is purely on a problem in installing grub in my LINUX BMR process... A major problem too.. I am designing Linux BMR where i do the following.. Backup the " / " as a whole .. with partition details ..etc And using the Knoppix Live CD i first create the partitions... (1 Reply)
Discussion started by: selvarajvs
1 Replies

8. Ubuntu

Linux LVM.. Grub not loading from replaced disk

Hi, a little while ago, one of the GPT Partitioned hard disk had gone faulty in a Mirror RAID and is now successfully replaced. here is how I did that. 1) created identical partition table on the new disk. 2) attached the mirrors using md commands. The whole procedure is given... (5 Replies)
Discussion started by: busyboy
5 Replies

9. UNIX for Dummies Questions & Answers

Linux first or GRUB first ?

Hi everyone, I am having trouble of understanding the concept of GRUB bootloader in Linux. My questions are-: Do we install GRUB first and then install Linux ? Does GRUB act as a bootloader for Windows if we are trying to dual boot Windows and Linux ? Or does GRUB load the Windows... (4 Replies)
Discussion started by: sreyan32
4 Replies
Bootloader::Library(3)					User Contributed Perl Documentation				    Bootloader::Library(3)

NAME
Bootloader::Library - library for accessing configuration of the bootloader PREFACE
This package is the public API to configure bootloader settings SYNOPSIS
"use Bootloader::Library;" "$obj_ref = Bootloader::Library->new ();" "$status = Bootloader::Library->SetLoaderType ($bootloader);" "$status = Bootloader::Library->DefineMountPoints (\%mountpoints);" "$status = Bootloader::Library->DefinePartitions (@partitions);" "$status = Bootloader::Library->DefineMDArrays (\%md_arrays);" "$status = Bootloader::Library->ReadSettings ();" "$status = Bootloader::Library->WriteSettings ();" "$status = Bootloader::Library->ReadSettingsTmp ($tmp_dir);" "$status = Bootloader::Library->WriteSettingsTmp ($tmp_dir);" "$files_contents_ref = Bootloader::Library->GetFilesContents ();" "$status = Bootloader::Library->SetFilesContents (\%files_contents);" "$status = Bootloader::Library->UpdateBootloader ($avoid_init);" "$status = Bootloader::Library->InitializeBootloader ();" "$file_list_ref = Bootloader::Library->ListConfigurationFiles ();" "$settings_ref = Bootloader::Library->GetSettings ();" "$status Bootloader::Library->SetSettings ($settings_ref);" "$global_ref = Bootloader::Library->GetGlobalSettings ();" "$status = Bootloader::Library->SetGlobalSettings ($global_settings_ref);" "$sections_ref = Bootloader::Library->GetSections ();" "$status = Bootloader::Library->SetSections ($sections_ref);" "$device_map_ref = Bootloader::Library->GetDeviceMapping ();" "$status = Bootloader::Library->SetDeviceMapping ($device_map_ref);" "$unix_dev = Bootloader::Library->GrubDev2UnixDev ($grub_dev);" "$result = Bootloader::Library::DetectThinkpadMBR ($disk);" "$result = Bootloader::Library::WriteThinkpadMBR ($disk);" DESCRIPTION
"$obj_ref = Bootloader::Library->new ();" Creates an instance of the Bootloader::Library class. "$status = Bootloader::Library->SetLoaderType($bootloader);" Initializes the library for the particular bootloader. Takes the name of the bootloader as parameter. Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $status = Bootloader::Library->SetLoaderType ("lilo"); if (! defined ($status)) { die "Error occurred while initalizing for LILO"; } "$status = Bootloader::Library->DefineMountPoints (\%mountpoints);" Defines mount points in the system so that the library does not need to probe them itself when needed. Parameter (mountpoints) is a hash reference (key is mountpoint, value device). Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $mp = { "/" => "/dev/hda3", "/boot" => "/dev/hda1", } Bootloader::Library->DefineMountPoints ($mp); "$status = Bootloader::Library->DefinePartitions (@partitions);" Defines the information about partitions - what disk a partition belongs to and the number of the partition Parameter (partitions) is a list, one entry per partition, each entry is a 3-item list, containing the device of the partition, the device of the disk the partition belongs to, and the number of the partition (first is 1). Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $part = [ [ "/dev/hda1", "/dev/hda", 1], [ "/dev/hda3", "/dev/hda", 3] ]; Bootloader::Library->DefinePartitions ($part); "$status = Bootloader::Library->DefineMDArrays (\%md_arrays);" This interface is broken by design and its use is deprecated!! We only need information about mirrored devices (RAID1) and only GRUB uses that hack. Defines the information about MD RAID arrays (what array is built by what disks). As parameter, it takes a reference to a map of all MD devices, where key is the MD device name, and value a reference to a list of its members. Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $md = { "/dev/md0" => ["/dev/hda1", "/dev/hdc1"], "/dev/md1" => ["/dev/hda2", "/dev/hdc2"], }; Bootloader::Library->DefineMDArrays ($md); "$status = Bootloader::Library->DefineMultipath (\%multipath);" Define hardware information about multipath device. We only need information to write to device map real device, because created multipath device doesn't have geometry and GRUB doesn't work. As parameter, it takes a reference to a map of all multipath devices, where key is the physical value (/dev/sda), and value a multipath device(/dev/mapper/...). Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $mp = { "/dev/sda" => "/dev/mapper/little_mapper", "/dev/sdb" => "/dev/mapper/little_mapper", }; Bootloader::Library->DefineMultipath ($mp); "$status = Bootloader::Library->DefineMultipath (\%multipath);" Define udev mapping of devices. We only need information for GRUB to translate udev device to kernel and then to grub device. As parameter, it takes a reference to a map of all udev names to correspond kernel names. Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $mp = { "/dev/disks/by-id/longhorribleid" => "/dev/sda", "/dev/disks/by-id/longhorribleid-part1" => "/dev/sda1", }; Bootloader::Library->DefineUdevMapping ($mp); "$status = Bootloader::Library->ReadSettings ();" Reads the settings from the system Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $status = Bootloader::Library->ReadSettings (); if (! defined ($status)) { die "Error occurred while reading the settings"; } "$status = Bootloader::Library->WriteSettings ();" Writes the settings to the system. Does not activate the bootloader or the written settings, InitializeBootloader or UpdateBootloader functions must be used for it. Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $status = Bootloader::Library->WriteSettings (); if (! defined ($status)) { die "Error occurred while writing the settings"; } "$status = Bootloader::Library->ReadSettingsTmp ($tmp_dir);" Reads the settings from the Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $status = Bootloader::Library->ReadSettingsTmp ("/tmp"); if (! defined ($status)) { die "Error occurred while reading the settings"; } "$status = Bootloader::Library->WriteSettingsTmp ($tmp_dir);" Writes the settings to temporary directory. Slashes in the filename are replaced with underscores. Returns undef on fail, defined nonzero value otherwise. EXAMPLE: my $status = Bootloader::Library->WriteSettingsTmp ("/tmp"); if (! defined ($status)) { die "Error occurred while writing the settings"; } "$files_contents_ref = Bootloader::Library->GetFilesContents ();" Gets the future contents of all bootloader configuration files. Returns undef on fail, hash where key is file name and value its contents as value on success. EXAMPLE: my $files_contents_ref = Bootloader::Library->GetFilesContents (); if (! defined ($files_contents_ref)) { die "Cannot get the contents of the configuration files" } my $lilo_conf = $files_contents_ref->{"/etc/lilo.conf"}; print "$lilo.conf contents: $lilo_conf "; "$status = Bootloader::Library->SetFilesContents (\%files_contents);" Sets the contents of all configuration files (eg. from editor) $status = Bootloader::Library->SetFilesContents (\%files_contents); "$status = Bootloader::Library->UpdateBootloader ($avoid_init);" Really updates the bootloader configuration after writing the settings. If initialization is needed to make the settings active, but not intended (because it will be done later), set $avoid_init to 1. It makes no efect eg. for GRUB, but prevents from calling /sbin/lilo in case of LILO Returns undef on fail, defined nonzero value otherwise EXAMPLE: my $status = Bootloader::Library->UpdateBootloader (0); if (! defined ($status)) { die "Connot update the bootloader configuration"; } "$status = Bootloader::Library->InitializeBootloader ();" Initializes the firmware to boot the bootloader Returns undef on fail, defined nonzero value otherwise EXAMPLE: my $status = Bootloader::Library->InitializeBootloader (); if (! defined ($status)) { die "Cannot initialize the bootloader"; } "$files_ref = Bootloader::Library->ListConfigurationFiles ();" Returns the list of the configuration files of the bootloader Returns undef on fail EXAMPLE: my $files_ref = Bootloader::Library->ListConfigurationFiles (); if (! defined ($files_ref)) { die "Cannot list configuration files"; } foreach my $fn (@{$files_ref}) { system ("cp $fn $fn.backup"); } "$sections_ref = Bootloader::Library->GetSettings ();" Returns the complete settings of the bootloader. Returns undef on fail. EXAMPLE: see eg. GetSections function definition "$status = Bootloader::Library->SetSettings ();" Returns the complete settings of the bootloader. Returns undef on fail. EXAMPLE: see eg. GetSections function definition "$sections_ref = Bootloader::Library->GetSections ();" Gets the sections of the bootloader. See section description above. TODO Returns undef on fail. EXAMPLE: my $sections_ref = Bootloader::Library->GetSections (); if (! defined ($sections_ref)) { die "Getting sections failed"; } my @sect_names = map { $_->{"name"}; } @{$sections_ref}; my $list = join ", " @sect_names; print "Sections: $list"; "$global_ref = Bootloader::Library->GetGlobalSettings ();" Gets the global settings of the bootloader. See the example map above TODO Returns undef on fail. EXAMPLE: my $global_ref = Bootloader::Library->GetGlobalSettings (); if (! defined ($global_ref)) { die "Getting global data failed"; } my $default = $global_ref->{"default"}; print "Default section: $default"; "$device_map_ref = Bootloader::Library->GetDeviceMapping ();" Gets the device mapping between Linux and firmware. Returns undef on fail. EXAMPLE: $device_map_ref = Bootloader::Library->GetDeviceMapping (); if (! defined ($device_map_ref)) { die "Getting device mapping failed"; } my $hda = $device_map_ref->{"/dev/hda"}; print "/dev/hda is $hda"; "$status = Bootloader::Library->SetSections ();" Sets the sections of the bootloader. Sections have the same format as return value of GetSections (). Returns undef on fail, defined nonzero value on success. EXAMPLE: my $sections_ref = Bootloader::Library->GetSections (); if (! defined ($sections_ref)) { die "Getting sections failed"; } my @sections = @{$sections_ref}; pop @sections; my $ret = Bootloader::Library->SetSections (@sections); if (! defined ($ret)) { print ("Setting sections failed"); } "$status = Bootloader::Library->SetGlobalSettings ();" Sets the global settings of the bootloader. The argument has the same format as the return value of GetGlobalSettings (). Returns undef on fail, defined nonzero value on success. EXAMPLE: my $global_ref = Bootloader::Library->GetGlobalSettings (); if (! defined ($global_ref)) { die "Getting global data failed"; } $global_ref->{"default"} = "linux"; my $ret = Bootloader::Library->SetGlobalSettings ($global_ref); if (! defined ($ret)) { print ("Setting global options failed."); } "$status = Bootloader::Library->SetDeviceMapping ();" Sets the device mapping between Linux device and firmware identification. Returns undef on fail, defined nonzero value on success. EXAMPLE: $device_map_ref = Bootloader::Library->GetDeviceMapping (); if (! defined ($device_map_ref)) { die "Getting device mapping failed"; } $device_map_ref->{"/dev/hda"} = "(hd0)"; my $ret = Bootloader::Library->SetDeviceMapping ($device_map_ref); if (! defined ($ret)) { print ("Setting global options failed."); } "$unix_dev = Bootloader::Core::GRUB->GrubDev2UnixDev ($grub_dev);" Translates the GRUB device (eg. '(hd0,0)') to UNIX device (eg. '/dev/hda1'). As argument takes the GRUB device, returns the UNIX device (both strings). Wrapper function to be able to use this grub function in Tools.pm. "($dev,$path) = Bootloader::Library->SplitPath ($path);" Split unix path to device and relative path on this device. "$result = Bootloader::Library::DetectThinkpadMBR ($disk);" Try detect on disk if contains ThinkpadMBR. Return true if detected. "$result = Bootloader::Library::WriteThinkpadMBR ($disk);" Write generic mbr to disk on thinkpad. Return undef if fail. "$result = Bootloader::Library::ExamineMBR ($disk);" Detects what code is in MBR of device. Return string or undef if fail. Possible string is: generic -> generic MBR grub -> Grub MBR lilo -> lilo stage1 windows -> windows vista -> windows vista (has another mbr) thinkpad -> thinkpad custom mbr unknown -> unknown code invalid -> code which cannot boot perl v5.12.1 2010-05-25 Bootloader::Library(3)
All times are GMT -4. The time now is 07:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy