Partitions messed up after resizing WIndows partition. Cannot start Ubuntu 12.04

Asked by TASSOS PANAGIOTOPOULOS

Hello.

I have a Desktop PC with 1 hard disk drive running Windows XP and Ubuntu 12.04.

The hard disk (sda) was structured the following way :

1 NTFS partition for Windows XP
1 ext4 partition for /
1 ext4 partition for /home
1 swap partition
1 NTFS partition for personal Data

I was running out of disk space so I decided to "steal" some space from the Windows partition.

I thought it would be better to do this from Windows (I guess this was a bad idea?) using Partition Magic.

Unfortunately, now neither Windows nor Ubuntu starts.

Grub seems to work properly, so I get the option to try and boot either Ubuntu or Windows.

If I boot Windows I get a message that a disk UUID was not found and blue screen after some seconds. I tried booting Safe mode or command prompt but with no luck either, but all these are now out of scope (Windows problems ;).

As far as Ubuntu is concerned, normal boot was not successful - I was getting a message that some drives were not mounted and to press M for manual mount etc... - (although at some time after trying some stuff --see below--, I managed to get the login screen, but after entering my password, a few seconds later I was sent back to the login screen (I suspect that this is because the /home folder is not mounted?)

The only way I could try something was by selecting recovery mode booting and entering the Root command prompt. Fixing and checking filesystems did not seem to work.

So my question is: What's next? I've googled in order to find a solution but I got a bit confused with blkid, fstab, mounting, UUIDs etc?

I've seen messages while attempting to fix the problem that swap is not mounted or /home is already mounted etc...

 With blkid I see 4 partitions and their UUIDs. I have a feeling that the /sda# numbers are changed/messed up and auto-mounting attempts fail. I guess that I do not see the 5th partition (the one I created with partition magic) since it should still be unallocated, right?

Could you please let me know how to check the contents/files/data of each partition, how to correctly properly mount them and how to configure fstab? Should I and is there a way/reason to change the sda# numbers? Is there a change that a partition has also a different sda# number after resizing the Windows NTFS partition?

A a stepwise approach would be useful... Can I do something with recovery mode/root or should I use a live CD (the live cd is the .iso I download from ubuntu site and selecting the Test Ubuntu option, right?)

Unfortunately I do not have copy/paste capability as my PC does not boot due to the above things. (It is myu work PC and now I'm at home).

Sorry for this question bombing and thank you in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
TASSOS PANAGIOTOPOULOS
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

If you boot to liveCD you can run:

sudo blkid

To see the IDs of the partitions. You can then use this guide:

http://www.omgubuntu.co.uk/2011/09/live-usb-sticking-grub-2-video

To chroot to the installed OS and check the configs

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#2

On 10/12/2012 04:45 PM, TASSOS PANAGIOTOPOULOS wrote:
> Question #211050 on util-linux in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/util-linux/+question/211050
>
> Description changed to:
> Hello.
>
> I have a Desktop PC with 1 hard disk drive running Windows XP and Ubuntu
> 12.04.
>
> The hard disk (sda) was structured the following way :
>
> 1 NTFS partition for Windows XP
> 1 ext4 partition for /
> 1 ext4 partition for /home
> 1 swap partition
> 1 NTFS partition for personal Data
>
> I was running out of disk space so I decided to "steal" some space from
> the Windows partition.
>
> I thought it would be better to do this from Windows (I guess this was a
> bad idea?) using Partition Magic.
>
> Unfortunately, now neither Windows nor Ubuntu starts.
>
> Grub seems to work properly, so I get the option to try and boot either
> Ubuntu or Windows.
>
> If I boot Windows I get a message that a disk UUID was not found and
> blue screen after some seconds. I tried booting Safe mode or command
> prompt but with no luck either, but all these are now out of scope
> (Windows problems ;).
>
> As far as Ubuntu is concerned, normal boot was not successful (although
> at some time after trying some stuff --see below, I managed to get the
> login screen, but after entering the password, a few seconds later I was
> sent back to the login screen (I suspect that this is because the /home
> folder is not mounted?)
>
> The only way I could try something was by selecting recovery mode
> booting and entering the Root command prompt. Fixing and checking
> filesystems did not seem to work.
>
> So my question is: What's next? I've googled in order to find a solution
> but I got a bit confused with blkid, fstab, mounting, UUIDs etc?
>
> I've seen messages while attempting to fix the problem that swap is not
> mounted or /home is already mounted etc...
>
> With blkid I see 4 partitions and their UUIDs. I have a feeling that
> the /sda# numbers are changed/messed up and auto-mounting attempts fail.
> I guess that I do not see the 5th partition (the one I created with
> partition magic) since it should still be unallocated, right?
>
> Could you please let me know how to check the contents/files/data of
> each partition, how to correctly properly mount them and how to
> configure fstab? Should I and is there a way/reason to change the sda#
> numbers? Is there a change that a partition has also a different sda#
> number after resizing the Windows NTFS partition?
>
> A a stepwise approach would be useful... Can I do something with
> recovery mode/root or should I use a live CD (the live cd is the .iso I
> download from ubuntu site and selecting the Test Ubuntu option, right?)
>
> Unfortunately I do not have copy/paste capability as my PC does not boot
> due to the above things. (It is myu work PC and now I'm at home).
>
> Sorry for this question bombing and thank you in advance.
>
Hi ,

try this automatic tool and see if it can repair your installation.
Boot-Repair : https://help.ubuntu.com/community/Boot-Repair

Use it from a LiveCD/Usb.

Thanks

Revision history for this message
TASSOS PANAGIOTOPOULOS (supertp) said :
#3

Hello and thank you both for your answers.

Andrew, ofcourse I can try that but I'm not sure I need to do this. My grub seems to be working fine, and choosing to boot Ubuntu in recovery mode/console, I have root access to the installed Ubuntu (by choosing the Root Command Prompt from the menu).

I think that all I need is a how to and what to do concerning the "check the configs" that you mention...

Nick I will try the tool you mentioned. Seems very useful anyway, but I'm not sure whether it can help me fix my issues.

I'm a newby with linux so I need some guidance with what to do, how (and why...).

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#4

On 10/13/2012 12:35 AM, TASSOS PANAGIOTOPOULOS wrote:
> Nick I will try the tool you mentioned. Seems very useful anyway, but
> I'm not sure whether it can help me fix my issues.
>
> I'm a newby with linux so I need some guidance with what to do, how (and
> why...).
>
First of all I just saw you are Greek , so check this out :
http://forum.ubuntu-gr.org/

The tool I gave you it will mount all the partitions and will try to
repair grub (install it in first disk /dev/sda) according to mounted
partitions. The most important (IMO) is that creates a
boot-info-summary. If you run the tool , keep the link from boot-info
and provide it here.

Thanks

Revision history for this message
TASSOS PANAGIOTOPOULOS (supertp) said :
#5

Thanks a lot for the link Nick.

Just one thing. As I mentioned, the problem I have does not seem to be with the grub configuration but with mounting...

Should the tool (or if Gparted for example) fails to mount a partition, what do I do next?

Thanks again.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

You can check the /etc/fstab file in the installed OS and make sure the UUIDs match for the partitions in the system

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#7

On 10/13/2012 08:51 AM, TASSOS PANAGIOTOPOULOS wrote:
> Question #211050 on util-linux in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/util-linux/+question/211050
>
> Status: Answered => Open
>
> TASSOS PANAGIOTOPOULOS is still having a problem:
> Thanks a lot for the link Nick.
>
> Just one thing. As I mentioned, the problem I have does not seem to be
> with the grub configuration but with mounting...
>
> Should the tool (or if Gparted for example) fails to mount a partition,
> what do I do next?
>
> Thanks again.
>
You must follow a procedure where you will chroot in your current
installation from within a LiveCD/Usb and you will be able to change the
UUID's and correct the fstab file. There is the problem. (I guess). If
you use the boot-repair tool do not and your problem not solved , do not
forget to provide the link with the boot-info results here. We will see
whats going wrong.

Thanks

Revision history for this message
TASSOS PANAGIOTOPOULOS (supertp) said :
#8

ok. thanks a lot.I'll give it a try and let you know

Revision history for this message
TASSOS PANAGIOTOPOULOS (supertp) said :
#9

Hello.

After a great deal of effort, unfortunately I think it is now better to go to a format/reinstallation.

I used the recovery console to access the root prompt. Then managed to repair fstab (although initially I wasn't given write access but by running a "mount" command (can't remember it exactly...I googled it) I managed to save the changed I made, I basically managed to mount the /home.

Then rebooted and managed to normally login (since /home was available again in fstab).

BUT :

Running Gparted showed me that the total disk capacity (sda) was unallocated!!!

Running Disk Utility showed me the correct partitions, but unfortunately the NTFS partition containing the data I wanted to retrieve was shown as unknown/unallocated partition.

Ofcourse, trying to boot again Windows OS failed...

So I decided to try to use the WIndows XP CD to try and recover/repair the Windows installation as well as the NTFS data partition...

BIG MISTAKE!!!

By using the CD and although I did NOT perform ANY operation (i.e. delete a partition or start the Win Installation) as I only wanted to check if there was any Windows Repair option, this messed up my Grub configuration...

I.e. after rebooting, instead of being given the Grub menu... Windows automatically started (being prompt to select between norma, safe etc boot) and ... failed after some time (again with blue screen).

So I decided to use the Boot Repair Disk to repair grub...
This did not work either. Unfortunatelly I couldn't keep a copy of the log. I tried installing grub in various partitions, tried several options, tried to repair the MBR, tried repairing the file system... Nothing worked. Ofcourse it is possible that I was doing something wrong but...without internet access I couldn't do much...

Before deciding to go for a format/reinstallation, I gave it another try to manage and recover my NTFS data partition.

I performed a reinstallation of Windows at the same previous Windows partition!!

Thankfully, this worked and I also managed to access the Data NTFS partition I had!!!

I know that there sure is a way to fix the grub and restore the Ubuntu installation and partitions... but to tell you the truth I got tired :) After all, I think I couldn't get back to my previous Windows Configuration.

So, I've made up my mind and decided to abandon Windows (keep them only in a Virtual Machine) and go for 100% Ubuntu!!

So thank you all for your time and support!!!

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#10

On 10/16/2012 03:56 PM, TASSOS PANAGIOTOPOULOS wrote:
>
> So, I've made up my mind and decided to abandon Windows (keep them only
> in a Virtual Machine) and go for 100% Ubuntu!!
>
> So thank you all for your time and support!!!
>

Good choice. !!

Glad you solved it.