-1

installed Ubuntu 14.04 against Windows 7. I installed GParted to partition my harddrive since it had occupied entire disk. But, I'm not able to repartition.

Note: After installing Ubuntu replacing Windows 7, almost 70GB is missing.

sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): D7EFA26A-1DD8-4C04-833D-0547B9D384D8
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 5485 sectors (2.7 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      1946189823   928.0 GiB   8300  Linux filesystem
   5      1946191872      1953523711   3.5 GiB     8200  Linux swap

 sudo fdisk -l /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0x0001f044

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048  1946189823   973093888   83  Linux
/dev/sda2      1946191870  1953523711     3665921    5  Extended
/dev/sda5      1946191872  1953523711     3665920   82  Linux swap / Solaris
surendar
  • 243
  • 4
  • 7
  • 19
kaspa
  • 355
  • Why are you not able to repartition? Do you not know how to do it, or is there an error or something? – bain Aug 01 '14 at 11:27
  • @bain When I open GParted to repartition, it shows only 3 partitions, sda1, sda2 and sda 5, I don't know where the other partitions went missing, probably that is the 70 GB of my harddisk which is lost. sda1 is a partition with almost 930 GB size. It shows a flag boot in GParted, mount point / and file system EXT4. – kaspa Aug 01 '14 at 11:35
  • Are you sure that you didn't delete the other partitions? Can you modify your question and include the output of gdisk -l /dev/sda and fdisk -l /dev/sda – bain Aug 01 '14 at 11:39
  • @bain I'm not sure what happened, but I wanted to dual boot Windows 7 along with Ubuntu, but something went wrong and I had to install Ubuntu alone.

    gdisk -l /dev/sda gives GPT fdisk (gdisk) version 0.8.8

    Problem opening -l/dev/sda for reading! Error is 2. The specified file does not exist!

    fdisk -l /dev/sda gives Cannot open /dev/sda

    – kaspa Aug 01 '14 at 11:48
  • You need a space between -l and /dev/sda, also you need to use sudo: sudo gdisk -l /dev/sda and sudo fdisk -l /dev/sda – bain Aug 01 '14 at 11:51
  • @bain I added the results of those commands in the question. Can you tell now ? – kaspa Aug 01 '14 at 12:25
  • Why do you think some space is missing? According to the output you have 928 GiB+3.5GiB=931.5GiB, which exactly matches your reported disk size. Perhaps you are confusing GiB and GB? – bain Aug 01 '14 at 12:26
  • No, that's not the problem actually. I'm unable to repartition though I tried with GParted. Since I'm new to Ubuntu, I'm looking for some help to learn exactly why I'm not able to repartition. – kaspa Aug 01 '14 at 12:30
  • You do have invalid GPT data though so run fixparts to delete it http://www.rodsbooks.com/fixparts/ – bain Aug 01 '14 at 12:30
  • gparted is probably refusing to edit the partitions because the GPT data is corrupt. See question How to remove GPT from HDD? or run fixparts – bain Aug 01 '14 at 12:31

1 Answers1

0

You've trashed your existing Windows partitions by selecting the wrong Ubuntu installation option. If you thought you were installing alongside, as your comments suggest, then I'm afraid you erred. If you have critical personal files on the disk, then stop using it immediately and begin recovery operations using PhotoRec or a similar Windows-specific utility. Every second you continue to use the disk, you run the risk of Linux writing over an important Windows file. (This is true even if you don't actively do things; Linux writes log files and whatnot in the background.)

You have no "missing 70GB." You're probably confusing gigabytes (GB) and gibibytes (GiB). gdisk uses the latter units, but disk manufacturers almost always use the former.

Finally, your disk uses the Master Boot Record (MBR) partitioning scheme. The gdisk tool you used to show your partitions is written for the newer GUID Partition Table (GPT). Although gdisk will show your partitions because it automatically converts from MBR to GPT, better (and safer) choices are fdisk, parted, and GParted. Please ignore bain's suggestion to use FixParts on the disk, unless you see other signs of trouble. The "invalid GPT" referred to by gdisk, in this context, means no GPT. This is more clearly indicated by the GPT: not present line in its output.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • Thank you. I had all my important data into an external hard disk, so it is not going to be a problem. Now, I want to create another partition to install Windows 7 in it, but, I'm not able to partition. I used GParted to see if I can make any partitions possible, but it didn't happen. Suggest me how to do. I'm not able to insert any image to give a better understanding. – kaspa Aug 01 '14 at 13:34
  • To repartition with GParted, you need to run it from an external drive, such as an Ubuntu install CD in its "try before installing" mode. – Rod Smith Aug 01 '14 at 15:26
  • Yes, The windows is trashed as you have said it is because of the wrong installation method. What is the right installation method ? – kaspa Aug 01 '14 at 17:34
  • Earlier I had C D E F G H drives when there was windows. C had windows 7, So I went windows disk management emptied D and E drives and made them as two new primary partitions because I felt I can install two operating systems in D and E drives. Then I inserted Bootable Ubuntu load USB drive and restarted the computer. There I selected USB-CD as first boot device, Ubuntu loaded,then there are two options I found try and install Ubuntu, I selected Install it opened and there I have chosen make partition and the partition opened some windows loader at the top as sda0, sda1 200 GB this is my drive – kaspa Aug 01 '14 at 17:43
  • and then i had all the rest 730 GB as single sda2(sda2/sda3 I exactly don't remember because there were Boot loaders like drives before my C drive as appeared in Ubuntu partition window). Then I selected the 730 GB space and selected '-' and created 100 GB partition and selected '/' along with Ext4 file system and proceeded with install. It took some time and installed and I restarted the computer there it gave four options one for ubuntu,one something like linux,one memory testing and another one windows. When I selected it gave ctrl+alt+del bootmgr missing, For Ubuntu it showed similar thing – kaspa Aug 01 '14 at 17:50