Sponsored Content
Full Discussion: Grub Bootloader & CentOS
Operating Systems Linux Red Hat Grub Bootloader & CentOS Post 302965222 by Nvizn on Monday 25th of January 2016 04:15:36 PM
Old 01-25-2016
Grub Bootloader & CentOS

I'm clueless about Grub and having issues with CentOS6.6 that is installed on the box. It also has Windows 8.1 installed. I want to reinstall CentOS to version 7, but want to insure I don't wipe anything, and the bootloader remains as is, but includes the new CentOS installation. How do I go about this? I've been unable to locate some good details on how this works. Thanks!
 

10 More Discussions You Might Find Interesting

1. Ubuntu

CentOS, Fedora & RedHat in 1 box

Hi Linux gurus, My boss had asked me to setup a box consisting of this 3 OS (CentOS, Fedora, RedHat) for autopatching. So, whenever there is new patches for CentOS from the internet, this box will grab it, implement it, if tested ok and approved, the patches will then be push to Production... (23 Replies)
Discussion started by: raybakh
23 Replies

2. UNIX for Dummies Questions & Answers

grub problem- keeps rebooting as soon as it tries to do grub

Hi, I installed solaris 10 a few weeks ago. It was working fine during the past two weeks. However, now when I start to load to the drive, I get this problem: The BIOS screen comes up like normal, then screen goes blank and a message "Grub loading stage 2" flashes real quick then the computer... (1 Reply)
Discussion started by: moesays
1 Replies

3. Virtualization and Cloud Computing

virtualization in RHEL 5.3 & Centos 5.3

Hi I would like to know how to do virtualization in Rhel 5.3 and Cent os 5.3, As i am new this Virtualization need guidence how to install and configure guest os in Rhel and Cent Os can some one guide me step by step Regards Solaris8in (1 Reply)
Discussion started by: solaris8in
1 Replies

4. Linux

Bootloader problem Grub.

Hello, I have some questions about my Mandriva Linux. My father died last year and so I got automatically forced to use Linux (master computer). I have become a little bit known with it, had to reset the root password via command lines etc. But I have some problems I can't solve on my own. In... (0 Replies)
Discussion started by: blabla9002
0 Replies

5. UNIX for Dummies Questions & Answers

Bootloader problem Grub.

Bootloader problem Grub. Hello, I have some questions about my Mandriva Linux. My father died last year and so I got automatically forced to use Linux (master computer). I have become a little bit known with it, had to reset the root password via command lines etc. But I... (11 Replies)
Discussion started by: blabla9002
11 Replies

6. Windows & DOS: Issues & Discussions

Dual boot XP and Centos 5.x using the NTLDR bootloader

How can one dual boot Windows XP sp2 and Centos 5.x using the NTLDR bootloader? I wanted to install CentOS onto a spare partition on a machine with Windows XP already installed, leaving the MBR as it was and using the NTLDR bootloader. (2 Replies)
Discussion started by: proactiveaditya
2 Replies

7. Red Hat

Can we specify which grub.conf to use in grub-install.

Hi, Can we specify which grub.conf to use while installing grub on RHEL. We are working on application which requires different grub configurations needed, depending on certain criteria we need to update grub with correct grub.conf. Can we use grub-install for this purpose? (4 Replies)
Discussion started by: successlin
4 Replies

8. Red Hat

How to Upgrade Centos 5.7 using Centos 5.8 ISO image on Vmware workstation

Dear Linux Experts, On my windows 7 desktop with the help of Vmware workstation (Version 7.1), created virtual machine and installed Centos 5.7 successfully using ISO image. Query : Is this possible to upgrade the Centos 5.7 using Centos 5.8 ISO image to Centos version 5.8?.. if yes kindly... (2 Replies)
Discussion started by: Ananthcn
2 Replies

9. Ubuntu

How do I re-install my bootloader?

I accidently altered my partition table. Somehow I wiped it out completely and changed the disk label. Before I rebooted I managed to rebuild it the way it originally was using the original structure and label however I need to re-install a new bootloader for the new MBR. I have Ubuntu 14.04TLS... (1 Reply)
Discussion started by: project722
1 Replies

10. Linux

Centos 7.2 Convert single LVM to RAID Mirror Reinstall BootLoader

Hello, I am trying to convert a single-drive Centos 7.2 installation with LVM into a two-disk mdadm mirror with mrrored LVM. I was able to follow the excellent instructions at: http://www.dgoradia.com/creating-a-raid1-mirrored-on-an-existing-centos-on-lvm/and did create a two-disk mirror... (1 Reply)
Discussion started by: Clovis_Sangrail
1 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 01:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy