LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 12-22-2005, 06:51 AM   #1
RationalRabbit
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Rep: Reputation: 0
Resized Linux Partition on Dual Boot - Lost Boot


SuSE 7.1
Win98
Dual Boot
I have a dual boot system on one drive. The system has been running fine for quite some time. Resized the Linux partition to a smaller size, using Partition Magic, and now I have lost the boot loader. (It is still there - just not loading.)
I need to know what the best and safest way is to fix this problem without taking the risk of messing up Windows. It is okay if I have to reload Linux, as I can do a clean install without losing anything valuable.
 
Old 12-22-2005, 07:11 AM   #2
jbetten
LQ Newbie
 
Registered: Jan 2005
Posts: 19

Rep: Reputation: 0
What bootloader are you running? lilo or grub. How are you presently accessing the system? You should be able to reinstall lilo or grub from a recovery cd.
 
Old 12-22-2005, 01:02 PM   #3
0perat0r
Member
 
Registered: Jul 2004
Location: New Jersey, US
Distribution: Red Hat Linux WS version 3
Posts: 126

Rep: Reputation: 15
Thanks for posting this as I was just about to repartition a Linux box using Partition Magic to make it a dual boot with XP. Careful with GRUB, because it is very buggy for dual-boots. A lot of people will tell you it is fine, but it's my opinion and experience (and the experience of many others after a quick Google search)that it is not good for dual-boots. I had another dual-boot RH/XP system that booted to an OS only when it wanted to. I reinstalled GRUB, which did not correct this. However, once I was able to get into the RH OS I made a floppy disk for booting up Linux and replaced GRUB on the hard disk with the Windows MBR.
 
Old 12-23-2005, 02:50 AM   #4
RationalRabbit
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Answer to Response

jbetten:
I'm using LILO.
Currently, I'm not accessing the system at all.
I did boot with a floppy to make sure my partitions were intact. Everything seems to be okay there.

OperatOr:
When I first set up the dual boot, I think I messed something up and started over (probably just an error on my part - it's been a while, so I don't remember). Other than that, the setup was quite easy and flawless afterwards. I have had this setup on this computer for 4 years.
 
Old 12-23-2005, 09:02 AM   #5
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 14.1
Posts: 1,138

Rep: Reputation: 55
Quote:
Originally Posted by 0perat0r
Careful with GRUB, because it is very buggy for dual-boots. A lot of people will tell you it is fine, but it's my opinion and experience (and the experience of many others after a quick Google search)that it is not good for dual-boots.
That is a very drastic statement. I don't think grub is very buggy. If it were, not many of them would be using it and not almost all distros would support it. It just so happens that bootloaders are tricky piece of software and requires good deal to understanding before you mess with them.

Also to add that if you are not comfortable with it, Linux installers always give you the option to use boot floppies. Read the grub manual and see the functionality if offers. For a piece of software like that, there would be complexities and learning curve. I have often seen that most errors are caused by wrong configuration because grub uses a different device naming conventions than most people are familiar with. I am not a grub expert but I have always been able to figure out changes with my grub and as far as possible, I leave it alone once configured.

One trick that I have always used is that I'll always install grub from my primary distro (that I use 90% of the time) and then just add grub entries for newer distro as I add them to my machine. This way even if you mess up your entries, you can still boot your primary distro and trouble-shoot the newly installed ones. Since the start of my Linux use, I always made partitions before hand with the initial install. This way I can easily add distro later on without changing the disc geometry (as messing up grub). I have figured, I like to use at least three other distro, so I create partitions for primary and future distros.

One other thing that I always do it that i keep a paper copy of my working grub config file. This way, I can always refer to it in case of problems.

Here's a tutorial I've written to install grub from source and configure/install it. It is does not cover all aspects of grub but it is complete for my use. Hope it helps.

-Tux,
 
Old 12-23-2005, 11:46 AM   #6
Gsidious
Member
 
Registered: Nov 2005
Location: Oregon
Distribution: SuSE
Posts: 59

Rep: Reputation: 16
What exactly do you get on the screen when you try to boot? It could help to know, Do you get "lilo" or just "li" do you get a full prompt? I suspect that in resizing your partition lilo is now failing to find the kernel so fails to boot. It should be repairable, by booting a rescue disk, mounting the "/" partition, and use "chroot" to set the mount point for your root partition. Then check that your lilo.conf file is correct and re-run lilo. Example:
Code:
mount /dev/hda2 /mnt/root
cd /mnt/root
chroot /mnt/root
less /etc/lilo.conf
/sbin/lilo -v
exit
cd /; umount /mnt/root
I don't know what your partition arrangement is, what your lilo.conf file contains, the above example is just to give you the idea of how you might fix this. From personal experience, grub is a more powerful bootloader, and you likely could have still booted your linux system from the grub command line if that was your bootloader, just my for grub. Hope this can help, not one of the easier challenges to take on.
-G.
 
Old 12-23-2005, 04:24 PM   #7
bibh_lnxq
Member
 
Registered: Nov 2004
Location: Leiden, Netherlands
Distribution: SuSE; Fedora;Slackware
Posts: 58

Rep: Reputation: 15
As far as I know Partition Magic cannot resize a Linux partition, at least not correctly. When I tried to do that once with Terabyte's BootITNG and a ReiserFS partition, BootIT had the grace to tell me beforehand that I had to reseize the Linux drive internally with its own ReiserFS tool first (ext2fs and ext3fs have their own special tools BTW) and only then use BootIT. Restoring Grub or Lilo probably will not help, because the Linux FS has to be reorganised completely. I.e., even if you manage to reinstall Grub/Lilo and boot Linux, the boot proces will hang a bit "further down the road".
 
Old 12-23-2005, 05:15 PM   #8
netcrawl
Member
 
Registered: Jan 2004
Location: British Columbia
Distribution: Slackware64 14, m0n0wall
Posts: 142

Rep: Reputation: 20
Quote:
Originally Posted by bibh_lnxq
As far as I know Partition Magic cannot resize a Linux partition, at least not correctly.
I use Partition Magic to resize ext2fs & ext3fs partitions on my linux boxen often, with no difficulties whatsoever. Can't speak for reiserfs though, never use it.
 
Old 12-23-2005, 05:41 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,111

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Resizing a partition (smaller) would generally mean resizing the filesystem first. PM hides all the gory details from you.
As for Pm messing the partition, I think that unlikely. If it is a recent version and recognised the filesystem type, I would expect it to work just fine. Been years since I tried it though.
If any of the loader code got moved in the resizing, you would have an issue. Lilo is particularly sensitive to location - it's why you need to keep running the lilo command every time you update the conf.
I have a feeling that Grub only needs to know the (sector) offset to the start of the partition - if that doesn't change you should be o.k.
Another reason (and there are plenty) that grub is a better option.

To the question;
- yes you can re-install the loader without affecting Linux; or Win98. However that Suse is pretty old, so I don't know how. Generally you would just boot the install CD, and get into recovery mode, and do it from there.
Try it, and see if you get an option to restore the boot-loader.
Another option is to use Knoppix to do the same thing. Would be a much newer version of the loader, but that shouldn't matter. See the post from Gsidious.
 
Old 12-23-2005, 05:49 PM   #10
blink56k
Member
 
Registered: Nov 2005
Location: US East Coast
Distribution: Fedora Core 6 and several LiveCDs
Posts: 34
Blog Entries: 1

Rep: Reputation: 15
I thought it was better posting something here than starting a new thread.

I aborted an Ubuntu installation (since I couldn't figure out which partition to assign each thing to, i.e. ext 3, swap etc) and I ended up completely losing my lilo mandriva/windows xp pro bootloader (i'm running an ibm r52 thinkpad). The reason I was installing ubuntu on top of it was because mandriva wouldn't load itself properly.

Now, whenever I boot my thinkpad, all I get are a bunch of "9"s across a black screen.

I'm running Ubuntu live as we speak (thank God for live Cds!)

I just want to know, how can I either regain a bootloader, or better yet, how can I erase the linux partitions, remerge them with my winxp pro ntfs one, and get back the default mbr.

I've been doing some googling around for this, but my problem is that windows came preloaded on my thinkpad and I don't really have any set up cds or for that matter a floppy drive to run that fdisk/mbr thing they talk about.

It's not that I'm giving up on Linux, (I have SUSE 10.0 installed on my older PC), I just wanted to give it a try on my thinkpad (several distros) but screwed up beyond control.

Thanks.
 
Old 12-23-2005, 06:13 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,111

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Quote:
Originally Posted by blink56k
I've been doing some googling around for this, but my problem is that windows came preloaded on my thinkpad and I don't really have any set up cds or for that matter a floppy drive to run that fdisk/mbr thing they talk about.
I don't believe it needs to be *your* (registered) CD. Go get a mates XP CD, and boot that, go to recovery console, and run fixmbr - it's the new (documented) successor to "fdisk /mbr".
As for the partitions, XP will gag when it sees them, and offer to format them for you; let it. As for merging them, that's your can of worms - maybe go buy PM.
 
Old 12-24-2005, 01:38 AM   #12
blink56k
Member
 
Registered: Nov 2005
Location: US East Coast
Distribution: Fedora Core 6 and several LiveCDs
Posts: 34
Blog Entries: 1

Rep: Reputation: 15
Thanks...I reinstalled Ubuntu and the Grub bootloader works just fine.

I'll keep the XP CD thing in mindshould I ever wipe out Linux from this system (hard to find someone that has one...can a bootlegged one be burned without getting me in trouble since I own/"own" an authentic version and I'm only using that fixmbr thing anyway?)

And yes I do have PM so it should be no prob.

Thanks again.
 
Old 12-24-2005, 09:21 PM   #13
RationalRabbit
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Fixing the Resized Partition Problem

Quote:
Originally Posted by Gsidious
What exactly do you get on the screen when you try to boot? It could help to know, Do you get "lilo" or just "li" do you get a full prompt? I suspect that in resizing your partition lilo is now failing to find the kernel so fails to boot. It should be repairable, by booting a rescue disk, mounting the "/" partition, and use "chroot" to set the mount point for your root partition. Then check that your lilo.conf file is correct and re-run lilo.
I get "LI", but it is not a full prompt - just LI and a cursor blinking into infinity.

I don't have a rescue disk, but I do have a bootable install disk that might work. It will be a couple of days before I can mess with this, but I will reply on the outcome.

-- R. Rabbit
 
Old 12-27-2005, 04:01 PM   #14
Gsidious
Member
 
Registered: Nov 2005
Location: Oregon
Distribution: SuSE
Posts: 59

Rep: Reputation: 16
You can find an explaination of the Lilo error codes here:
http://www.tldp.org/HOWTO/Bootdisk-HOWTO/a1483.html
That probably won't be of much help though, basically you are going to need some kind of rescue boot disk/CD to recover the install. A Knoppix CD can be your best friend for something like this.
 
Old 12-29-2005, 01:02 AM   #15
RationalRabbit
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Reinstall

Even though I've had Linux on this machine for awhile, I haven't found the time to mess with it too much. Also, I seem to have forgotten the root password.
I've decided to reinstall Linux.

Been so long since I first installed, I'll have to read up on installing on the Linux Partitions. Any tips would be appreciated.

One thing I might mention here, as, in searching forums, I found several people with the same problem who say they can't boot up to their Windows partition either. If someone reading this is having that problem, remember that when you set up the Lilo boot, you set the boot partition as the active partition. You will need to change the active partition to the Windows OS, and you should be able to boot to Windows.
 
  


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
Dual boot problem in Redhat linux 9 (GRUB Lost) cyberguy2 Linux - Software 11 11-20-2005 09:00 AM
dual boot xp/gentoo (selecting boot for each partition) saif__r Linux - Newbie 8 08-13-2005 10:23 AM
HELP resized partition and lost all data wolfbeast2 Linux - Newbie 15 08-14-2004 07:05 PM
XP/LINUX dual boot partition scheme? climater Linux - Newbie 7 07-03-2004 05:00 PM
Reinstalled Windows 98 lost linux dual boot llefty Linux - Newbie 0 08-01-2003 12:23 AM


All times are GMT -5. The time now is 01:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration