In Gparted my entire drive is unallocated. I know this is not true because I checked in testdisk. I want to expand my primary Linux because it says I am out of space but in this condition Gparted won't allow me to. What can I do to fix this?

Asked by Darryl Cashio

This all began because I keep geting a prompt that my computer is low on space. I have 12 gigs allocated to Linux on a 120 Gb drive. When I boot from Gparted live it reads my disc as being wholly unallocated (111 GB). I know this is not true because 4 partitions show in testdisk but how can I expand or combine partitions other than with Gparted? I don't have many files but I have too many dupes of Linux releases and grubs. Every time I try to delete them it doesn't recognize my authority to do so. I have been ignoring these prompts but inevitably I'm headed for trouble. Any suggestions would be welcome! And thank you!

Question information

Language:
Russian Edit question
Status:
Solved
For:
Ubuntu gparted Edit question
Assignee:
No assignee Edit question
Solved by:
Darryl Cashio
Solved:
Last query:
Last reply:
Revision history for this message
Darryl Cashio (dpc69) said :
#1

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c73e5

   Device Boot Start End Blocks Id System
/dev/sda1 * 2048 15529391 7763672 83 Linux
/dev/sda2 15529984 56186879 20328448 83 Linux
/dev/sda3 73596928 98172927 12288000 83 Linux
/dev/sda4 98173215 234452609 68139697+ f W95 Ext'd (LBA)
/dev/sda5 230268928 234440687 2085880 82 Linux swap / Solaris
/dev/sda3 on / type ext4 (rw,errors=remount-ro)
cash051@cash051-Aspire-3680:~$

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

What is the output of :

lsb_release -a; uname -a; dpkg -l | grep linux-image

Thanks

Revision history for this message
Darryl Cashio (dpc69) said :
#4

cash051@cash051-Aspire-3680:~$ lsb_release -a; uname -a; dpkg -l | grep linux-image
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise
Linux cash051-Aspire-3680 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC 2012 i686 i686 i386 GNU/Linux
iU linux-image 3.2.0.53.63 Generic Linux kernel image.
ii linux-image-3.2.0-23-generic-pae 3.2.0-23.36 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-29-generic-pae 3.2.0-29.46 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-30-generic-pae 3.2.0-30.48 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-31-generic-pae 3.2.0-31.50 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-32-generic-pae 3.2.0-32.51 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-33-generic-pae 3.2.0-33.52 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-35-generic-pae 3.2.0-35.55 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-36-generic-pae 3.2.0-36.57 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-37-generic-pae 3.2.0-37.58 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-38-generic-pae 3.2.0-38.61 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-39-generic-pae 3.2.0-39.62 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-40-generic-pae 3.2.0-40.64 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-41-generic-pae 3.2.0-41.66 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-43-generic-pae 3.2.0-43.68 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-44-generic-pae 3.2.0-44.69 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-45-generic-pae 3.2.0-45.70 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-48-generic-pae 3.2.0-48.74 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-49-generic-pae 3.2.0-49.75 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-51-generic-pae 3.2.0-51.77 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-52-generic-pae 3.2.0-52.78 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
iF linux-image-3.2.0-53-generic-pae 3.2.0-53.81 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
iU linux-image-generic-pae 3.2.0.53.63 Generic Linux kernel image

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

dpkg -l | grep linux-image

What is the output please?

Revision history for this message
Curtis Gedak (gedakc) said :
#6

This problem most often occurs when there is a problem with the partition table.

To determine what the problem might be, EITHER double-click on the device graphic in GParted, OR
from a command line issue the following:

     sudo parted /dev/sda unit s print

A tutorial on how to fix problems with MSDOS partition tables can be found at the following link:

How-to Fix Invalid MSDOS Partition Tables
http://gparted.org/h2-fix-msdos-pt.php

Revision history for this message
Darryl Cashio (dpc69) said :
#8

cash051@cash051-Aspire-3680:~$ dpkg -l | grep linux-image
iU linux-image 3.2.0.53.63 Generic Linux kernel image.
ii linux-image-3.2.0-23-generic-pae 3.2.0-23.36 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-29-generic-pae 3.2.0-29.46 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-30-generic-pae 3.2.0-30.48 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-31-generic-pae 3.2.0-31.50 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-32-generic-pae 3.2.0-32.51 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-33-generic-pae 3.2.0-33.52 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-35-generic-pae 3.2.0-35.55 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-36-generic-pae 3.2.0-36.57 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-37-generic-pae 3.2.0-37.58 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-38-generic-pae 3.2.0-38.61 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-39-generic-pae 3.2.0-39.62 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-40-generic-pae 3.2.0-40.64 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-41-generic-pae 3.2.0-41.66 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-43-generic-pae 3.2.0-43.68 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-44-generic-pae 3.2.0-44.69 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-45-generic-pae 3.2.0-45.70 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-48-generic-pae 3.2.0-48.74 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-49-generic-pae 3.2.0-49.75 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-51-generic-pae 3.2.0-51.77 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
ii linux-image-3.2.0-52-generic-pae 3.2.0-52.78 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
iF linux-image-3.2.0-53-generic-pae 3.2.0-53.81 Linux kernel image for version 3.2.0 on 32 bit x86 SMP
iU linux-image-generic-pae 3.2.0.53.63 Generic Linux kernel image
cash051@cash051-Aspire-3680:~$

Revision history for this message
Darryl Cashio (dpc69) said :
#9

cash051@cash051-Aspire-3680:~$ sudo parted /dev/sda unit s print
[sudo] password for cash051:
Error: Can't have a partition outside the disk!
cash051@cash051-Aspire-3680:~$

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

sudo apt-get --purge remove linux-image-3.2.0-2*
sudo apt-get clean
sudo apt-get -f install

I suggest you reboot to one of the 3.5 kernels. You can then remove more kernels. Each is 120Mb so this will get you a lot of space back.

Revision history for this message
Darryl Cashio (dpc69) said :
#11

actionparsnip (andrew-woodhead666):
Thank you,
I am working on taking out the linux-image files. I guess I have to do them one at a time. This will free up space as I have done one and got back 113Mb. I am still having the problem with partition being too big for disk. Won't give me a total size and says it dosen't recognize the sectors.
Thank you for helping me with this. It is much appreciated!

Revision history for this message
Darryl Cashio (dpc69) said :
#12

I lost it all! Can't boot. No grubs loaded! Downloaded backup from Ubuntu One using NetSurf in Gparted. Will try to reboot again and get back soon! Any recovery commands would be appreciated!

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

Confirming Curtis Gedak's assumption and advice above:

The issue with gparted not showing your partitions is most probably caused by a flaw in your partition table:

Disk /dev/sda: ... total 234.441.648 sectors
/dev/sda4 ... End:234.452.609

The end of partition sda4 is said to be greater than the disk size.
Gparted cannot handle such case and fails.

See http://gparted.org/h2-fix-msdos-pt.php#partition-outside-disk for hints how this might be corrected.

As I do not know what you have done that Ubuntu does not boot any more (did you remove all linux-kernel packages up to and including 3.2.0-52?) it is hard to tell how to repair that.

Revision history for this message
Darryl Cashio (dpc69) said :
#14

Can boot into an old environment on my computer via the fantastic System Rescue CD. Its and older version of my desktop but a welcome sight! What I need is to fix my broken grub and ...oh yeah, those darn partitions! Still working on it!

Revision history for this message
Darryl Cashio (dpc69) said :
#15

Oh man! I really don't get it! Finally got my boot back (but it boots really weird) Asks for a password before it boots. And my desktop and files are back but the resolution is wrong, gotta figure that out. Worked all these miracles in Gparted terminal but the strange thing is, after I was finished writing and editing the new values to my partitions it said they (1) Didn't start or stop at the beginning of end of any cylinders, they weren't aligned to anything (2) couldn't be verified and (3) when I used fdisk to display them, it found nothing..they didn't exist.
I was in despair, So just for a lark I launched Gparted, selected my drive and there were my partitions. My whole drive was no longer unallocated. I had lost about 30% of my data but the partitions looked like they were there. Their descriptions showed data inside them. But when I ran a find files and repair it scanned for about an hour and a half and said it couldn't find any data.
Sweating again. So like Paul Newman I decided Oh hell!, let's jump. But it wouldn't exit Gparted.
Forced a shut down and throwing all my disks aside, tried a straight system boot. Screen went black... then after what seemed like forever it asked for a user name and password and booted up to my last desktop. The graphics are all screwed, there's no sound and I don't know what else dosen't work but I did get my system back! Every app I used told me I had nothing. But here it is!
I just hope I can believe my eyes. Thanks to everyone that I consulted and especially System Rescue and testdisk and oh yes!-Boot Repair and launchpad forums! Thank God you guys are there!
Cash051