Gparted -- Error: Can't have a partition outside the disk!
So I installed Windows 7 on this laptop and when I fixed grub and booted back into Fudundu I found to my amazement that one of my partitions had disappeared. Instead there was 80GB of free space exactly where that partition used to be.
(Causing Fudundu to fail to boot until I commented out that entry from fstab) So I went over to TestDisk's site and managed to kind of restore my partition table... the old /etc/fstab file with the old UUID for that partition works and everything mounts properly. The only problem is after I wrote the partition table using TestDisk, gparted doesn't show any partitions at all on /dev/sda. Fdisk shows the partitions but also shows some strange W95 Ext'd (LBA). Code:
fdisk -l -u=cylinders My problem is I cant seem to figure out how to fix it. There's a solution given here but I'm scratching my head trying to figure out how to get it to work in my case. Here's sfdisk -d for reference Code:
# partition table of /dev/sda Code:
Error: Can't have a partition outside the disk! |
Ok so while it looked like both the extended partition and one of the logical partitions went past the disk, looking at just the sector numbers, it looked more like /dev/sda8 was inside the harddrive with only the extended partition being off.
So what I did is subtract the last sector number of the last logical partition (sda8) from the beginning of the extended partition, added 1, and ran this command (from here): Code:
echo "209715156,278677548,f" | sudo sfdisk -f -uS /dev/sda -N3 -O sda_sectors_modified.save So the way this command works is the first number is the beginning of the partition and the second number is how large the partition is (which includes the first sector) so that N1 + N2 - 1 = the final sector of the partition. If you have another partition after your extended partition I imagine you'd put it one sector before the beginning of that one. The other parameter is the -N which is what partition you're working on. -N3 being /dev/sda3, -N4 being /dev/sda4 etc. The output file is some kind of backup that you should put someplace other than the harddrive you're working on (although I'm not sure how to use it if the command fails). After running the command gparted looks exactly like it did before I ran testdisk except I actually have my lost partition instead of unallocated space. This seems kind of like a bug with testdisk, being that testdisk is what wrote the extended partition there (although it also recovered the partition that Windows decided to delete). |
Although you've solved the problem,I would consider backing up my files & reinstalling.
Quote:
Are all of your partitions back, because there' free space between 10445 & 13055 Quote:
|
All times are GMT -5. The time now is 11:23 PM. |