Linux - NewbieThis 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!
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
My system was previously set up as a dual boot with WinXP (hd1) and Ubuntu (breezy badger, hd2). As is probably common, hd3 and hd5 were being used for the swap. My problem started when I needed to give more space to the Windows partition. GParted wouldn't let me decrease hd2 and then use that space for hd1 (not surprising, since the used data meant that the new space had to be non-contiguous with hd1) so I went and decreased hd2, copied all that data into the new space (hd4) and then deleted it and increased hd1. Yes, I know that it was stupid to try resizing it in the first place, and even stupider to do the copy and delete in one session without checking the data first, but the fact is it's done.
Now when GRUB starts I get an Error 22 from which I can do nothing. What I *can* do is boot to a LiveCD version of Ubuntu, from which I have been able to access hd4 by mounting it. (For anyone in a similar situation, type "sudo mkdir /mnt/four" and "sudo mount /dev/hda4 /mnt/four" though you would have to substitute hda4 for whichever you need, and "four" can be substituted by a different folder name as desired). I have also created a boot floppy of grub which has (from advice in linuxquestions.org/questions/showthread.php?t=359223) enabled me to successfully boot Windows. All my data is preserved there, too, which leads me to believe the problem is with grub or the bootloader. However when I try to boot Ubuntu the same way, I get the following errors:
grub> root (hd0,3)
Filesystem type is ext2fs, partition type 0x83
(This when gparted clearly tells me that the filesystem type is ext3)
grub> chainloader +1
Error 13: Invalid or unsupported executable format
... which would lead me to believe the problem is worse. Also, I've tried changing menu.lst and even fstab, to no avail, though I'll freely admit I could be doing it wrong. Anyway, if those commands above don't work straight off the grub command line, I doubt that running similar commands from menu.lst is going to do any better. (For those unfamiliar with Ubuntu, menu.lst seems to be the same as what grub.config is in other distros).
So, I know all my stuff is still there. Surely there's some way to fix the bootloader so that I don't have to remount each time? (I'd rather not have to reformat, even though I backed up everything I need, even before partitioning).
This is very confusing.
First, what partitions do you have now--including sizes? (And the total size of the harddisk)
If you can boot Windows from a GRUB floppy, it means that there is a "menu.lst" file somewhere. In the Linux install, it should be in /boot/grub. Please post the contents of that file. In the SAME PARTITION--in /boot, you should see a kernel file (vmlinuz) and maybe a file like "initrd". Assuming that these files are in place, we then need to look at "menu.lst" to see if the references are correct. (Since you have been moving things around, chances are that they are not.)
If things get too messy, you may need to re-install Linux.
The partition sizes I will have to log into gparted to get because I'm not experienced enough to know another way, so I'll get back to you with that when I've had a chance. But I can tell you that it's *approximately*:
hd1: WinXP ~8GB
hd3: something to do with swap, ~500MB
hd4: Ubuntu ~11GB
hd5: "subpartition" (appears under hd3 with gparted), ~500MB
(Total is 20GB)
The menu.lst file originally read:
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
# Hides the menu by default (press ESC to see the menu)
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
# title Windows 95/98/NT/2000
# root (hd0,0)
# chainloader +1
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda2 ro
## default grub root device
## e.g. groot=(hd0,0)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single
## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
Thanks for the quick reply and I hope this other information helps. I'll try to post the sizes within a couple of hours but I have a meeting coming up and I'm not sure how long it will take. If there's anything else you need to know, maybe I can grab that at the same time.
I should also mention that this Error 22, it happens right after the text comes up that grub is loading - no menu or anything - and that commenting out the Ubuntu versions (everything shown in the second quote box above) gives the same error, as does changing it to hd0,3 and hda4 respectively. Nothing I've done has affected the error that grub - the one that loads automatically when I press power - gives. The other grub, the one I'm loading off of a disk, gives me a command line and, as mentioned, succeeds in booting hd0,0 but doesn't know what to do with hd0,3. hd0,1 it tells me doesn't exist (no surprise there) and hd0,2 it will try to load but not do anything, at least not right away. I stopped it because I didn't think loading the swap partition was really a good idea, I just needed to make sure I had the right number with hd0,3.
May also be relevant that this is a Dell Latitude laptop - posted here and not the laptop section since Newbie seemed to be the more important thing here.
If you can boot Windows from a GRUB floppy, it means that there is a "menu.lst" file somewhere.
To make the floppy, I used the site ...* (since I couldn't get the commands listed elsewhere on the 'net to do anything for me) and the altered menu.lst from /mnt/four/boot/grub. (So if it's using this, then why do I get Error 13 instead of Error 22??)
For reference's sake, (from ...*)
13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).
22 : No such partition
This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk.
- Is there an easy way to just change the name of the partition?
- Do you think (part of) the problem is because it's not ext3, as it says? If so, can/should I change this?
- Might reinstalling Grub do anything? Would it automatically rewrite its menu.lst file for me?
* For some reason it's no longer letting me link. Guess I need to have 3 posts before I can do that. So I'll try to remember to provide these links when I post again.
just like in the menu.lst file, only into the grub command line (via the floppy). I was expecting to at least be able to pinpoint the error, but what happened is that it booted perfectly. Now the question is, how do I automate this? Clearly the menu.lst file is not being accessed correctly by Grub, or some other error that is preventing those commands from being run as expected. Considering that the error I'm getting is telling me that the partition doesn't exist, perhaps there's another file that needs to also be changed?
Also, if you're going to tell me to reinstall Grub, I'm going to need help with that.
Someone where I work noticed me typing all that stuff to load linux, and he was able to tell me how to fix Grub.
In my particular case, I just had to type into the terminal:
"sudo su" to switch to root, then typed in my password
"grub" to run grub
"root (hd0,3)" to tell grub where my linux partition is
"setup (hd0)" to reinstall grub onto the main part of the hard drive
"quit" to exit grub
Of course it's also important that menu.lst be fixed. And then it works! w00t!
PS. I'm sorry that this thread is so convoluted, and perhaps I should have started a new thread when I better understood what the problem was. But at least now anyone in a similar position to mine might realize faster what they need to do.