Compiling NTFS support with Cygwin

How to use TestDisk to recover lost partition
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
Hashim
Posts: 14
Joined: 12 Aug 2017, 00:41

Compiling NTFS support with Cygwin

#1 Post by Hashim »

Is this possible, and if so, what libraries are needed? I had previously compiled a version for Cygwin with the most basic options, but after running it for several days, it finally informed me that I could not list the files on the recoverable partition due to lack of NTFS support, so before running it again I want to be sure that I'm able to see what files exist on the recovered partitions. I tried compiling the ntfs-3g package from Tuxera but it seems that can't be built on Windows.

Thanks in advance for your help.

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Compiling NTFS support with Cygwin

#2 Post by recuperation »

Hashim wrote: 03 Dec 2019, 20:52 Is this possible, and if so, what libraries are needed?
https://www.cgsecurity.org/testdisk.pdf

Read chapter 3 "building from source".
The windows version of Testdisk does contain NTFS support as far as I know.

Hashim
Posts: 14
Joined: 12 Aug 2017, 00:41

Re: Compiling NTFS support with Cygwin

#3 Post by Hashim »

recuperation wrote: 03 Dec 2019, 22:41
Hashim wrote: 03 Dec 2019, 20:52 Is this possible, and if so, what libraries are needed?
https://www.cgsecurity.org/testdisk.pdf

Read chapter 3 "building from source".
The windows version of Testdisk does contain NTFS support as far as I know.
Which particular section are you referring to? I've looked through that whole section of the documentation, both in the PDF and on the Wiki, and always end up failing when running with those commands. If you pointed me to which specific part of that section/which particular commands I need to run to compile Testdisk with NTFS support, it would help.

The problem with the pre-compiled Windows version is that I've found it renders very badly in the CMD console, which I don't like using anyway, and it doesn't work at all in my preferred shell (Bash on Cygwin) due to supposed Cygwin.dll compatibility issues:

Code: Select all

      0 [main] testdisk_win (5084) B:\Users\Hashim\Desktop\testdisk-7.2-WIP-win\testdisk_win.exe: *** fatal error - cygheap base mismatch detected - 0x18032D408/0x18032C408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
Segmentation fault

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Compiling NTFS support with Cygwin

#4 Post by recuperation »

Hashim wrote: 03 Dec 2019, 23:38
recuperation wrote: 03 Dec 2019, 22:41
Hashim wrote: 03 Dec 2019, 20:52 Is this possible, and if so, what libraries are needed?
https://www.cgsecurity.org/testdisk.pdf

Read chapter 3 "building from source".
The windows version of Testdisk does contain NTFS support as far as I know.
Which particular section are you referring to? I've looked through that whole section of the documentation, both in the PDF and on the Wiki, and always end up failing when running with those commands. If you pointed me to which specific part of that section/which particular commands I need to run to compile Testdisk with NTFS support, it would help.
I don't know because I never had the need to compile Testdisk myself.


The problem with the pre-compiled Windows version is that I've found it renders very badly in the CMD console, which I don't like using anyway, and it doesn't work at all in my preferred shell (Bash on Cygwin) due to supposed Cygwin.dll compatibility issues:

Code: Select all

      0 [main] testdisk_win (5084) B:\Users\Hashim\Desktop\testdisk-7.2-WIP-win\testdisk_win.exe: *** fatal error - cygheap base mismatch detected - 0x18032D408/0x18032C408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.
Segmentation fault
With you running Bash on cygwin the error description seems obvious and the error easy to heal.

By the way there is no "rendering" in the CMD console just text output - strange!
You can easily circumvent this by running a linux live version from CD/DVD/USB or otherwise run Testdisk on a new and clean Windows installation.

Locked