Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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).

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):

The reason I added 1 to the second number is because after the first try (209715156,278677547) the extended partition stopped one sector short of the last logical partition.

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).