LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   supergrub allowed successful booting - what now pls? (https://www.linuxquestions.org/questions/linux-newbie-8/supergrub-allowed-successful-booting-what-now-pls-819720/)

Greg675 07-14-2010 12:48 AM

supergrub allowed successful booting - what now pls?
 
Hi.

I've got a problem like magnecticfield did on 01-09-2010 but don't understand the fixes that were suggested - I tried to work through them.

Specifically, I've got dual boot with Ubuntu 10.4 and windows xp. Using Ebaus partition manager in xp I deleted what I thought were 2 empty partitions and they became unallocated (bc I wanted to increase the partition size for linux), but when I restarted it prompted:

error: unknown filesystem
grub rescue >

Like magnecticfield's comments, I don't know what to do and have followed the link kindly provided by syg00 and looked at the tutorial link posted by EricTRA but I'm sorry, it's a bit too complicated for me to follow.

I wished I hadn't messed with the partitions now bc Ubuntu was looking great. Can somebody please advise me how to sort this?

Greg675 07-14-2010 02:38 AM

Supergrub now used & logged in to ubuntu, but
 
1 Attachment(s)
After having successfully installed ubuntu to dual boot with xp, I deleted unused partitions using xp to unallocated and then got the grub rescue prompt on reboot.

I followed the advice (thanks!) to use supergrub and have now rebooted into ubuntu using the supergrub cd.

The screen shot below shows my current disc set up and the fact that there's 33gb free space, but that ubuntu home is squashed into 2.4gb and swap is in 275mb. The xp partition is 37gb ntfs which I'd like to keep please bc I do want to be able to use dual boot.

Can anyone pls advise me what I need to do to repair the mess I've made (prompting the grub rescue prompt) without having to use the supergrub disc everytime?

Also, does anyone know how I should have increased partition size for the linux stuff out of the unallocated space that I've got available?

Thanks in advance if anyone can help.

alli_yas 07-14-2010 02:58 AM

Are you saying that your entire Ubuntu install is within the 2.4GB HOME partition?

In terms of extending the partition; basically you can't do this without losing all the data - I assume you want to add the 33GB space to the existing 2.4GB where your Ubuntu is installed. The only way to do this is to move all the important Ubuntu data to another partition; and then delete the 2.4GB partition. Thereafter you create a new partition which is 35.5 GB (your old 2.4GB + the 33GB you have free).

syg00 07-14-2010 02:58 AM

I find those GUIs damn near useless. From a terminal in Ubuntu, run this and post all the output (that's a lower case ell)
Code:

sudo fdisk -l
Edit: let's see the command output before you do anything rash.

Greg675 07-14-2010 03:15 AM

Thanks for your speedy responses - pls see below
 
1 Attachment(s)
alli_yas - thanks for your input but I don't know how to do this moving - when ubuntu installed via cd, it sorted its own partitions out even though I'd prepared some drives using xp (I realise now I should have left the space as unallocated and let linux sort its own drives out) - so yes, I think ubuntu install is all on a 2.4gb drive.

syg00 - below is the screen shot of screen following the command entered.

Please could you tell me - are you guys addressing the supergrub (booting) issue first of the resizing of the partitions?

Thanks again for helping - I hope this is sortable!

Greg675 07-14-2010 05:54 AM

Would it simply be best to start again?
 
Bc I don't actually have files I want to save on ubuntu bc I only loaded it on yesterday.

It's a sony, 3 year old vgn-tx5mn with 1.2 processor, 2gb ram, 80gb hdd and all I really wanted to do with it was run xp alongside ubuntu on a dual boot basis.

I tried to partition the HDD using ebaeus in xp to get it ready for ubuntu, but all I done as you can see above is failed quite nicely :-(

To save you the bother of trying to explain to me how to sort it out, would it be best just to uninstall (how though?) and start over? I don't really want to have to install xp again though.

Please help.

syg00 07-14-2010 06:08 AM

That is so f*cked up I can't believe that is the way Ubuntu allocated it. I'd be worried about using that partitioning tool - in future use gparted from Ubuntu. From your Ubuntu system do this (just cut and paste it here)
Code:

du -hT
file -s /dev/sda5

*Normally* you should be able to re-install grub with a simple "sudo grub-install /dev/sda" - but I don't like the look of that setup.

As for using that space, unfortunately it is "orphaned", and you won't be able to simply expand (any) partition to use it. You'll have to migrate the data over. Fairly serious bit of work involved - I would move the home to the free space, and use the old home to expand what is presumably the root (/dev/sda6).
Ugly.

syg00 07-14-2010 06:10 AM

Our posts crossed. Let me think how to arrange a re-install and cleanup of XP.

saikee 07-14-2010 06:34 AM

If Ubuntu boots then it is likely the /boot directory is inside /dev/sda6. In such a case Grub2 can be restored by terminal command after Ubuntu has been booted up by SuperGrub
Code:

sudo su
mkdir /mnt/sda6
mount /dev/sda6 /mnt/sda6
grub-install --root-directory=/mnt/sda6 /dev/sda

Don't use SuperGrub myself except I am assuming the OP's assertion that Ubuntu has been booted up by it presumably using Ubuntu's own kernel. If the Ubuntu's own kernel has been deleted (say by nuking the /boot partition) and Supergrub supplies its own kernel then a re-installation is unavoidable.

The above grub-install will work only if Ubuntu's kernel is used. The consequence is /boot will be re-populated with Grub2's system files again and boot to at least a Grub2 prompt which can be used to fire up Ubuntu manually.

Grubrescue can't be used boot up a Linux whereas a Grub prompt can.

syg00 07-14-2010 06:40 AM

The (grub2) sgd will go find a grub.cfg if told to and use that (like a configfile for classic grub). Quite handy for particularly Ubuntu cock-ups. I assume the OP did this, so the installed system looks good to go.

I still don't like the setup - as a new install, might be best to start again.

Greg675 07-14-2010 09:24 AM

Thank you all very much - appreciate your comments so far.
 
saikee - thanks for this but not sure I understand - also, it appears to conflict with what syg00 suggests.

Thanks to you syg00, but (and pls excuse my ignorance), how would you advise doing a clean install without:

a) wiping off the xp already on;
b) having the boot problems in the future (bc is grub somehow fixed to my system?)

Do I simply put the ubuntu cd into the drive and start up and uninstall that way (is this an option?)

or do I boot into ubuntu and uninstall?

Also, how would you advise sorting out the mess of partitions that I've got (pls see screenshot above). Is this where I should use gparted - do you mean I should do this before I uninstall ubuntu?

Sorry for all these questions - I switched to Mac about a year ago and I really wanted to get Linux up and running but I find a lot of the configuration stuff very confusing. If you can help me restart and do it properly this time, that would be truly great.

saikee 07-14-2010 12:10 PM

Grub comes as an embedded boot loader for Ubuntu. Removing Ubuntu will break up Grub and thereafter none of the OSes would boot.

A good operating system will not allow a user to destroy itself. Therefore if you want to delete a Ubuntu already installed into the hard disk you boot up the installation CD and use it as a Live CD. Thus you would be using a Linux booted from the CD and not from the hard disk. Just use any of the terminal tools like fdisk or cfdisk to delete the partition where Ubuntu resides.

If your intention is to re-install just click the installer and instruct it to install over the existing Ubuntu partition. A dirty install is not formatting the existing partition whereas a clean install is one to format the partition first.

Greg675 07-14-2010 01:46 PM

Thank you saikee - appreciate the clear way you've explained this.
 
From what you've said, am I correct in thinking that now I've booted up from the Ubuntu installation cd, I can use disk utility and sort out the partition mess that is above (screen shot)? I know you suggested typing something in terminal but I'm not familiar with this. Disk utilities with its diagramatic form looks safer.

Am I correct in thinking that deleting all the partitions using disk utility, except for the 37Gb NTFS (which has XP on it), would allow Ubuntu to take whatever disk size it required for the install? Or, do I need to create a partition ready for it? Is there an optimum size for this partition? Will I be able to store files on it or should it be a separate partition?

Finally (and sorry for all these questions, but I don't want to make things worse), I'm presuming that reinstalling Ubuntu happens when I reboot the computer and allow the installation disk to install Ubuntu to the HDD automatically?

Then if the above is true, can I expect to have the dual boot option whenever I turn on my machine?

Thank you all again for helping me - I hope it gets easier to understand from here on :-).

saikee 07-14-2010 02:30 PM

The best partitioning tools are in Linux. Both cfdisk and fdisk are excellent tools which carry out partition creation and deletion but not formatting. The former is reversible whiole the latter is irresversible.

Your hard disk showed up by the command "fdisk -l" tells us that you have used between cylinder 2 to 1215 for an extended partition with 4 logical partitions sda5 to sda8 inside. Then between 1216 to 5690 you have your Xp in sda1. There is about 33Gb space, between 5690 to 9729 cyclinders, after sda1. Your 80Gb hard disk has a total 9729 cylinder (1 cylinder=225 heads x 63 sectors x 512 bytes = 8,225,280 bytes or 8.22 Mb)

Linux reserves sda1 to sda4 as primary partitions. If you want more than 4 you need to give up one primary for it to become an extended partition which currently is your sda2.

When you partition a hard disk device sda the command is
Code:

sudo cfdisk /dev/sda
You can do any partition arrangement with cfdisk but the partition table will only be changed if you select "write" and confirm with a "yes". You learn a lot by doing the partition in Linux terminal. If there is something cfdisk refuses to do then what you want is illegal in PC technology. Any partition table created in Linux can be read safely in another PC operating system.

Since you are not familar with the partitioning I shall suggest you to do the following

(A) Restore Xp's MBR by following Task B1 or B2 of Just booting tips in my signature. This makes you free from Ubuntu and Grub as you can boot directly to Xp without the need of Linux. It is also a good exercise to know that how to restore Xp's booting process. You Ubuntu will be temporarily unbootable.

(B) Boot up a Ubuntu CD and use it as a Live CD. Go to a terminal and partition the hard disk by command as usggested above

(C) I recommend you delete sda7 to sda8. sda2 will not be displayed in cfdisk (but visible in fdisk) because an extended partition is just a name and has no storage of its own. It is effectively a border. You can have only on extended partition in any disk and your current size of sda2 is too small and is about 10Gb (1215-2=1213 cylinders). I suggest you use the space 1th to 1215th cylinder to create a "primary" partition which will be named sda2 by cfdisk.

I suggest you then use the space starting from 5691th cylinder for Linux. Make your first logical partition of 1Gb for swap and change its type to 82 as a partition created in Linux is always Type 83 unless you override it by the "Type" parameter. It will be sda5 and sda3 will be used as the extended partition even without your knowledge. I suggest you make another Linux partition say 20Gb large for sda6 for Ubuntu installation.

You then have sda1 Type 7, sda2 Type 83 (or change its type to Type c for fat32 if you want) as spare, sda5 as swap Type 82 and sda6 Type 83 for Ubuntu with 20Gb. That should leave you with another 13Gb unallocated space for future usage.

Once happy with this layout select "write" and confirm with a "yes".

After exiting cfdisk you seek a second opinion of your partition table with command
Code:

sudo fdisk -l
and will see sda3 has used up as I stated.

(D) Once you have the new partitions sda5 and sda6 ready you can click Ubuntu installer and install Ubuntu into sda6. The installer icon is visible at the desktop of the Live CD. You basically tell Ubuntu installer that you are an expert and want to select /dev/sda6, format it in Ext4 filing system and mount it as /. Ubuntu will then install itself in sda6 , put the boot loader in the MBR and dual boot Xp automatically.

You work out how best use the sda2 later.

Reason for deleting your current sda5 to sda8
- These partitions are too small. The extended partition sda2 is also chopped up by sda1 in the middle of the hard disk so you cannot increase the size of sda2 even you have 40Gb unallocated space which is only good for another two primary partitions sda3 and sda4. An extended partition must work as a continuous chain in a hard disk. Your 13Gb unallocated space can be used for logical partitions sda7 to sda15 or just one more primary sda4.

Greg675 07-15-2010 02:56 AM

Many thanks - sorted, but not quite as planned!
 
Hi saikee,

Thanks very much for your lengthy explanation. I really appreciate the time and effort you took to help me.

I did my best to use terminal as you suggested (and had a look on the Net to find out the relevant commands to use), but I couldn't be sure I was doing the right thing - it's all very confusing to me, as DOS used to be (and probably still is).

Your instruction 'A' went fine but when I typed in 'B', it said it was an invalid command. And as I couldn't understand what you'd written for 'C' and below (and I read it many times - sorry), I decided that I'd sort of half take your advice and use Linux's partition manager to delete what I think you were suggesting I delete.

I then installed whilst in cd booted Ubuntu and I think the partition split is better now (although not perfect - there are still some unallocated bits). But the drive sizes for Ubuntu including swap are better and there's fewer 'bits' although probably not as few as I or you'd like.

The problem is solved insofar as I now get the dual boot working without having to resort to Supergrub in my cd drive and I've erased the bl**dy cause of all this problem - the partition manager in xp which caused far more trouble than it's worth.

So - a very big thank you again (and to the others who gave advice).

If you're willing to advise specifically (bc clearly I'm not very capable with this sort of thing) on how to sort out the currently partitioned hdd, please say so and I'll post a screen shot showing how things stand at the moment.

Otherwise I'm just happy that things are working again :-)


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