How to recover files from a damaged partition and then remove it?

Asked by Jane Morrissey

I unwisely used KleanSweep to clean my computer and didn't back up the files. I was running Ubuntu 9.10. When trying to boot after using KleanSweep, I got the message "Filesystem check failed, etc...." I didn't know how to fix that, so I used a relative's computer to burn a new Ubuntu CD (new version 10.04). I installed the new version on my computer alongside the old version. I thought that would allow me to access my saved documents, but it didn't. I would like to be able to recover my documents. Any suggestions? Thank you very much.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gparted Edit question
Assignee:
No assignee Edit question
Solved by:
wojox
Solved:
Last query:
Last reply:
Revision history for this message
wojox (wojox) said :
#1

Boot the Live-CD and "Try without installing"

Mount the partition you want to recover your files from.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Why do you not have a backup!?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Please boot from your installed Ubuntu 10.04 and then open a Terminal from the menu Applications->Accessories->Terminal and type:

sudo fdisk -l

give your user password when requested, you don't see nothing when you type it, then press enter.

copy and paste here the command result here.

Revision history for this message
Jane Morrissey (jmorrissey1) said :
#4

Dear Wojox,

Can you give me instructions on how to mount the partition? Thank you.

Revision history for this message
Best wojox (wojox) said :
#5

After you boot off the Live-CD, you should be able to open "Places" in the top panel and select the partition you want to rescue your files from.

Marcobra's plan would work even better. Same idea. When you boot your new 10.04 partition you should be able to open "Places" and select the other partition.

Revision history for this message
Jane Morrissey (jmorrissey1) said :
#6

Thank you Wojox and Marcobra. I found my files. Now I would like to delete Ubuntu 9.1. Is that a good idea? I figure I don't need two operating systems and that 9.1 is just taking up space. How do I do that?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

Still need info to help you better...

Please boot from your installed Ubuntu 10.04 and then open a Terminal from the menu Applications->Accessories->Terminal and type:

sudo fdisk -l

give your user password when requested, you don't see nothing when you type it, then press enter.

copy and paste here the command result here.

Revision history for this message
Jane Morrissey (jmorrissey1) said :
#8

Thank you Marcobra.

Here is my result. It didn't ask me for a password. Also, I have another problem. I mistakenly deleted some of the files I found earlier. Is there a way to recover them?

subodiemorrissey@bodiemorrissey-desktop:~$ sudo fdisk -l

Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xddb3ddb3

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 1804 14488425+ 83 Linux
/dev/sda2 1804 2434 5062530 5 Extended
/dev/sda5 2328 2434 859446 82 Linux swap / Solaris
/dev/sda6 1804 2298 3962880 83 Linux
/dev/sda7 2298 2327 238592 82 Linux swap / Solaris

Partition table entries are not in disk order
bodiemorrissey@bodiemorrissey-desktop:~$

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#9

We must see the main partition of your installed Ubuntu please give the result of this terminal commands:

mount

and

df -h

Revision history for this message
delance (olivier-delance) said :
#10

1) How to delete 1st installation.
As you have two Ubuntu installed, you have two "/boot" partition. This partition is used in boot-loading process. In 2nd installation, the first step of boot-loading (which is in first sector of disk) "should" use the new boot partition, the one in sda6 where you probably have 2nd installation. But I'm not so sure.
To test this hypothesis, a way is going in sda1, localize file /boot/grub/grub.cfg and to rename it. After you have to check if you are able to reboot. If not, you'll have to boot on Ubuntu CD and restore previous name of file.
2) Also, I have another problem. I mistakenly deleted some of the files I found earlier. Is there a way to recover them?
Where were these files and how did you delete them ?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#11

I'd just like to add (before I unsubscribe) that this WHOLE thing could be avoided if you had a backup. You have learned their value the hardest way possible and unfortunately its the way most people choose to learn.

Good luck

Revision history for this message
delance (olivier-delance) said :
#12

Yes, I have a backup of all my disks (including external one).

Revision history for this message
Jane Morrissey (jmorrissey1) said :
#13

Thank you for your help everyone. Here is more information.

bodiemorrissey@bodiemorrissey-desktop:~$ mount
/dev/sda6 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)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/bodiemorrissey/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bodiemorrissey)
/dev/sda1 on /media/11720df8-9318-4f6a-9298-185587a0344c type ext4 (rw,nosuid,nodev,uhelper=udisks)
bodiemorrissey@bodiemorrissey-desktop:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 3.8G 2.3G 1.3G 65% /
none 245M 248K 245M 1% /dev
none 249M 1.1M 248M 1% /dev/shm
none 249M 88K 249M 1% /var/run
none 249M 0 249M 0% /var/lock
none 249M 0 249M 0% /lib/init/rw
/dev/sda1 14G 6.0G 7.0G 47% /media/11720df8-9318-4f6a-9298-185587a0344c
bodiemorrissey@bodiemorrissey-desktop:~$

Also - about the deleted files. I deleted them from /dev/sda1. It's a long story.... I've tried to use the Testdisk program to recover them, but am unable to. Testdisk tells me no files can be found because there is a problem with the file system. I might try the PhotoRec program.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#14

If you have backup of data the quick way is to install gparted then using gparted unmount and delete the /dev/sda1 partition, reformat it, mount and then restore the files from backup...

---------------------------------

The "/" of working system is the /dev/sda6

and you can get access to the /dev/sda1 mounted under /media/11720df8-9318-4f6a-9298-185587a0344c

so try to recover contents using photorec ( part of the installed testdisk package )

if it doesn't works you can also try to check your filesystem

sudo umount /media/11720df8-9318-4f6a-9298-185587a0344c

sudo fsck /dev/sda1

repeat it until the filesystem will be marked as clean then try to remount it...

Revision history for this message
delance (olivier-delance) said :
#15

About recovering files, you can make with Gparted a copy of your partition on a external media. Each time you use the partition where are deleted files, you reduce the probability to recover them. And this partition is saved somewhere else, we could envisage soon to repair your OS installation. Is this partition the one which contains your "/home" directory, that you need to backup ?

Revision history for this message
Jane Morrissey (jmorrissey1) said :
#16

Thanks everyone for your help. My computer is fixed and running well. I was able to recover my files using Photorec. Then I used GParted to delete the old partition and resize my new partition.

Revision history for this message
Jane Morrissey (jmorrissey1) said :
#17

Thanks wojox, that solved my question.