Sie sind auf Seite 1von 3

Restore Debian Linux Grub boot loader

by LinuxTitli on August 15, 2005 11 comments Recently my hard disk went bad (some bad sectors developed), my boot.ini (Windows XP boot file) corrupted. I was using NT boot loader to load Linux. So I need to repair the Grub i.e. restore Grub in master boot record (MBR). Today is national holiday (I-DAY) and I wanna watch TV. Problem is neither I can boot to Linux nor using XP. So I just took my Debian GNU/Linux DVD and booting started when I had presented installation option (after networking dialog prompt) : 1) Press ALT+F2 (or ALT+CTRL+F2) to get shell prompt 2) Then get the partition tables for the devices using fdisk command:
# fdisk -l

3)When you type fdisk -l, you should see your partition name: /dev/scsi/host0/bus0/target0/lun0/part1 (for IDE disk it display same device file in IDE directory) 4)Once you identified your device file, mount disk using mount command:
# mkdir /mydisk # mount /dev/scsi/host0/bus0/target0/lun0/part1 /mydisk

5) Next use chroot command to start interactive shell with special root directory i.e. /mydisk will act as root directory.
# chroot /mydisk

6)Use grub-install command to reinstall grub (SCSI disk):


# grub-install /dev/sda

If you have IDE device following command :


# grub-install /dev/hda

Again replace /dev/hda and /dev/sda with your actual device names. 7)Type exit and reboot the system. You should see your GRUB and Linux again.
# exit

Other choice was to use Linux Live CD (e.g. Mepis) and do the above procedure. Well, I could have used the Mepis to watch TV but I had some data and emails in Tunderbird so I opted to restore the Grub; watched TV, took backup of emails and now I will put new 120 GiB hard disk tomorrow :D

limite - 15 sep 2005 18:06 pour rinstaller grub booter sur le cd1 et au boot crire: linux rescue quand tu es en console, tape "grub" et indique-lui o se trouve la partition sur laquelle se trouve ton rpertoire /boot: grub > root (hd1,0) ensuite: setup (hd0) sors et reboot et le tour est jou! grub est rinstall Attention!! tu dois bien sur adapter selon tes partitions! grub dtecte les disques en commenant par 0 le premier disque rencontr est donc hd0 pareil pour les partitions! dans mon exemple (hd1,0) = deuxime disque premire partition bonne continuation
limite

pour toi donc, c'est disque C donc disque 0 sous linux Alors change:: linux rescue grub > root (hd0,0) setup (hd0) Signaler QMeuh - 16 sep 2005 23:06 Quand je demarre depuis le CD le programme d'installation se lance sans me laisser le temps d'entrer une commande ... Je rentre : linux rescue puis enter pour aller la ligne mais le systme d'installation dmarre aprs ... Snif Signaler limite limite - 17 sep 2005 07:53 Salut Qmeuh Toute mes excuses pour mes rponses haches 1.Ce que tu pourrais essayer Insres le cd 1 Dbian Au boot F1, ensuite F4 puis F3 au prompt note : expert

Plusieurs questions te seront poss sur plusieurs pages... ne charge rien , jusqu' ce que tu arrives sur installer Grub sur le disque dur tapes <espace>afin de valider , continue l'instllation sans rien choisir installer. En rpondant aux questions. Voil, ce sera une longue tape passer, nanmoins cel te permettra d'avoir Grub
Limite
Ajouter un

Ajouter un commentaire

Das könnte Ihnen auch gefallen