LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-27-2004, 01:09 AM   #1
aditya_ic
LQ Newbie
 
Registered: Jul 2004
Distribution: Fedora Core 2
Posts: 6

Rep: Reputation: 0
accidently deleted /boot partition :(


Hi,

While trying to format a fat 32 partition, qtparted showed me the wrong partition number and I ended up deleting and formatting my /boot partition (mounted on /dev/hda5 on my drive). Is there a way to recreate /boot? GRUB is/was my boot loader. I havent rebooted my system yet.
I'm running FC2 and 2.6.7 kernel.

Any help would be greatly appriciated.
Thanks,

Aditya
 
Old 07-27-2004, 02:00 AM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
Tough one

Try this out ....

Boot into Rescue mode and follow the instructions closely ... especially the chrooting into /mnt/sysimage.
Chroot into /mnt/sysimage

You have your linux system ready to be repaired.

If you have the 2.6.7 files in /usr/src, copy them over to /boot

Create an elementary grub.conf
Code:
title Fedora FC2
      kernel /boot/<your vmlinuz> ro root=/dev/<your root partition> rhgb
      initrd /boot/initrd<whatever>.img
edit
Before doing all that ...
you need to fdisk. set the partition type of your /boot partition to 83, format it as ext3 or reiserfs ... whatever it had previously.. After this, you can venture into the chroot stuff.

Last edited by ppuru; 07-27-2004 at 02:06 AM.
 
Old 07-28-2004, 03:15 AM   #3
aditya_ic
LQ Newbie
 
Registered: Jul 2004
Distribution: Fedora Core 2
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks.
For some reason I can't boot into Windows XP though Linux works fine.

Apart from restoring the kernel, I had to reinstall grub as the /boot parition's number had changed.

here is fdisk output:

Disk /dev/hda: 41.1 GB, 41110142976 bytes
16 heads, 63 sectors/track, 79656 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 20942 10554673+ c W95 FAT32 (LBA) <-- This is my XP partition
/dev/hda2 20942 79656 29591730 f W95 Ext'd (LBA)
/dev/hda5 41885 42087 102280+ 83 Linux <--- This is /boot now
/dev/hda6 42088 78615 18410080+ 83 Linux
/dev/hda7 78616 79655 524128+ 82 Linux swap
/dev/hda8 20942 41884 10554673+ c W95 FAT32 (LBA) <-- this is the new reiserfs partition

Earlier /dev/hda8 was /dev/hda5 and it was a fat32 partition.

Here is my grub.conf:

default=1
timeout=5
#splashimage=(hd0,5)/grub/splash.xpm.gz
title Windows XP
rootnoverify (hd0,0)
chainloader +1
title Fedora Core (2.6.7)
root (hd0,4)
kernel /bzImage root=/dev/hda6


Any ideas why XP fails to load? Whenever i choose XP it just returns to the same menu.
Thanks,

Aditya.
 
Old 07-28-2004, 05:13 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
You can boot using the XP cd, get into recovery console and run fixmbr.

this will install the XP bootloader. Check if you can boot into XP.

Next reboot using your linux install cd, get into rescue mode and run grub-install.

that should fix the problem of XP not booting.
 
Old 07-28-2004, 03:24 PM   #5
aditya_ic
LQ Newbie
 
Registered: Jul 2004
Distribution: Fedora Core 2
Posts: 6

Original Poster
Rep: Reputation: 0
Just to be sure I should install grub on first sector of /boot (/dev/hda5)

grub-install /dev/hda5

and not on mbr. right?

I think it got screwed because i installed grub on mbr. grub-install /dev/hda

Thanks
 
Old 07-28-2004, 06:21 PM   #6
aditya_ic
LQ Newbie
 
Registered: Jul 2004
Distribution: Fedora Core 2
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,

I tried booting from XP cd and ran fixmbr...now the system doesnt boot at all and I cant type anything. I tried fixboot too but the same output. I did restore the previous mbr. I cant boot to linux but not XP. it says

Disk Error
Press any key to restart
 
Old 07-28-2004, 10:32 PM   #7
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
you did it right by installing grub on the MBR.

After you boot into linux, can you mount the windows partitions? especially the XP system paritition?
 
Old 07-29-2004, 02:37 AM   #8
aditya_ic
LQ Newbie
 
Registered: Jul 2004
Distribution: Fedora Core 2
Posts: 6

Original Poster
Rep: Reputation: 0
Yes i can mount all the partitions including the XP (/dev/hda1)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
deleted linux partition adn the boot loader was deleted also,now i have only gnu grub boris199 Linux - Laptop and Netbook 2 01-29-2005 04:53 PM
I accidently deleted /udev folder, what can I do? QuickTime Mandriva 1 09-29-2004 06:00 AM
Help: Accidently deleted file patske Linux - Newbie 5 02-17-2004 09:34 AM
I accidently deleted the lib directory ICO Slackware 2 02-10-2004 12:40 PM
Accidently deleted /dev/dsp MasterKin8T Linux - Newbie 2 01-29-2004 08:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration