Bodhi Linux Forums: [Solved] How to use extundelete in Bodhi? - Bodhi Linux Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Solved] How to use extundelete in Bodhi?

#1 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 01:36 AM

I erased a calc file (Libre Office) with "shift+delete" containing the count of my hours of work and i need to recover it... :(

I've downloaded extundelete-0.2.0 and tried to follow the instructions from the READ ME file and also these instructions: http://www.switchroo...ext4-filesystem
However, following the instructions from the READ ME file, i couldn't install extundelete (i think i wasn't able to found all the files needed to compile and install extundelete), and following the instructions from the above link, i get some error related to yum (command not found).

Can someone please help me install extundelete? Thanks a lot!

Ps: I'll try to follow thes instructions http://www.techienot...s-in-linux.html
0

#2 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 02:05 AM

View PostAlexC, on 16 March 2012 - 01:36 AM, said:

Ps: I'll try to follow thes instructions http://www.techienot...s-in-linux.html


Following the instructions for Ubuntu, i always get this error...

meo@meo-HUMMER:/tmp/extundelete-0.2.0$ sudo make
make -s all-recursive
Making all in src
In file included from /usr/include/bits/errno.h:25,
                 from /usr/include/errno.h:36,
                 from /usr/include/c++/4.4/cerrno:43,
                 from extundelete.cc:69:
/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
extundelete.cc: In function ‘int main(int, char**)’:
extundelete.cc:510: error: ‘EOVERFLOW’ was not declared in this scope
extundelete.cc: In function ‘int examine_fs(struct_ext2_filsys*)’:
extundelete.cc:1568: error: ‘ENOENT’ was not declared in this scope
extundelete.cc:1576: error: ‘EEXIST’ was not declared in this scope
make[2]: *** [extundelete-extundelete.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

0

#3 User is offline   Hendra 

  • Member
  • Group: Members
  • Posts: 648
  • Joined: 17-April 11
  • LocationBalikpapan City, East Borneo, Indonesia

Posted 16 March 2012 - 02:38 AM

have you run
./configure
yet?

[edit]

it also need these packages installed, just as tutorial said
- build-essential
- e2fslibs
- e2fslibs-dev
- ext3grep
0

#4 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 12:12 PM

View PostHendra, on 16 March 2012 - 02:38 AM, said:

have you run
./configure
yet?

[edit]

it also need these packages installed, just as tutorial said
- build-essential
- e2fslibs
- e2fslibs-dev
- ext3grep


Thanks for helping.
Yes i did, and i also installed those packages. Here's the output til the error occurs (i've followed the instructions in this page http://www.techienot...s-in-linux.html)

meo@meo-HUMMER:~$ sudo apt-get install build-essential e2fslibs e2fslibs-dev ext3grep
[sudo] password for meo: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
e2fslibs is already the newest version.
e2fslibs-dev is already the newest version.
ext3grep is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
meo@meo-HUMMER:~$ cd /tmp
meo@meo-HUMMER:/tmp$ sudo wget http://downloads.sourceforge.net/project/extundelete/extundelete/0.2.0/extundelete-0.2.0.tar.bz2
--2012-03-16 11:55:39--  http://downloads.sourceforge.net/project/extundelete/extundelete/0.2.0/extundelete-0.2.0.tar.bz2
Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://freefr.dl.sourceforge.net/project/extundelete/extundelete/0.2.0/extundelete-0.2.0.tar.bz2 [following]
--2012-03-16 11:55:39--  http://freefr.dl.sourceforge.net/project/extundelete/extundelete/0.2.0/extundelete-0.2.0.tar.bz2
Resolving freefr.dl.sourceforge.net... 88.191.250.132
Connecting to freefr.dl.sourceforge.net|88.191.250.132|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 97851 (96K) [application/x-bzip2]
Saving to: `extundelete-0.2.0.tar.bz2'

100%[=====================================>] 97,851       124K/s   in 0.8s    

2012-03-16 11:55:40 (124 KB/s) - `extundelete-0.2.0.tar.bz2' saved [97851/97851]

meo@meo-HUMMER:/tmp$ sudo tar jxvf extundelete-0.2.0.tar.bz2
tar: Record size = 8 blocks
extundelete-0.2.0/
extundelete-0.2.0/README
extundelete-0.2.0/acinclude.m4
extundelete-0.2.0/configure.ac
extundelete-0.2.0/aclocal.m4
extundelete-0.2.0/Makefile.am
extundelete-0.2.0/Makefile.in
extundelete-0.2.0/config.h.in
extundelete-0.2.0/configure
extundelete-0.2.0/compile
extundelete-0.2.0/depcomp
extundelete-0.2.0/install-sh
extundelete-0.2.0/missing
extundelete-0.2.0/LICENSE
extundelete-0.2.0/autogen.sh
extundelete-0.2.0/src/
extundelete-0.2.0/src/Makefile.am
extundelete-0.2.0/src/Makefile.in
extundelete-0.2.0/src/extundelete.cc
extundelete-0.2.0/src/block.c
extundelete-0.2.0/src/insertionops.cc
extundelete-0.2.0/src/block.h
extundelete-0.2.0/src/extundelete.h
extundelete-0.2.0/src/extundelete-priv.h
extundelete-0.2.0/src/jfs_compat.h
extundelete-0.2.0/src/kernel-jbd.h
meo@meo-HUMMER:/tmp$ cd /tmp/extundelete-0.2.0
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ ./configure
Configuring extundelete 0.2.0
Writing generated files to disk
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ sudo make
make -s all-recursive
Making all in src
In file included from /usr/include/bits/errno.h:25,
                 from /usr/include/errno.h:36,
                 from /usr/include/c++/4.4/cerrno:43,
                 from extundelete.cc:69:
/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
extundelete.cc: In function ‘int main(int, char**)’:
extundelete.cc:510: error: ‘EOVERFLOW’ was not declared in this scope
extundelete.cc: In function ‘int examine_fs(struct_ext2_filsys*)’:
extundelete.cc:1568: error: ‘ENOENT’ was not declared in this scope
extundelete.cc:1576: error: ‘EEXIST’ was not declared in this scope
make[2]: *** [extundelete-extundelete.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ 


In extundelete folder there's a READ ME file that says: "To compile and install this program, you should first
install the binary and development packages for
e2fsprogs and e2fslibs. You must also have a C++
compiler and a make utility to compile extundelete."

I already have e2fsprogs:
meo@meo-HUMMER:~$ sudo apt-get install e2fsprogs
[sudo] password for meo: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
e2fsprogs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
meo@meo-HUMMER:~$ 


But i don't know if i have a C++ compiler...

Thanks.
0

#5 User is offline   Hendra 

  • Member
  • Group: Members
  • Posts: 648
  • Joined: 17-April 11
  • LocationBalikpapan City, East Borneo, Indonesia

Posted 16 March 2012 - 01:28 PM

build-essential should install C++ compiler, g++ if I'm not mistaken
that error message shows that it try to compile but missing something, probably a library, but I can't figure out what's missing from the message.

this site http://packages.ubun...ric/extundelete
shows that you need these for extundelete to work, perhaps making sure you install them before trying sudo make again?

e2fslibs (>= 1.41.0)
    ext2/ext3/ext4 file system libraries 

libc6 (>= 2.4)
    Embedded GNU C Library: Shared libraries
    also a virtual package provided by libc6-udeb 

libcomerr2 (>= 1.01)
    common error description library 

libgcc1 (>= 1:4.1.1)
    GCC support library 

libstdc++6 (>= 4.6)
    GNU Standard C++ Library v3 


You could also google "extundelete ubuntu" since we are based on their release. It helps alot
0

#6 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 01:59 PM

View PostHendra, on 16 March 2012 - 01:28 PM, said:

build-essential should install C++ compiler, g++ if I'm not mistaken
that error message shows that it try to compile but missing something, probably a library, but I can't figure out what's missing from the message.

this site http://packages.ubun...ric/extundelete
shows that you need these for extundelete to work, perhaps making sure you install them before trying sudo make again?

e2fslibs (>= 1.41.0)
    ext2/ext3/ext4 file system libraries 

libc6 (>= 2.4)
    Embedded GNU C Library: Shared libraries
    also a virtual package provided by libc6-udeb 

libcomerr2 (>= 1.01)
    common error description library 

libgcc1 (>= 1:4.1.1)
    GCC support library 

libstdc++6 (>= 4.6)
    GNU Standard C++ Library v3 


You could also google "extundelete ubuntu" since we are based on their release. It helps alot


Ok, seems (seeing in synaptic package manager) that i'm using:

- e2fslibs 1.41.11
- libc6 2.11.1
- libc6-dev 2.11.1
- libcomerr2 1.41.11
- libgcc1 1:4.4.3

- libstdc++6 4.5.2

When i try to update libstdc++6 (assuming that i'm using the right command in the terminal, i'm a noob) i get this error:
meo@meo-HUMMER:~$ sudo apt-get upgrade libstdc++6
[sudo] password for meo: 
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?


Edit: i closed all the opened windows, repeated sudo apt-get upgrade libstdc++6 and now i get
meo@meo-HUMMER:~$ sudo apt-get upgrade libstdc++6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have been kept back:
  bodhi-e17guide bodhi-quickstart libncurses5 libncursesw5 ncurses-bin
  pcmanfm python-software-properties
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.


So, seems that i can't upgrade libstdc++6 to a version >= 4.6? Maybe that's the problem?

I've googled for "extundelete ubuntu" but haven't see the same error elsewhere.

Thanks
0

#7 User is offline   Jeff 

  • Lead Developer
  • Group: Developer
  • Posts: 9599
  • Joined: 23-November 10
  • LocationBloomington, IL

Posted 16 March 2012 - 02:16 PM

Run:

sudo ln -s /usr/include/asm-generic /usr/include/asm


And then try to compile it - see if it works then.

~Jeff
0

#8 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 02:45 PM

View PostJeff, on 16 March 2012 - 02:16 PM, said:

Run:

sudo ln -s /usr/include/asm-generic /usr/include/asm


And then try to compile it - see if it works then.

~Jeff


Thanks a lot Jeff, it worked! :)

The file i lost was in my home directory. I tried to restore files from the entire partition, but i get this error:
meo@meo-HUMMER:/tmp$ extundelete /dev/sda5 --restore-all
extundelete: failed to read-only open device "/dev/sda5": Error code 13


So i tried to recover only from my home directory, where the file i erased by mistake was located, but i also get a error:
meo@meo-HUMMER:/tmp$ extundelete /home/meo --restore-all
extundelete: "/home/meo" is a directory. You need to use the raw filesystem device (or a copy thereof).
meo@meo-HUMMER:/tmp$


I really don't know where to go from here... any help? thanks again!

Here's the full output:

meo@meo-HUMMER:~$ sudo ln -s /usr/include/asm-generic /usr/include/asm
[sudo] password for meo: 
meo@meo-HUMMER:~$ cd /tmp/extundelete-0.2.0
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ ./configure
./configure: line 983: config.log: Permission denied
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ sudo ./configure
Configuring extundelete 0.2.0
Writing generated files to disk
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ sudo make
make -s all-recursive
Making all in src
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ sudo cp /tmp/extundelete-0.2.0/src/extundelete /bin/
meo@meo-HUMMER:/tmp/extundelete-0.2.0$ cd /tmp
meo@meo-HUMMER:/tmp$ extundelete /dev/sda5 --restore-all
extundelete: failed to read-only open device "/dev/sda5": Error code 13
meo@meo-HUMMER:/tmp$ extundelete /dev/sda5/home/meo --restore-all
extundelete: stat "/dev/sda5/home/meo": Not a directory
meo@meo-HUMMER:/tmp$ extundelete /home/meo --restore-all
extundelete: "/home/meo" is a directory. You need to use the raw filesystem device (or a copy thereof).
meo@meo-HUMMER:/tmp$ 

0

#9 User is offline   Elw3 

  • Group: Moderators
  • Posts: 1409
  • Joined: 06-June 11

Posted 16 March 2012 - 03:26 PM

i guess it needs to be pointed to
"/dev/sdxy" where x is drive and y partition and it needs root rights to get open (sudo). this partition cannot be the same where the sys is installed !!
but you got an mistake here, once you deleted a wrong file you need to avoid any write actions to the disk the file was in. so by installing the program the chance is hight you already overwrote the data you tried to recover.
a total different option: some office programs create safety copies in your users dir while your edit a file, checked there ?
Bad Wolf
0

#10 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 04:11 PM

View PostElw3, on 16 March 2012 - 03:26 PM, said:

i guess it needs to be pointed to
"/dev/sdxy" where x is drive and y partition and it needs root rights to get open (sudo). this partition cannot be the same where the sys is installed !!
but you got an mistake here, once you deleted a wrong file you need to avoid any write actions to the disk the file was in. so by installing the program the chance is hight you already overwrote the data you tried to recover.
a total different option: some office programs create safety copies in your users dir while your edit a file, checked there ?


Thanks for helping Elw3. In my user folder (home/ meo) i can't find any libreoffice folder. I did ctrl+h to see hidden files.

In the README file says that i should find something similar to "/dev/sda3 on /home type ext3 (rw)":

 typical usage scenario is presented below.  Note that some
of the commands below require special permissions to
complete.  Adding 'sudo ' before the command is one way to
ensure you have the necessary permissions.  Assume you
have deleted a file called /home/user/an/important/file.
Also assume the output of the 'mount' command shows this
line (among others):
/dev/sda3 on /home type ext3 (rw)
This line shows that the /home directory is on the partition
named /dev/sda3, so then run:
umount
 /dev/sda3
and check that it is now unmounted by running the mount
command again and seeing it is not listed.


But when i type "sudo mount" i get this output:

meo@meo-HUMMER:~$ sudo mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/dev/sda1 on /media/sda1 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda2 on /media/sda2 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
gvfs-fuse-daemon on /home/meo/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=meo)
meo@meo-HUMMER:~$ 

0

#11 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 06:15 PM

Trying forecast. Is running for about 1 hour. Followed the instructions here: http://mikemacd.word...ed-media-files/

sudo apt-get install foremost


mkdir ~/recovered


sudo foremost /dev/sda5 -o /home/meo/recovered

0

#12 User is offline   Elw3 

  • Group: Moderators
  • Posts: 1409
  • Joined: 06-June 11

Posted 16 March 2012 - 08:47 PM

your mount says "/dev/sda5 on / type ext4"
again its a bad idea to run extundelete on the same partition the sys is installed to , however good luck with the other program but dont have too high hopes.
Bad Wolf
0

#13 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 09:51 PM

View PostElw3, on 16 March 2012 - 08:47 PM, said:

your mount says "/dev/sda5 on / type ext4"
again its a bad idea to run extundelete on the same partition the sys is installed to , however good luck with the other program but dont have too high hopes.


I was able to recover the file :)

Neither foremost or scalpel are able to recover Libre Office files by default, so i followed the instructions here:
http://www.atareao.e...icelibreoffice/
Similar instructions can be found here, in English: http://ubuntuforums....d.php?p=9814022

to configure scalpel to look for Libre Office Files. It worked perfectly! :)
0

#14 User is offline   Elw3 

  • Group: Moderators
  • Posts: 1409
  • Joined: 06-June 11

Posted 16 March 2012 - 11:08 PM

i am deeply impressed now, seriously ...so if i ever forget to create a safety copy ill remember this thread.
Bad Wolf
0

#15 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 16 March 2012 - 11:31 PM

View PostElw3, on 16 March 2012 - 11:08 PM, said:

i am deeply impressed now, seriously ...so if i ever forget to create a safety copy ill remember this thread.


I'm glad it worked, i really needed the file. I've done a backup already.

However i noticed now that i only have 10% of free disk space... and i think that i had much more this morning :/

I erased all the output files (as far as i know), removed most software i installed today and i still have very few space in the drive. Maybe is there a way to list the files created today? thanks
0

#16 User is offline   Elw3 

  • Group: Moderators
  • Posts: 1409
  • Joined: 06-June 11

Posted 17 March 2012 - 12:14 AM

if your erased them already i would check the partition for errors might be possible its seeing the erased stuff as some kind of ghost file
Bad Wolf
0

#17 User is offline   AlexC 

  • Member
  • Group: Members
  • Posts: 95
  • Joined: 04-September 11

Posted 17 March 2012 - 12:20 AM

View PostElw3, on 17 March 2012 - 12:14 AM, said:

if your erased them already i would check the partition for errors might be possible its seeing the erased stuff as some kind of ghost file


I think i've found the problem Elw3, but i'll open another thread and mark this one as solved.

Thanks to everyone for helping!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users