Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
10-12-2007, 07:47 PM
|
#1
|
Member
Registered: Sep 2007
Posts: 43
Rep:
|
Reinstalled Win XP and repaired Grub, now I can't boot Linux or Windows. Please help.
Hi,
I installed Windows XP again last night after trying Vista for a bit. Then I couldn't boot Ubuntu of course, so I did the root (hd0,1) + setup (hd0) like I've done successfully once before.
But this time something must have gone wrong, because when I try to boot Ubuntu I get this error message:
Code:
Error 17: Cannot mount selected partition
And when I try to boot Windows I get this message:
Code:
Error 12: Invalid device specified
Does anyone know how to solve this problem?
Thanks.
Last edited by MegaSvensk; 10-12-2007 at 07:49 PM.
|
|
|
10-12-2007, 08:10 PM
|
#2
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
What system were you running when you re-installed GRUB? If you were running from live CD, then the drives might not been seen the same.
If running from live CD---before running GRUB--do "fdisk -l" to see how the system sees your drives. This will determine what to put in the GRUB install commands.
It's handy to keep GRUB on a floppy for situations like this (But I don't always follow my own advice... )
|
|
|
10-12-2007, 08:13 PM
|
#3
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
Perhaps your partition numbers have changed after erasing vista?
Compare fdisk -l with /boot/grub/menu.lst (presumably from a live install... so make sure it is the menu.lst on the HDD and not the one on the CD.)
|
|
|
10-12-2007, 08:17 PM
|
#4
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
Thanks for your reply.
I'm using an Ubuntu live CD right now.
This is my fdisk -l:
Code:
Disk /dev/sda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 2 5738 46082452+ f W95 Ext'd (LBA)
/dev/sda2 5739 36483 246959212+ 7 HPFS/NTFS
/dev/sda5 2 3825 30716248+ 7 HPFS/NTFS
Disk /dev/hdc: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 21773 174890040 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/hdc2 21774 24199 19486845 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/hdc3 24200 24321 979965 82 Linux swap / Solaris
Partition 3 does not end on cylinder boundary.
Quote:
Originally Posted by Simon Bridge
Perhaps your partition numbers have changed after erasing vista?
Compare fdisk -l with /boot/grub/menu.lst (presumably from a live install... so make sure it is the menu.lst on the HDD and not the one on the CD.)
|
Well, this is what it used to look like so it has changed quite a bit.
Code:
Disk /dev/sda: 300,0 GB, 300090728448 byte
255 heads, 63 sectors/tracks, 36483 cylindrar
Devices = cylindrar av 16065 · 512 = 8225280 byte
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5738 46090453+ 7 HPFS/NTFS
/dev/sda2 5739 36483 246959212+ 7 HPFS/NTFS
Disk /dev/hdc: 200,0 GB, 200049647616 byte
255 heads, 63 sectors/tracks, 24321 cylindrar
Devices = cylindrar av 16065 · 512 = 8225280 byte
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 21135 169758776 7 HPFS/NTFS
Partition 1 does not end on cylinder limit.
/dev/hdc2 21135 21773 5125680 c W95 FAT32 (LBA)
Partition 2 does not end on cylinder limit.
/dev/hdc3 21774 24199 19486845 83 Linux
Partition 3 does not end on cylinder limit.
/dev/hdc4 24200 24321 979965 82 Linux swap / Solaris
Partition 4 does not end on cylinder limit.
How do I view menu.lst?
Last edited by MegaSvensk; 10-12-2007 at 08:34 PM.
|
|
|
10-12-2007, 08:33 PM
|
#5
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
Do you think what's causing Windows not to boot is the fact that it was at sda1 before and now it's at sda5? Can I just change grub to boot XP at sda5? If so, how do I do it?
I did remove the FAT32 partition, so Linux has been bumped up from hdc3 to hdc2.
Maybe I just have make some edits to grub to fix this. But the question is how do I do that?
Last edited by MegaSvensk; 10-12-2007 at 08:41 PM.
|
|
|
10-12-2007, 09:40 PM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You can get into the grub interactive mode and enter the "kernel" & "initrd" lines manually. Using autocompletion makes it easy to locate the kernel and initrd file. Then enter the "boot" command to get into your regular linux installation. From there, examine the system. If the devices jive with what you used to boot with, then edit /boot/grub/menu.lst to reflect the changes and run grubinstall.
If the devices are different from what you saw earlier than edit /boot/grub/device.map. I ran into this situation on my desktop where the bios would have /dev/sda & /dev/sdb reversed. After booting I couldn't simply edit menu.lst.
|
|
|
10-12-2007, 09:45 PM
|
#7
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
How do I get into the "grub interactive mode"? I'm pretty much a newbie to Linux and Grub.
I tried "gedit /boot/grub/device.map," but the file came up empty.
Last edited by MegaSvensk; 10-12-2007 at 09:47 PM.
|
|
|
10-12-2007, 09:46 PM
|
#8
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
cat /boot/grub/menu.lst
It looks like your partition numbers have certainly changed.
Read grub(8) and update-grub(8), but most people edit the menu.lst file by hand following the conventions already present.
sudo cp /boot/grub/menu.lst /boot/grub/menu-old.lst
sudo gedit /boot/grub/menu.lst
You'll probably only need to point the old linux root device to the correct place. Reboot then run update-grub. But you may want to edit the windows entry too. Note: you only need to edit the default linux entry and remove all others.
|
|
|
10-12-2007, 09:49 PM
|
#9
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
Quote:
Originally Posted by Simon Bridge
cat /boot/grub/menu.lst
|
I tried that command but I got "no such file or directory."
|
|
|
10-12-2007, 10:03 PM
|
#10
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
From the live mode?
First mount the partition that contains your normal /boot directory
- if the linux root is /dev/hdc2 then:
mount -t ext3 /dev/hdc2 /mnt
ls /mnt/boot/grub
... now you see it?
Code:
$ ls /mnt/boot/grub
default installed-version minix_stage1_5 xfs_stage1_5
device.map jfs_stage1_5 reiserfs_stage1_5
e2fs_stage1_5 menu.lst stage1
fat_stage1_5 stage2
If you chroot /mnt, the system will list everything where you are used to it. But if you confuse easy, use the grub interactive mode.
|
|
|
10-12-2007, 10:07 PM
|
#11
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
Yeah, I see it now. But I still don't know how to view the menu.lst
Edit:
Never mind, I figured out how to view it.
Last edited by MegaSvensk; 10-12-2007 at 10:10 PM.
|
|
|
10-12-2007, 10:18 PM
|
#12
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
Do you think this will work?
Code:
title Ubuntu, kernel 2.6.20-16-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=5a285e7d-4d95-412f-85b6-f3c58f06e18c ro quiet splash locale=sv_SE
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault
title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=5a285e7d-4d95-412f-85b6-f3c58f06e18c ro single
initrd /boot/initrd.img-2.6.20-16-generic
title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda5
title Microsoft Windows XP Professional
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
I changed the Linux ones to where the find /boot/grub/stage1 says the root is (before it was 0,2) and I changed XP from sda1 to sda5.
|
|
|
10-12-2007, 10:38 PM
|
#13
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
So, I changed it and I rebooted back into the live cd and now I'm trying to run the update-grub command but I get this error:
Code:
No GRUB directory found. To create a template run 'mkdir /boot/grub' first.
To install grub, install it manually or try the 'grub-install' command. ###
Warning, grub-install is used to change your MBR.
I tried cd'ing the grub directory and then running it, but I got the same message.
Edit:
Okay, I managed to run the command but gave me an error about that it couldn't resolve something and then it changed the partition number back to the wrong ones.
Then I just decided to try and boot up without update-grub and when I tried booting linux, it worked perfectly. However, when I tried booting Windows, I got the same Error 12.
Edit again:
I tried running update-grub inside of my real Ubuntu now but it just updated it back the old, erroneous value.
Any ideas on how to get Win XP up and running again. I guess I should change the root value but to what...
Last edited by MegaSvensk; 10-12-2007 at 11:18 PM.
|
|
|
10-13-2007, 12:23 AM
|
#14
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
I'm bumping this so that it won't fall off of the first page while I get a few hours of sleep before I have to go to work.
|
|
|
10-13-2007, 06:34 AM
|
#15
|
Member
Registered: Sep 2007
Posts: 43
Original Poster
Rep:
|
Okay, so I guess I'll just test root (hd1,x) till I get the right one.
Is there any way I can test the path inside of Ubuntu to see if it works without having to reboot over and over?
|
|
|
All times are GMT -5. The time now is 08:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|