LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-25-2007, 08:06 AM   #1
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
grub help! HDD installs and now cannot boot.


I've setup ubuntu from the liveCD.

All was working okay.

However, played in BIOS and physically changed disks around and added some paritions but now get grub boot errors on powerup.

I'm lost and cannot remember original config.

I can boot from liveCD and use a term, so can someone please tell me how to enter commands to correct the situation.

This is what I have when I boot from live CD:

Code:
1st IDE HDD /dev/hda
   hda1 = ext3 partition with my datafiles on.
2nd IDE HDD /dev/hdb
   hdb1 = ext3 partition with my datafiles on.
IDE CDROM /dev/hdc
ATA HDD /dev/sda
   sda1 = root boot drive with all my linux root and boot stuff.
   sda2 = partition that I mount on /tmp (has tmp filesystem)
   sda4 = linux swap parition
this is what I can see:
Code:
root@ubuntu:/# mount /dev/sda1 /mnt
root@ubuntu:/# ls /mnt
bin   cdrom  home        lib         mnt   root  sys  var
boot  dev    initrd      lost+found  opt   sbin  tmp  vmlinuz
boss  etc    initrd.img  media       proc  srv   usr
root@ubuntu:/# ls -l /mnt
total 92
drwxr-xr-x   2 root root  4096 2007-05-25 08:49 bin
drwxr-xr-x   4 root root  4096 2007-05-25 09:11 boot
drwxr-xr-x  14 root root  4096 2007-05-25 09:28 boss
lrwxrwxrwx   1 root root    11 2007-05-25 08:35 cdrom -> media/cdrom
drwxr-xr-x   5 root root  4096 2007-04-15 12:03 dev
drwxr-xr-x 111 root root  4096 2007-05-25 10:28 etc
drwxr-xr-x   6 root root  4096 2007-05-25 09:20 home
drwxr-xr-x   2 root root  4096 2007-04-15 11:48 initrd
lrwxrwxrwx   1 root root    33 2007-05-25 08:48 initrd.img -> boot/initrd.img-2.6.20-15-generic
drwxr-xr-x  16 root root  4096 2007-05-25 08:49 lib
drwx------   2 root root 16384 2007-05-25 08:34 lost+found
drwxr-xr-x   6 root root  4096 2007-05-25 09:56 media
drwxr-xr-x   2 root root  4096 2007-04-12 09:11 mnt
drwxr-xr-x   2 root root  4096 2007-04-15 11:48 opt
drwxr-xr-x   2 root root  4096 2007-04-12 09:11 proc
drwxr-xr-x   8 root root  4096 2007-05-25 10:02 root
drwxr-xr-x   2 root root  4096 2007-05-25 08:49 sbin
drwxr-xr-x   2 root root  4096 2007-04-15 11:48 srv
drwxr-xr-x   2 root root  4096 2007-04-04 10:47 sys
drwxrwxrwt  15 root root  4096 2007-05-25 10:28 tmp
drwxr-xr-x  11 root root  4096 2007-04-15 11:50 usr
drwxr-xr-x  15 root root  4096 2007-04-15 12:01 var
lrwxrwxrwx   1 root root    30 2007-05-25 08:48 vmlinuz -> boot/vmlinuz-2.6.20-15-generic


root@ubuntu:/# ls -lR /mnt/boot
/mnt/boot:
total 16832
-rw-r--r-- 1 root root  414210 2007-05-25 09:11 abi-2.6.20-15-generic
-rw-r--r-- 1 root root   83234 2007-05-25 09:11 config-2.6.20-15-generic
drwxr-xr-x 2 root root    4096 2007-05-25 11:33 grub
-rw-r--r-- 1 root root 7174149 2007-05-25 09:11 initrd.img-2.6.20-15-generic
-rw-r--r-- 1 root root 6842512 2007-05-25 09:11 initrd.img-2.6.20-15-generic.bak
drwx------ 2 root root    4096 2007-05-25 09:11 lost+found
-rw-r--r-- 1 root root   94600 2007-05-25 09:11 memtest86+.bin
-rw-r--r-- 1 root root  806942 2007-05-25 09:11 System.map-2.6.20-15-generic
-rw-r--r-- 1 root root 1745100 2007-05-25 09:11 vmlinuz-2.6.20-15-generic

/mnt/boot/grub:
total 200
-rw-r--r-- 1 root root    197 2007-05-25 09:11 default
-rw-r--r-- 1 root root     45 2007-05-25 09:11 device.map
-rw-r--r-- 1 root root   8660 2007-05-25 09:11 e2fs_stage1_5
-rw-r--r-- 1 root root   8452 2007-05-25 09:11 fat_stage1_5
-rw-r--r-- 1 root root     15 2007-05-25 09:11 installed-version
-rw-r--r-- 1 root root   9152 2007-05-25 09:11 jfs_stage1_5
-rw-r--r-- 1 root root   4078 2007-05-25 11:33 menu.lst
-rw-r--r-- 1 root root   7860 2007-05-25 09:11 minix_stage1_5
-rw-r--r-- 1 root root  10132 2007-05-25 09:11 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 2007-05-25 09:11 stage1
-rw-r--r-- 1 root root 110132 2007-05-25 09:11 stage2
-rw-r--r-- 1 root root   9980 2007-05-25 09:11 xfs_stage1_5

/mnt/boot/lost+found:
total 0

root@ubuntu:/# cat /mnt/boot/grub/menu.lst

title           Ubuntu, kernel 2.6.20-15-generic
root            (hd2,0)
kernel          /vmlinuz-2.6.20-15-generic root=/dev/sda1 ro quiet splash
initrd          /initrd.img-2.6.20-15-generic
quiet
savedefault

title           Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root            (hd2,0)
kernel          /vmlinuz-2.6.20-15-generic root=/dev/sda1 ro single
initrd          /initrd.img-2.6.20-15-generic

title           Ubuntu, memtest86+
root            (hd2,0)
kernel          /memtest86+.bin
quiet
Its proably all wrong, but can someone tell me how on earth I can correct this using an Application->Terminal from the live CD boot.

Please bear in mind I'm a newb so will need some gentle hand holding through this.

THANKS
 
Old 05-25-2007, 08:32 AM   #2
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
I'd first like to know which GRUB errors you get; the number actually hints at what kind of problem really exists. If you don't get errors from GRUB at all, you're facing a severe problem - but since the live CD can obviously see the whole system (your terminal example shows that clearly), you can always just reinstall.

But I'd first do mount -a and then df from the terminal (if the one offered by the live CD is indeed a root terminal - if not, just use "sudo" in front of all system commands like "mount"). If it's all visible, you'll be fine - eventually.

You can also have a look at /boot/grub/menu.lst (using cat or less from the terminal) on the very drive you looked at and listed in the post above. btw. The only thing that I feel is missing from your fs listing is /dev/sda3... But that might be glitch.

Also, your BIOS should offer an opportunity to "reset" settings - but be careful, things might actually stop working because of that, too - I certainly don't recommend that if you're not sure what you're doing!

M.
 
Old 05-25-2007, 08:33 AM   #3
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 960

Rep: Reputation: 35
can you post your menu.lst or grub.conf from

/boot/grub

(one of those 2 files will just be a link to the other one)
 
Old 05-25-2007, 08:37 AM   #4
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 960

Rep: Reputation: 35
ah, looking at your menu.lst above i think i can see the probelm

in your menu.lst change the line
Code:
kernel          /vmlinuz-2.6.20-15-generic root=/dev/sda1 ro quiet splash
to
Code:
kernel          /boot/vmlinuz-2.6.20-15-generic root=/dev/sda1 ro quiet splash
that should work.
 
Old 05-25-2007, 08:57 AM   #5
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dasy2k1
can you post your menu.lst or grub.conf from

/boot/grub

(one of those 2 files will just be a link to the other one)
I have done that, see above.
 
Old 05-25-2007, 09:01 AM   #6
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
guys, hang on!

please remember that I've booted from the live CD.

The /boot is pointing to the / filesystem on THE LIVE CD and not my partition with my root fs on.

My root fs is in /dev/sda1.

Please can you provide laymen instructions, I'm struggling with this.

I guess I need to mount my /dev/sda1 and somehow get grub to install an MBR somewhere and then boot MY linux system off /dev/sda1.

The grub errors I get are:

Error 22
and
Error 15.

depending on the boot order I specify in BIOS. I cant remember which HDD has a MBR in.

I just need to install an MBR into one of the HDDs and get that to chain load my vmlinuz from / on /dev/sda1

Remember, I'm running a terminal off THE LIVE CD with my root fs mounted on /mnt ("mount /dev/sda1 /mnt" from the liveCD terminal) .. see above post.

..step by step shell commands please from the terminal.

I have no idea how to use grub and very limited linux knowledge.



Thanks.

Last edited by keratos; 05-25-2007 at 09:09 AM.
 
Old 05-25-2007, 09:01 AM   #7
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
..step by step shell commands please from the terminal.

I have no idea how to use grub and very limited linux knowledge.


Last edited by keratos; 05-25-2007 at 09:03 AM.
 
Old 05-25-2007, 09:08 AM   #8
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dasy2k1
ah, looking at your menu.lst above i think i can see the probelm

in your menu.lst change the line
Code:
kernel          /vmlinuz-2.6.20-15-generic root=/dev/sda1 ro quiet splash
to
Code:
kernel          /boot/vmlinuz-2.6.20-15-generic root=/dev/sda1 ro quiet splash
that should work.
vmlinuz-2.6.20-15-generic is on (as link) the root (/) directory of my fs on /dev/sda1 .. see above post.
 
Old 05-25-2007, 10:40 AM   #9
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
couldn't be arsed with this so reinstalled ubuntu - only took 10mins !

I have noticed though that all my drive names have changed, now they are all /dev/sd* (sda1, sdb1, sdb1, sdc1, sdc2, sdc4)

whereas before in LIVE CD I had /dev/hda1, hdb1, sda1, sda2 and sda4

WEIRD!!!

its working now anyway. spent more time in this forum that it took to reinstall...

just like windowze i guess!
 
Old 05-25-2007, 07:34 PM   #10
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Apparently, kernel 2.6.20 and beyond do not use "hd" in describing IDE drives no more, they are all "sd" whether it is IDE or SCSI. What's confusing, is that the Live CD you used is probably the same disc you used to install. Maybe it uses a different kernel in Live mode.
It would have probably been allot easier if I spotted this post before you did the re-install, but by re-installing, we always get better at it and usually refine our methods. Take a look at the thread link below to see how saikee describes grub re-installation, (keep in mind, he opens a grub shell from within the distribution, not a Live CD):
http://www.linuxquestions.org/questi...d.php?t=551370
 
Old 05-26-2007, 02:52 AM   #11
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Junior Hacker
Apparently, kernel 2.6.20 and beyond do not use "hd" in describing IDE drives no more, they are all "sd" whether it is IDE or SCSI. What's confusing, is that the Live CD you used is probably the same disc you used to install. Maybe it uses a different kernel in Live mode.
It would have probably been allot easier if I spotted this post before you did the re-install, but by re-installing, we always get better at it and usually refine our methods. Take a look at the thread link below to see how saikee describes grub re-installation, (keep in mind, he opens a grub shell from within the distribution, not a Live CD):
http://www.linuxquestions.org/questi...d.php?t=551370
thanks

...................
 
Old 05-27-2007, 04:31 AM   #12
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
UPDATE:

Quote:
Originally Posted by Junior Hacker
Apparently, kernel 2.6.20 and beyond do not use "hd" in describing IDE drives no more, they are all "sd" whether it is IDE or SCSI. ...
Not sure about that statement.

I have an explanation:

It seems that when booting at BIOS, depending on the order of boot disk, either the ATA IDE drive is booted first or an PIDE drive. Now, if the ATA drive is booted from, then MY linux install sees /dev/sda1 as the ATA drive and the two other IDE drives are /dev/hdb and /dev/hdc with CDROM as /dev/hdd. If on the other hand the PIDE drive is booted from then all my drives are /dev/hd[a-d]; my CDROM is /dev/hdc (wierd?)

On the LIVE CD, ALL my drives are /dev/sd[a-d]. Strange because the same kernel is used to boot LIVE CD and my install.

So, my menu.lst was using LIVE CD names and not the names that are recognised for my install.

Is this or bug or what is going on. Any ideas?
 
Old 05-27-2007, 06:38 PM   #13
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Quote:
Apparently, kernel 2.6.20 and beyond do not use "hd" in describing IDE drives no more, they are all "sd" whether it is IDE or SCSI.
Maybe that just applies to SUSE, or Slack, one of those two according to saikee who has mentioned this in a couple threads, I think they were SUSE related threads.
Quote:
So, my menu.lst was using LIVE CD names and not the names that are recognised for my install.

Is this or bug or what is going on. Any ideas?
Not sure exactly, but when I use the Helix Live CD, it calls all drives "sd" also, probably because it doesn't interact with the bios the same way the installer does.
 
Old 05-28-2007, 03:13 AM   #14
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Original Poster
Rep: Reputation: 30
thanks for the assist.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to boot sda1 in grub (usb HDD) surfbass Linux - General 5 05-07-2006 05:01 PM
[RAID1, GRUB] Secondary HDD can't boot up when primary HDD fails Akhran Linux - Newbie 2 05-04-2006 05:17 AM
grub installs in wrong HDD mariogarcia Debian 2 04-24-2006 06:53 PM
GRUB + inserting extra HDD = unable to boot bbking Linux - General 4 11-23-2004 08:09 PM
installs of fedora and lycoris boot to grub prompt mrtessster LinuxQuestions.org Member Success Stories 2 08-16-2004 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:37 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration