LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-23-2007, 05:42 PM   #1
carlyno
LQ Newbie
 
Registered: Oct 2006
Location: Bordeaux
Distribution: Gentoo 2006
Posts: 25

Rep: Reputation: 15
Debian won't boot after reinstalling win....


Hi all, I have a serious problem here: I've had to reinstall win xp (I know I know...) on a previously perfectly working dual boot configuration... I knew the win xp reinstallation would overwrite the bootloader, but I had a good Grub reinstallation procedure: from the Debian install cd, run rescue (or rescuegui), select "Grub reinstallation". Which I did; and actually, I got my Grub back, with splash and stuff. The problem is that Grub looks for root=/dev/sda6, as it should be, but for some reasons, root ended up on /dev/sda5... look:
from /grub/menu.lst
Code:
title    debian GNU/Linux, kernel 2.6.18-4-686
root               (hd0,5)
kernel            /boot/vmlinuz-2.6.18-4-686 root=/dev/sda6 ro vga=791 splash
initrd              /boot/initrd.img-2.6.18-4-686
savedefault
this is fdisk -l
Code:
omitting empty partition (5)

Disk /dev/sda: 58.5 GB 58506416640 bytes
255 heads, 63 sectors/track, 7113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device   Boot      Start          End         Blocks         Id       System
/dev/sda1    *               1         1275       10241406      7      HPFS/NTFS
/dev/sda2               1276         3825        20482843+   7      HPFS/NTFS 
/dev/sda3               3826         7113        26410860     5      Extended
/dev/sda4               5863         7113          9807651     b      W95 FAT32
/dev/sda5               3826         4554          5855629+  83      Linux
/dev/sda6               4555         4676            979933+  82      Linux swap
/dev/sda7               4677         5892          9767488+  83      Linux
and /etc/fstab
Code:
file system>   <mount point>    <type>      <options>    <dump>  <pass>
proc                   /proc                proc            defaults       0                 0
/dev/sda6          /                       ext3            defaults,errors=remount-ro
/dev/sda8          /home               ext3            defaults       0                  2
/dev/sda7          none                 swap           sw               0                  0
/dev/sda5          /hdshare           vfat             rw,user,auto,exec........
/dev/sda2          /ressources       ntfs             ro,user,auto.......
/dev/scdO         /media/cdrom0  udf..................
if I compare /etc/fstab and fdisk -l, root is on /dev/sda6 (as it has always be) fdisk -l shows a Linux swap filesystem... If I dynamically change option in grub switching root=/dev/sda6 to root=/dev/sda5, then the OS boots... but it fails of course on loading /swap, /home, expecting it to be /dev/sda8... which it can't find... It's just as if the filesystem table had been all messed up. All partitions mentioned in /fstab do exist : I can "cd /" in them. Other clue : I tryed to see what a partitioning tool would say... Gparted sees the hard drive as empty... no filesystem at all... so does the install cd tools... but f... windows, when booted, perfectly sees all the partitions with its disk manager.... And finally, there's smthing weird shown from fdisk -l:/dev/sda4 starts at the 5863rd blocks, but it should be /dev/sda5 if I look at the starting and ending blocks of each... I don't know if it's related or not.
Is it a matter of mbr ? boot loader ? Please... if somebody had the beginning of an idea... I've already apt-get remove Grub, to then apt-get intall it, with no change. Should I erase the mbr (fdisk/mbr, is it ?)and then reinstall Grub ?
ps : grub-install --recheck /dev/sda didn't solve anything

Last edited by carlyno; 04-23-2007 at 05:58 PM.
 
Old 04-23-2007, 06:37 PM   #2
zoidburg016
LQ Newbie
 
Registered: Feb 2007
Distribution: Debian
Posts: 17

Rep: Reputation: 0
just change /boot/grub/menu.lst and /etc/fstab to make /dev/sda5 the "/" partition
 
Old 04-24-2007, 01:40 AM   #3
carlyno
LQ Newbie
 
Registered: Oct 2006
Location: Bordeaux
Distribution: Gentoo 2006
Posts: 25

Original Poster
Rep: Reputation: 15
hun hun I thought about that, but it couldn't be that simple, since all the other partitions are messed up as well: /swap and /home have moved too... I could re-write fstab, according to this too, but it wouldn't be an elegant hack.... there's gotta be a way to fix the partition table

Last edited by carlyno; 04-24-2007 at 01:42 AM.
 
Old 04-24-2007, 02:10 AM   #4
carlyno
LQ Newbie
 
Registered: Oct 2006
Location: Bordeaux
Distribution: Gentoo 2006
Posts: 25

Original Poster
Rep: Reputation: 15
Yeeeeeeeesss !! Using testdisk from Gparted, I fixed up the partition table, which is just right now !!! aleluya... thanx silvagroup. Buuut.... Grub just died in the operation : at boot, "grub loading error 15". I guess I have to reinstall it... What is the best way: should I boot from a live cd, chroot in / and apt-get install it ?
 
Old 04-24-2007, 08:08 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by carlyno
Yeeeeeeeesss !! Using testdisk from Gparted, I fixed up the partition table, which is just right now !!! aleluya... thanx silvagroup. Buuut.... Grub just died in the operation : at boot, "grub loading error 15". I guess I have to reinstall it... What is the best way: should I boot from a live cd, chroot in / and apt-get install it ?
I think you only need to do
grub-install

For this, you will need to have chrooted but before this make sure you link your /chroot/dev to the real /dev
Code:
mount /dev/ /mnt/debian/dev  -o bind
mount /proc/ /mnt/debian/proc  -o bind
chroot /mnt/debian
grub-install
There are probably ways to pass option to grub-install to not do the chroot but I can't remember

Last edited by nx5000; 04-24-2007 at 08:09 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how would you install win xp, win vista(beta), and slackware with a tri boot? whited Linux - General 3 07-02-2006 11:12 AM
Reinstalling Debian Packages Neko|Con Debian 5 10-25-2005 11:35 AM
Rebooting mdk 9.2 (win 98 dual boot) after win hd fails jnt Mandriva 3 04-05-2004 05:57 PM
Lilo: Dual boot Debian & Win 2000 mudelf Linux - General 3 11-12-2003 01:55 AM
Reinstalling Win XP simplexr Mandriva 4 09-29-2003 08:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:44 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