Testdisk aka photorec

If you are looking for a specific 64-bit package and you can't find it in any of the 64-bit repos, please post a request for it here
Post Reply
User avatar
Rava
Contributor
Contributor
Posts: 1573
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Testdisk aka photorec

Post#1 by Rava » 28 May 2018, 02:43

I would like to request the most recent version of testdisk (also called photorec) for 4.0 Porteus x86-64 (XFCE)

I tried creating 6.12, 6.13 and 6.14 versions using several packages as source, like testdisk_photorec-6.14-x86_6-slaxmax or testdisk-6.13-x86_64-1cf

The error with testdisk_photorec-6.14-x86_6-slaxmax was:

Code: Select all

/usr/local/bin/testdisk: error while loading shared libraries: libntfs-3g.so.83: cannot open shared object file: No such file or directory
Port 4.0 uses: libntfs-3g.so.88.0.0
That issue can be solved (see below), but there is another issue, also apparent with testdisk-6.13-x86_64-1cf.xzm. testdisk won't work even when applying this script after activating:

Code: Select all

#!/bin/sh
if test $UID -eq 0; then
	cd /usr/lib64
	ln -sv libcrypto.so.1.0.0 libcrypto.so.0
	cd /lib64
	ln -sv libcrypto.so.1.0.0 libcrypto.so.0
	ln -sv libntfs-3g.so.88.0.0 libntfs-3g.so.80
	echo FIND libewf.so.1 or newer and make link when needed MANUALLY.
else
	echo run me as root.
fi
# TODO FIND libewf.so.1
The issue for now was not finding any x86-64 libary version of libewf.so.1 (as seen in the TODO at the end of the script above)
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1442
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

Testdisk aka photorec

Post#2 by ncmprhnsbl » 28 May 2018, 03:07

Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 3955
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

Testdisk aka photorec

Post#3 by Ed_P » 28 May 2018, 15:51

Didn't work for me.

qphotorec: error while loading shared libraries: libntfs-3g.so.87: cannot open shared object file: No such file or directory

Summary terminal output:

Code: Select all

root@porteus:/home/guest# usm -g testdisk

 The following items were found.
 Choose an number to confirm. 
 ctrl+c to quit

1) testdisk-7.0-x86_64-1_slonly.txz
2) testdisk-7.0-x86_64-1ponce.txz
#? 2

 The following packages are required. 
testdisk-7.0-x86_64-1ponce.txz [428K] [not installed]

Total size: 428 KB
 Would you like to install the package/s? (custom paths are supported) [y/n]

 Press [r] to remove packages, [q] to quit, or enter to start downloading.

 ############################### 
Downloading: testdisk-7.0-x86_64-1ponce.txz  DONE

 Commencing package conversion ... 
Verifying package testdisk-7.0-x86_64-1ponce.txz.
Installing package testdisk-7.0-x86_64-1ponce.txz:
PACKAGE DESCRIPTION:
# testdisk (data recovery software)



root@porteus:/home/guest# usm -g libewf

 The following items were found.
 Choose an number to confirm. 
 ctrl+c to quit

1) libewf-20140608-x86_64-2_slonly.txz
#? 1

 The following packages are required. 
libewf-20140608-x86_64-2_slonly.txz [904K] [not installed]

Total size: 904 KB
 Would you like to install the package/s? (custom paths are supported) [y/n]

 Press [r] to remove packages, [q] to quit, or enter to start downloading.

 ############################### 
Downloading: libewf-20140608-x86_64-2_slonly.txz  DONE

 Commencing package conversion ... 
Verifying package libewf-20140608-x86_64-2_slonly.txz.
Installing package libewf-20140608-x86_64-2_slonly.txz:
PACKAGE DESCRIPTION:
# libewf (libYAL Expert Witness Compression library)
#

 
Executing install script for libewf-20140608-x86_64-2_slonly.txz.
Package libewf-20140608-x86_64-2_slonly.txz installed.

Creating /tmp/usm/libewf-20140608-x86_64-2_slonly.xzm

Quiet mode: off
Updating shared library links:  /sbin/ldconfig




root@porteus:/home/guest# cd /usr/lib64
root@porteus:/usr/lib64# ln -sv libcrypto.so.1.0.0 libcrypto.so.0
'libcrypto.so.0' -> 'libcrypto.so.1.0.0'
root@porteus:/usr/lib64# cd /lib64
root@porteus:/lib64# ln -sv libcrypto.so.1.0.0 libcrypto.so.0
'libcrypto.so.0' -> 'libcrypto.so.1.0.0'
root@porteus:/lib64# ln -sv libntfs-3g.so.88.0.0 libntfs-3g.so.80
'libntfs-3g.so.80' -> 'libntfs-3g.so.88.0.0'
root@porteus:/lib64# cd /home/guest
root@porteus:/home/guest# qtestdisc
bash: qtestdisc: command not found
root@porteus:/home/guest# qphotorec
qphotorec: error while loading shared libraries: libntfs-3g.so.87: cannot open shared object file: No such file or directory
root@porteus:/home/guest# 
Ed

User avatar
Rava
Contributor
Contributor
Posts: 1573
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Testdisk aka photorec

Post#4 by Rava » 28 May 2018, 16:38

Ed_P wrote:
28 May 2018, 15:51
Didn't work for me.

qphotorec: error while loading shared libraries: libntfs-3g.so.87: cannot open shared object file: No such file or directory
Have you tried my hack in the first Post? You may have to adjust the target or source file name accordingly to whats in your System and what ldd tells you is missing.

I check these out and give you heads up later.
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 742
Joined: 02 Jan 2011, 11:33
Location: italy

Testdisk aka photorec

Post#5 by beny » 28 May 2018, 18:23

/var/log/packages/ntfs-3g-2016.2.22-x86_64-1 with testdisk from slackbuild i have this version.

User avatar
Ed_P
Contributor
Contributor
Posts: 3955
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

Testdisk aka photorec

Post#6 by Ed_P » 28 May 2018, 18:54

Rava wrote:
28 May 2018, 16:38
Have you tried my hack in the first Post?
Yes, check the code at the bottom of the Summary I posted.
what ldd tells you is missing.
Pretty much the same thing as the error msg.

Code: Select all

root@porteus:/home/guest# qphotorec
qphotorec: error while loading shared libraries: libntfs-3g.so.87: cannot open shared object file: No such file or directory
root@porteus:/home/guest# ldd /usr/bin/qphotorec
	linux-vdso.so.1 (0x00007ffe905dd000)
	libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007fb8dd59a000)
	libQtGui.so.4 => /usr/lib64/libQtGui.so.4 (0x00007fb8dc8a1000)
	libQtCore.so.4 => /usr/lib64/libQtCore.so.4 (0x00007fb8dc3a6000)
	libz.so.1 => /lib64/libz.so.1 (0x00007fb8dc18f000)
	libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fb8dbf88000)
	libntfs-3g.so.87 => not found
	libext2fs.so.2 => /lib64/libext2fs.so.2 (0x00007fb8dbd36000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fb8dbb32000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb8db7b4000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fb8db419000)
	libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fb8db202000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fb8dae18000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb8dabf9000)
	libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007fb8da9f7000)
	libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fb8da6e1000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007fb8da4ae000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fb8da1fa000)
	libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007fb8d9fa7000)
	libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007fb8d9da0000)
	libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007fb8d9b85000)
	libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007fb8d997b000)
	libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fb8d9739000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fb8d9527000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fb8d91ec000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fb8d8fe8000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fb8d8de0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb8dd802000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fb8d8b6e000)
	libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007fb8d88be000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fb8d86ae000)
	libffi.so.6 => /usr/lib64/../lib64/libffi.so.6 (0x00007fb8d84a6000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fb8d8274000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fb8d804e000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fb8d7e4b000)
	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007fb8d7c46000)
root@porteus:/home/guest# 

Code: Select all

root@porteus:/home/guest# ls -l /lib64/*ntfs*
lrwxrwxrwx 1 root root     20 Apr 22 14:16 /lib64/libntfs-3g.so -> libntfs-3g.so.88.0.0*
lrwxrwxrwx 1 root root     20 May 28 14:39 /lib64/libntfs-3g.so.80 -> libntfs-3g.so.88.0.0*
lrwxrwxrwx 1 root root     20 Apr 22 14:16 /lib64/libntfs-3g.so.88 -> libntfs-3g.so.88.0.0*
-rwxr-xr-x 1 root root 308104 Apr  7  2017 /lib64/libntfs-3g.so.88.0.0*
root@porteus:/home/guest# 
A neat command ldd. I've never used it before.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1442
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

Testdisk aka photorec

Post#7 by ncmprhnsbl » 28 May 2018, 23:03

@Ed
the correct linking in this case would be:

Code: Select all

ln -sv libntfs-3g.so.88.0.0 libntfs-3g.so.87
if such linking will work at all...
the best solution is to build: https://slackbuilds.org/repository/14.2 ... h=testdisk
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 3955
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

Testdisk aka photorec

Post#8 by Ed_P » 29 May 2018, 01:23

Thanks ncmprhnsbl that appears to have worked.

Code: Select all

'libcrypto.so.0' -> 'libcrypto.so.1.0.0'
'libcrypto.so.0' -> 'libcrypto.so.1.0.0'
'libntfs-3g.so.87' -> 'libntfs-3g.so.88.0.0'

	linux-vdso.so.1 (0x00007ffc98583000)
	libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007ff38dc7d000)
	libQtGui.so.4 => /usr/lib64/libQtGui.so.4 (0x00007ff38cf84000)
	libQtCore.so.4 => /usr/lib64/libQtCore.so.4 (0x00007ff38ca89000)
	libz.so.1 => /lib64/libz.so.1 (0x00007ff38c872000)
	libuuid.so.1 => /lib64/libuuid.so.1 (0x00007ff38c66b000)
	libntfs-3g.so.87 => /lib64/libntfs-3g.so.87 (0x00007ff38c420000)
	libext2fs.so.2 => /lib64/libext2fs.so.2 (0x00007ff38c1ce000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007ff38bfca000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ff38bc4c000)
	libm.so.6 => /lib64/libm.so.6 (0x00007ff38b8b1000)
	libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007ff38b69a000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ff38b2b0000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff38b091000)
	libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007ff38ae8f000)
	libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007ff38ab79000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007ff38a946000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007ff38a692000)
	libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007ff38a43f000)
	libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007ff38a238000)
	libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007ff38a01d000)
	libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007ff389e13000)
	libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007ff389bd1000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007ff3899bf000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007ff389684000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007ff389480000)
	librt.so.1 => /lib64/librt.so.1 (0x00007ff389278000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff38dee5000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007ff389006000)
	libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007ff388d56000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007ff388b46000)
	libffi.so.6 => /usr/lib64/../lib64/libffi.so.6 (0x00007ff38893e000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007ff38870c000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007ff3884e6000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007ff3882e3000)
	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007ff3880de000)


Unable to load library icui18n "Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)" 
Qt: Session management error: None of the authentication protocols specified are supported
Don't understand the latter errors but it still came up. :happy62:
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3955
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

Testdisk aka photorec

Post#9 by Ed_P » 30 May 2018, 05:29

If you want to make a standalone module for this Rava this script worked for me. (4.0 x86_64 Cinnamon DE)

Code: Select all

#!/bin/bash
# https://forum.porteus.org/viewtopic.php?f=74&t=7823
# https://forum.porteus.org/viewtopic.php?p=56113#p56113

if [ `whoami` != "root" ]; then
    echo -e "Enter root's password"
    su -c "sh $0 $1"
    exit
fi

if [ "$1" == "" ]; then
   echo usm -g libewf
   usm -g libewf
   echo
   read
   echo usm -g testdisk
   usm -g testdisk
   echo
   read
fi

if [ -d /tmp/mod/ ]; then
   rm -rf /tmp/mod
fi
mkdir -p /tmp/mod
mkdir -p /tmp/mod/lib64
mkdir -p /tmp/mod/usr/lib64

for pkgs in /tmp/usm/*.txz; do installpkg -root /tmp/mod $pkgs; done

cd /tmp/mod/usr/lib64
ln -sv libcrypto.so.1.0.0 libcrypto.so.0
cd /tmp/mod/lib64
ln -sv libcrypto.so.1.0.0 libcrypto.so.0
#ln -sv libntfs-3g.so.88.0.0 libntfs-3g.so.80
ln -sv libntfs-3g.so.88.0.0 libntfs-3g.so.87

echo
dir2xzm /tmp/mod /tmp/testdisk-7.0-x86_64-1_libewf.xzm

echo
echo Copy /tmp xzm module to the /modules folder and activate.
read
rm -rf /tmp/mod
Ed

User avatar
Rava
Contributor
Contributor
Posts: 1573
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Testdisk aka photorec

Post#10 by Rava » 18 Jun 2018, 02:45

Ed_P wrote:
28 May 2018, 18:54
A neat command ldd. I've never used it before.
Especially done together with

Code: Select all

|grep "not found"
:)

Of course, my approach with the ln -s to another library version is a dirty hack, but alas, when it works as it should I am okay with that. Of course², some programs might complain that the target lib has not the wanted internal version, but lots of programs not seem to bother. Usually programs like python or perl cannot be fooled by such a cheap and dirty ln trick. But these are tools for programmers, so more intelligence is okay for such programs. :D :celebrate3:
Cheers!
Yours Rava

Post Reply