Is this a serious issue? If yes, what risks are involved? How critical is this warning, i.e. should I fix it?
My computer is functioning fine. Both Linux and Windows systems are up and running without any hiccups. I did not experience any data loss/corruption. Is it possible that TestDisk is wrong?
I also used gparted application to test my partitions. It did not report any problems.
I’m in favor of fixing the drive geometry, but I’m worried to make the things worse. Anyone that has experience with such problems/tools: I need your help!
I think that is a serious issue. What does it mean?
The first line tells us that you have a hd with 37 Gig, 63 heads and 255 cylinders (logical head and cylinders). So every primary partition has to start at cylinder 0 and end at cylinder 254 and every logical partition has to start at cylinder 1 and end at cylinder 254.
The line above the NTFS-partitions mean that in the partition table the NTFS-partition ends at cylinder 240. That’s not correct. The worst case with incorrect partition tables is that all partitions will be lost. It could be that will never happen. It could be it happens tomorrow. But don’t worry. You own testdisk.
It’s good that you are carefull. Testdisk is a powerful tool which can do a lot of good things for you but also some bad ones. I recommend:
step: Read the manual
step: Read the manual
step: Read the manual
After reading all closely (good place to start it: TestDisk - CGSecurity) I also recommend to make a copy of your disk before starting to play around with the partition tables. Best thing would be to have the same disk to do so. The target disk must be at least as big as the source disk. Connect both to the same computer and type:
dd if=/dev/sda of=/dev/sdb
ATTENTION: if means input file. So in the example the bad disk would be the one after if. of means output file. So in the example the empty disk you want to copy the data to would be the second disk. If you mix up if and of the empty disk will be copied without any warning to the original one. So the original one will be deleted. After hitting ENTER you may go shoping, do the dishes or everything else you like.
DO NOT COPY THE CODE IF YOU ARE NOT 100% SURE WHAT YOU ARE DOING!
Now have fun with testdisk.
If you messed up your original disk just copy the backup back to it and start again. Now the example would be:
dd if=/dev/sdb of=/dev/sda
Again: Think three times before you hit ENTER and keep cool.
I also recommend to make a copy of your disk before starting to play around with the partition tables. Best thing would be to have the same disk to do so. The target disk must be at least as big as the source disk.
Unfortunately, I do not have an empty spare drive for this job, but on my external USB drive I have enough space for a 40GB image.
I’m not sure if Northon Ghost is capable of creating the images of drives with ext3 file system. Do you have any suggestions here?
Is it possible to create drive image directly from Linux, which tool I should use?
I’m also curious to know, what caused the drive geometry to become wrong? For partitioning of my drives I always use either the Windows Disk Management tool or Linux partition tool (at installation). One of these tools is not doing the proper job.
Then I tried to fix the geometry using testdisk. Obviously something terribly went wrong because I ended up with unusable system. I don’t know exactly what I did, but my computer refuses to boot from the HDD.
I decided to restore my HDD from the image file, using gparted live CD (at that time, gparted did not recognize any partitions on the drive)
I did the following:
mount -t ntfs-3g /dev/sda1 /mnt/usb
gunzip -c /mnt/usb/nc6000.img.gz | dd of=/dev/hda
The restore operation ended up with input/output error.
It said that only first 11GB were copied.
Now my computer boots, but only in Windows XP (which is the first partition on disk). So that part was recovered correctly.
Now both gparted and testdisk recognize the other HDD partitions, still I can’t start Linux. Besides testdisk now reports more issues with the HDD.
restore the partitions contents (from the backups)
By the way following message is still present.
Warning: Incorrect number of heads/cylinder 240 (NTFS) != 255 (HD)
In the meantime I learned that this does not necessarily mean that something is wrong with the HDD. Since testdisk is guessing the number of heads/cylinder, sometimes the guess can be wrong.
That explains why Windows version of testdisk guesses 16 HD/CYL while Linux version guesses 255 HD/CYL.