1

I don't know very well the partition system of Ubuntu, so I don't want to do something that can damage more the system. My, problem is the same as this one

I used Testdisk for this problem, what to do after this:

    TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 500 GB / 465 GiB - CHS 60801 255 63
     Partition               Start        End    Size in sectors
   HPFS - NTFS              0  32 33    12 223 19     204800 [R erv au syst e]
   HPFS - NTFS             12 223 20 36384 235 11  584316928
   HPFS - NTFS          36384 235 12 36485 193 60    1619968
   Linux                36485 226 30 48643 153 22  195313664
   Linux                48643 153 23 60305 234 25  187355136
>  Linux Swap           60305 234 26 60801  47 46    7956480

Correct me if I'm wrong but sda1 to sda4 represent Windows?

xubuntu xubuntu @: ~ $ sudo fdisk -l

Disk / dev / sda: 500.1 GB, 500,107,862,016 bytes
255 heads, 63 sectors / track, 60801 cylinders, total 976 773 168 sectors
Units of sectors = 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 4096 bytes
size of I / O (minimum / maximum): 4096 bytes / 4096 bytes
Disc ID: 0xa39b801b

Device Boot Start End Blocks Id. System
/ dev / sda1 * 2048 206847 102400 7 HPFS / NTFS / exFAT
/ dev / sda2 206 848 584 522 681 292 157 917 7 HPFS / NTFS / exFAT
/ dev / sda3 584 523 776 586 143 743 809 984 27 Hidden NTFS WinRE
/ dev / sda4 586 145 790 976 771 071 195 312 641 5 Scope
Partition 4 does not begin on a physical cylinder boundary.
/ dev / sda5 968 814 592 976 771 071 3978240 82 Linux swap partition / Solaris

Disk / dev / sdb: 4007 MB, 4007624704 bytes
255 heads, 63 sectors / track, 487 cylinders, sectors Total 7,827,392
Units of sectors = 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 512 bytes
size of I / O (minimum / maximum): 512 bytes / 512 bytes
Disc ID: 0x0109f674

Device Boot Start End Blocks Id. System
/ dev / sdb1 * 63 7827391 b W95 FAT32 3913664+

Disk / dev / sdc: 1041 MB, 1041628672 bytes
63 heads, 32 sectors / track, 1009 cylinders, sectors Total 2,034,431
Units of sectors = 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 512 bytes
size of I / O (minimum / maximum): 512 bytes / 512 bytes
Disc ID: 0x00000000

Device Boot Start End Blocks Id. System
/ dev / * sdc1 32 2034430 b W95 FAT32 1017199+

Here is my GParted:

GParted screenhot

I would appreciate your help because I always work in Xubuntu and I did not save my files.

EDIT: If you can't read the sudo fdisk -l, here is the screen

fdisk output

(in french) translated below

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Alba
  • 13

1 Answers1

1

I think windows just deleted the partition. so try this.

open up testdisk

sudo testdisk

select your drive. enter image description here

then select your partition table just choose what it has detected.

enter image description here

then select Analyze

enter image description here

then press enter do a quick Search.

then select the Linux partition like what i have done below. then press enter then press enter again to do a deeper Search.

enter image description here

the process should look like this it will take some time.

enter image description here

when thats done use your up and down arrow keys to select different partitions press p to see the file list if nothing shows press q to edit and select another partition.

enter image description here

when you come across the partition with your data on it copy all your important data to another location never back up to the same drive. back up by selecting files fodders by pressing shift and : when your done selecting press c to copy the selected files. or press a

enter image description here

when you have found a location where you want to save your data. press c and your data will be coyed to that location.

enter image description here enter image description here

Edit

What to do after the data is backed up.

Open up a terminal and type in

sudo parted /dev/sda 

Type in unit s

    GNU Parted 2.3
    Using /dev/sda
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) unit s

Then type in rescue (put the first sector of the extended partition here.) and then (put the END sector here of the extended partition)

in Gpart the start sector and end sector can be found by right clicking the extended partition and clicking information

enter image description here

example or the rescue command.

(parted) rescue 21239808 31475711 

press enter. then it scan the partition table. when it finds the partition it will ask you if you want to add it to the partition table. Type in yes and you should have the partition back and all your data.

then you want to run these commands to get it booted again.

sudo grub-install /dev/sda 

sudo update-grub /dev/sda

let me know how it goes.

Neil
  • 4,475
  • 3
  • 22
  • 34
  • @Alba you need to first sector and end sector of /dev/sda4 the extended partition. by your sudo fdisk -l screen shot. it looks like. the start sector is 586145790 end sector is 976771071 your command should look like this. rescue 586145790 976771071 – Neil Nov 01 '15 at 23:52
  • @Alba run Gpart and press Ctrl + R see if it comes up. – Neil Nov 02 '15 at 00:05
  • I can't delet the directory home ... I try to move t in other usb .. I don't have enough space in this live usb for grub install or update command – Alba Nov 02 '15 at 00:07
  • @Alba mount /dev/sda6 sudo mount -t ext4 /dev/sda6 /mnt cd /mnt ls – Neil Nov 02 '15 at 00:28
  • run these commands sudo grub-install /dev/sda sudo update-grub /dev/sda give the output of sudo update-grub /dev/sda and reboot and boot from HDD – Neil Nov 02 '15 at 00:53
  • I don't know any thing else you can do to recover you Linux OS sorry – Neil Nov 02 '15 at 01:11
  • Don't know why he return me this but I find this solution but I must restart to apply it ... mkdir -p /tmp/newroot mount -t ext4 /dev/sda3 /tmp/newroot mount --bind /proc /tmp/newroot/proc mount --bind /dev /tmp/newroot/dev mount --bind /sys /tmp/newroot/sys chroot /tmp/newroot/ /usr/sbin/update-grub /usr/sbin/grub-install /dev/sda exit send me a chat message maybe I can find the solution of this later and continue in message cause this post is very too long – Alba Nov 02 '15 at 01:13
  • I'll try to restore some important files with testdisk again ... I wish that the mout we done doesn't delet some files... – Alba Nov 02 '15 at 02:04
  • Finally I was able to recover my important files on home with Testdisk. – Alba Nov 03 '15 at 01:49