LinuxQuestions.org
Visit Jeremy's Blog.
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 09-30-2007, 05:07 PM   #1
dcalki
Member
 
Registered: Aug 2007
Location: Florida panhandle, USA
Distribution: Working with PClinuxOS 2007 and Ubuntu 10.04 at the moment
Posts: 34

Rep: Reputation: 15
new hard drive, resized partitions, need to redo grub


{SOLVED}

Hey guys. PCLOS user question.

I just upgraded my old 20Gb HD with a new 80Gb HD.

I used GParted to copy dual boot partitions to new drive, but modified the linux partition with /boot from about 2Gb to 10Gb in size. It starts in the exact same sector as on the old drive, but following partitions are pushed to the 'right'. Also increased the linux swap partition from 1/2 to 1 Gb in size.

When I boot now, right before the grub menu appears there is an error message:
"snip"
~~~~~~~~~~~
Booting 'linux'

kernel (hd0,8)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/hda9 acpi=on splash=silent vga=788
~~~~~~~~~~~

Then the grub menu appears and appears to function OK.

When I select linux, everything halts, the graphics disappear, and I get:

"snip"
~~~~~~~~~~~
Error 22: No such partition
~~~~~~~~~~~

The system still boots into windows just fine so I'm guessing my resizing of the linux partitions has messed grub's pointers up.

I consolidated several windows partitions and placed them at the back end of the new drive, so the order of partitions is different too. I'd guess that since my old drive had more paritions that grub is now pointing to the wrong place for booting up (ie. hda9 was the old linux partition and now it's hda5).

The previous setup had the MBR redirect to grub installed on the boot record of the linux partition.

Any advice on how to re-install grub so it points at the proper partition (hda5) for my new partition configuration? I'm reluctant to muck around trying things out since changing grub requires root access and I really don't want to make things any worse. At least I can run in windows now.

My current partition table looks like this:
"snip"
~~~~~~~~~~~
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 510 4096543+ b W95 FAT32
/dev/hda2 511 9729 74051617+ f W95 Ext'd (LBA)
/dev/hda5 1814 3118 10482412+ 83 Linux
/dev/hda6 3119 3249 1052226 82 Linux swap/Solaris
/dev/hda7 3250 3486 1903671 83 Linux
/dev/hda8 7119 9729 20972826 b W95 FAT32
~~~~~~~~~~~

I've only been using PCLOS for about a month, so please use small words and assume I know nothing about 'the basics' of linux.

If I'm sadly mistaken in my understanding of the problem I'd appreciate it if someone would clarify what's going on so I can learn something from this. lol.

Thanks.

Last edited by dcalki; 09-30-2007 at 11:31 PM. Reason: figured out what to do and fixed it
 
Old 09-30-2007, 05:09 PM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
post your /boot/grub/menu.lst
 
Old 09-30-2007, 05:32 PM   #3
dcalki
Member
 
Registered: Aug 2007
Location: Florida panhandle, USA
Distribution: Working with PClinuxOS 2007 and Ubuntu 10.04 at the moment
Posts: 34

Original Poster
Rep: Reputation: 15
/boot/grub/menu.lst

~~~~~~~~~~~
timeout 30
color black/cyan yellow/cyan
gfxmenu (hd0,8)/usr/share/gfxboot/themes/pclinuxos/boot/message
default 0

title linux
kernel (hd0,8)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/hda9 acpi=on splash=silent vga=788
initrd (hd0,8)/boot/initrd.img

title linux-nonfb
kernel (hd0,8)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=/dev/hda9 acpi=on
initrd (hd0,8)/boot/initrd.img

title failsafe
kernel (hd0,8)/boot/vmlinuz BOOT_IMAGE=failsafe root=/dev/hda9 failsafe acpi=on
initrd (hd0,8)/boot/initrd.img

title windows
root (hd0,0)
makeactive
chainloader +1
~~~~~~~~~~~


Let me guess..... I have to change all the hd0,8s to hd0,4s and the hda9s to hda5s?

Can it really be THAT simple??
 
Old 09-30-2007, 05:51 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Yep.
You can even do it at the grub menu to get you going, and fix it when you get logged on. Highlight the linux entry and hit <e>, do the same for the kernel and initrd lines.
When finished, <b> to boot. Read the on-screen help along the way.

Your initial error would have been because of the gfxmenu line.
 
Old 09-30-2007, 06:47 PM   #5
dcalki
Member
 
Registered: Aug 2007
Location: Florida panhandle, USA
Distribution: Working with PClinuxOS 2007 and Ubuntu 10.04 at the moment
Posts: 34

Original Poster
Rep: Reputation: 15
Changing the drive labels in menu.lst improved things. The menu graphics were better and after choosing a menu entry it didn't die immediately.

However...

It did come up with another error message referring to a missing hd11 and then die.

I guess there must be other files grub refers to in the boot process?

Can anyone come up with a list of all the files used by grub in the boot process so I can check through them all and change the drive references?

Thanks again for your help.
 
Old 09-30-2007, 07:42 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Nope - sounds like grub has done its job.
Have a look at /etc/fstab; it's where the partitions are mounted at boot.
 
Old 09-30-2007, 11:30 PM   #7
dcalki
Member
 
Registered: Aug 2007
Location: Florida panhandle, USA
Distribution: Working with PClinuxOS 2007 and Ubuntu 10.04 at the moment
Posts: 34

Original Poster
Rep: Reputation: 15
Yep. fstab was the ticket. It still had the old definitions from the old drive. Once I commented out the partitions I combined and moved and renumbered the partitions properly to match the labels in grub, it booted up without a problem.

Thanks a bunch for your help.
 
  


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
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 09:48 AM
Problem: Hard drive partitions, Grub/ Lilo and Ubuntu. tc--obo Ubuntu 5 06-21-2005 07:46 PM
Redo Linux Partitions & Clean Format Thanatos Linux - General 2 12-22-2004 02:05 PM
Grub to access new hard drive and old multi os hard drive ? gedi1 Linux - Hardware 0 06-03-2004 01:01 PM
Hard Drive / Partitions Starburn Linux - Hardware 2 10-29-2003 10:59 AM


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