After resizing with GParted, I cannot open my partition

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
Jary316
Posts: 2
Joined: 14 Jun 2012, 21:51

After resizing with GParted, I cannot open my partition

#1 Post by Jary316 »

Hi,

This will probably a very novice question but I have made a big mess and would really appreciate if anyone could please help me.

I am running two OS, Windows 7 and Ubuntu, and I have a partition in NTFS that was shared between both for data. This partition was /dev/sda5. Today I want to split /dev/sda5 in two to install another version of Linux on it. I tried using GParted but things have gone wrong.

After reading online and watching tutorials, it seemed that all I needed to do was to select "Resize/Move" in GParted, and slide the bar from the right towards the middle. I did that and hit apply, and then created a mess. Things have gone wrong since then. In Windows 7, I tried deleting the new partition and expanding my old drive so it takes all it's size back, but I realize there are still 1 or 2 unallocated block, as shown on the picture: Image

I believe the unallocated that is 9 MB was part of the drive, and also the 1.02 MB unallocated at the bottom (I have no idea how this one got there).

When trying to open DATA from Ubuntu I get the following error:
Error mounting: mount exited with exit code 12: Failed to read last sector (365685320): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
or it was not setup correctly (e.g. by not using mdadm --build ...),
or a wrong device is tried to be mounted,
or the partition table is corrupt (partition is smaller than NTFS),
or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/sda5': Invalid argument
The device '/dev/sda5' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Windows 7 simply says the partition needs to be formatted, which I am lot letting the OS do.

I have been running TestDisk but I am not sure how to fix the issue. This is the output of "Analyse" is the following:
TestDisk 6.13, Data Recovery Utility, November 2011
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63
Current partition structure:
Partition Start End Size in sectors

1 P hid. FAT32 LBA 0 32 33 2166 254 63 34810807 [RECOVERY]
2 * HPFS - NTFS 2167 0 1 17366 254 63 244188000 [OS]
3 E extended LBA 17367 0 62 60801 47 46 697770156
Error: size boot_sector 365685321 > partition 365668522
Invalid NTFS or EXFAT boot
5 L HPFS - NTFS 17367 1 1 40128 208 16 365668522
5 L HPFS - NTFS 17367 1 1 40128 208 16 365668522
X extended 40129 0 1 60288 213 21 323867775
6 L Linux 40129 245 53 60288 213 21 323852288
X extended 60288 213 22 60801 47 46 8230912
7 L Linux Swap 60288 245 54 60801 47 46 8228864
Running "sudo fdisk -l" gives me the following output:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x76692ca8

Device Boot Start End Blocks Id System
/dev/sda1 2048 34812854 17405403+ 1c Hidden W95 FAT32 (LBA)
/dev/sda2 * 34812855 279000854 122094000 7 HPFS/NTFS/exFAT
/dev/sda3 279000916 976771071 348885078 f W95 Ext'd (LBA)
/dev/sda5 279000918 644669439 182834261 7 HPFS/NTFS/exFAT
/dev/sda6 644687872 968540159 161926144 83 Linux
/dev/sda7 968542208 976771071 4114432 82 Linux swap / Solaris
On the good side, I have a recent backup on an external drive, but I would still like to get back to my previous state and be able to partition my /dev/sda5 for my new OS later on. Maybe the files are still intact on /dev/sda5? It would be nice to salvage them if that is the case.

I am really confused as to what is going on. I would really appreciate if anyone could please help me.

Thank you really much for your help!

User avatar
Fiona
Posts: 2835
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: After resizing with GParted, I cannot open my partition

#2 Post by Fiona »

Have you been able to list your files on a partition?
It works like, check a partition and press p to list your files.
Please run Deeper Search in TestDisk also.
Deeper Search searches partition by the backup of the boot sector.
If nothing would be found, you have an unformatted partition in your partition table.
Is this one here;
1 P hid. FAT32 LBA 0 32 33 2166 254 63 34810807 [RECOVERY]
2 * HPFS - NTFS 2167 0 1 17366 254 63 244188000 [OS]
3 E extended LBA 17367 0 62 60801 47 46 697770156
Error: size boot_sector 365685321 > partition 365668522
Invalid NTFS or EXFAT boot
5 L HPFS - NTFS 17367 1 1 40128 208 16 365668522
5 L HPFS - NTFS 17367 1 1 40128 208 16 365668522

X extended 40129 0 1 60288 213 21 323867775
6 L Linux 40129 245 53 60288 213 21 323852288
X extended 60288 213 22 60801 47 46 8230912
7 L Linux Swap 60288 245 54 60801 47 46 8228864
It might be possible to have a boot sector diagnose.
But infos will follow.
Please don't change/edit nothing to your affectes disk anymore.
It can make recovery worse or impossible.

Tip if someone likes to resize his partition;
First off all, Backup, like yoe have it.
Under Windows, in Vista/Win7, it's possible to resize a partition using the windows disk management console.
Using third party partitioning tools, it's advisable not to create more than one job/task after another.

Fiona

Jary316
Posts: 2
Joined: 14 Jun 2012, 21:51

Re: After resizing with GParted, I cannot open my partition

#3 Post by Jary316 »

Hi Fiona,

Thanks a lot for your help!

I have not been able to list the file on /dev/sda5 using the p option (with Quick search or after Deeper Search).

Quick Search seems to restore the partition table, but it is missing /dev/sda6 and /dev/sda7 (linux partition). If I go into Deeper Search, it lists many Linux partitions for some reason (those partitions are fine).

What do you please recommend that I do from there? I'm thinking of just formatting my /dev/sda5 partition at this point as most of the data is on my backup drive, and it seems a hassle to fix.

Thanks!

Locked