Difference between revisions of "Grub"
Line 1: | Line 1: | ||
+ | |||
+ | ==Grub== | ||
Sometime you can issue some problems with your grub often when your server doesn't want to start, there are no needs to reinstall it, just to fix your grub. | Sometime you can issue some problems with your grub often when your server doesn't want to start, there are no needs to reinstall it, just to fix your grub. | ||
− | + | ==Fix the GRUB from the startup command line== | |
− | == | ||
Normally if grub can not start and your system is nice, you have a minimum order prompt ... otherwise go to [[grub#fix_the_GRUB_with_the_systemrescuecd|Chapter 2]]. | Normally if grub can not start and your system is nice, you have a minimum order prompt ... otherwise go to [[grub#fix_the_GRUB_with_the_systemrescuecd|Chapter 2]]. | ||
Line 30: | Line 31: | ||
We must install grub on all other drives to give the capacity to operate the system. to reach the boot menu of the bios, well it depends on your hardware ... F12 under dell, Acer Esc, F11 from msi .... my sme is with Raid1 so I have two drives, you will need to adapt my example to your the number of disks. | We must install grub on all other drives to give the capacity to operate the system. to reach the boot menu of the bios, well it depends on your hardware ... F12 under dell, Acer Esc, F11 from msi .... my sme is with Raid1 so I have two drives, you will need to adapt my example to your the number of disks. | ||
− | == | + | ==Fix the GRUB with the systemrescuecd == |
{{note box| We go to work with [http://www.sysresccd.org/SystemRescueCd_Homepage SystemRescueCd] which is a Linux system rescue disk available as a bootable CD-ROM or USB stick for administrating or repairing your system and data after a crash.[http://www.sysresccd.org/Download Download]. The goal is to get mounted your logical volumes on /mnt where you can save them on a usb disk.}} | {{note box| We go to work with [http://www.sysresccd.org/SystemRescueCd_Homepage SystemRescueCd] which is a Linux system rescue disk available as a bootable CD-ROM or USB stick for administrating or repairing your system and data after a crash.[http://www.sysresccd.org/Download Download]. The goal is to get mounted your logical volumes on /mnt where you can save them on a usb disk.}} |
Revision as of 10:54, 23 June 2013
Grub
Sometime you can issue some problems with your grub often when your server doesn't want to start, there are no needs to reinstall it, just to fix your grub.
Fix the GRUB from the startup command line
Normally if grub can not start and your system is nice, you have a minimum order prompt ... otherwise go to Chapter 2.
I suppose that your SME Server is on a RAID1 of two disks, otherwise you have to adapt this HOWTO.
root (hd0,0) Filesystem type is ext2fs, partition type 0xfd
setup (hd0)
Checking if "/boot/grub/stage1" exists... no Checking if "/grub/stage1" exists... yes Checking if "/grub/stage2" exists... yes Checking if "/grub/e2fs_stage1_5" exists... yes Running "embed /grub/e2fs_stage1_5 d (hd0)"... 16 sectors embedded succeeded Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded Done.
reboot
to /dev/sdb you implement of one, similar to the following disks (sdc, sdd, sde ....)
root (hd1,0) setup (hd1)
We must install grub on all other drives to give the capacity to operate the system. to reach the boot menu of the bios, well it depends on your hardware ... F12 under dell, Acer Esc, F11 from msi .... my sme is with Raid1 so I have two drives, you will need to adapt my example to your the number of disks.
Fix the GRUB with the systemrescuecd
I suppose that your SME Server is on a RAID1 of two disks, otherwise you have to adapt this HOWTO.
- start the system with your system rescue cd or you usb stick, choose your keyboard settings
- then start the server X
startx
- open a terminal to verify if your raid is initiated.
cat /proc/mdstat
- if you are lucky the output will look like this
# cat /proc/mdstat Personalities : [raid1] md99 : active raid1 sdb1[1] sda1[0] 104320 blocks [2/2] [UU] md100 : active raid1 sdb2[1] sda2[0] 262036096 blocks [2/2] [UU] unused devices: <none>
- so we need to launch the LVM
vgchange -ay
- afterward if the LVM is launched without error messages, we can mount the LVM in /mnt
lvdisplay
- Now you have successfully mounted your LVM then do this
mkdir /mnt/sysimage mount /dev/main/root /mnt/sysimage mount -o bind /dev /mnt/sysimage/dev mount -o bind /proc /mnt/sysimage/proc chroot /mnt/sysimage /bin/bash
- We will have to mount the /boot of your system, which is normally contained in / dev/md1.
To do this you must send a
cat /proc/mdstat
- note the md(X) the smallest (about 100 megs) then in your root terminal do this:
mount /dev/md(X) /boot
and then
grub root (hd0,0) setup (hd0)
you can restart and continue the tutorial
Installation of grub on the other disks
- once your Sme started, you need to login in Root
then type
grub
device (hd0) /dev/sda root (hd0,0) setup (hd0) device (hd1) /dev/sdb root (hd1,0) setup (hd1) quit
- same for other drives, you implement one each time. My SME Server is with Raid1 so I have two drives, you will need to adapt my example to your the number of disks.
from there you can reboot your server and check that the grub is installed on each hd. it is simple, with the boot menu or bios, you say on what hd you want to boot . to reach the boot menu of the bios, well it depends on your hardware ... F12 under dell, Acer Esc, F11 from msi ....
Fix Grub on a HP Proliant DL380 G2
see bugzilla:7024 for more information
The server is configured using the Hardware RAID in RAID5, 6 drives as 1 logical drive (1 spare).
The forum posts describing the issues is here:
The solution posted by CharlieBrady on the forums can be found here:
System information: HP Proliant DL380 G2 Dual P3 1.266GHz (original system processors) Memory: 2GB RAM Hard Drives: 6x 36.4GB Compaq Hot-swappable 36.4GB, 10k or 15k RPM (mixed set) (BF03664664)
To re-configure GRUB, I followed these steps
1. Rename /etc/grub.conf to /etc/grub.old 2. edit /etc/grub.conf 3. uncommented the line that starts with #boot= 4. edited the boot= line to read
boot=/dev/cciss/c0d0
This line previously read (if i remember correctly) #boot=/dev/md0 5. opened /boot/grub/device.map 5a. I don't remember if the (hd0) line was correctly set. It SHOULD read
(hd0) /dev/cciss/c0d0
6. Ran GRUB with the following parameters:
/sbin/grub --batch --device-map=/boot/grub/device.map --config-file=/boot/grub/grub.conf --no-floppy
7. Ran the following commands in grub
grub> root (hd0,0) grub> setup (hd0) grub> quit
8. Restarted the server
At this point, everything ran properly