Partition table is describes the division of your disks into partitions. Each partition is then formatted into filesystems such as ext4, exFAT and NTFS. When a partition is deleted, only the partition table is altered while the filesystems remain intact.

A deleted partition could be recovered by scanning the disk for filesystems and to then recreate the partition table based on the found filesystems.

A lost or deleted partition could be restored using testdisk application in Linux and the operation could only be performed on unmounted filesystems. This could be done by using live Linux distribution or by using installer disk such as the Ubuntu installer.

Recover lost or deleted partition using Linux:

  1. Boot into live Linux distribution or by using Linux installer disk such as ubuntu.
  2. Get into Live CD mode if available if booting from installer disk.

    For Ubuntu installer, click on the Try Ubuntu button.

  3. Launch Terminal.

    If no Live CD mode available, press <ctrl> + <alt> + <f2> keys to get to the terminal.

  4. List available disks in the systems and identify the disk with the deleted or lost partition.
    $ lsblk
    NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    loop0   7:0    0  1.9G  1 loop /rofs
    loop1   7:1    0 89.3M  1 loop /snap/core/6673
    loop2   7:2    0 53.7M  1 loop /snap/core18/941
    loop3   7:3    0  151M  1 loop /snap/gnome-3-28-1804/31
    loop4   7:4    0    4M  1 loop /snap/gnome-calculator/406
    loop5   7:5    0 14.8M  1 loop /snap/gnome-characters/254
    loop6   7:6    0 1008K  1 loop /snap/gnome-logs/61
    loop7   7:7    0  3.7M  1 loop /snap/gnome-system-monitor/77
    loop8   7:8    0 35.3M  1 loop /snap/gtk-common-themes/1198
    sda     8:0    0   20G  0 disk
    sr0    11:0    1    2G  0 rom  /cdrom
  5. Enable additional repository if required.
    $ sudo add-apt-repository universe
    'universe' distribution component enabled for all sources.
    ##### snipped
  6. Install testdisk using package installer if not readily available.
    $ sudo apt install --assume-yes testdisk
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      testdisk
    0 upgraded, 1 newly installed, 0 to remove and 316 not upgraded.
    Need to get 345 kB of archives.
    ##### snipped
  7. Launch testdisk.
    $ sudo testdisk
  8. Use arrow key to select No Log and press <enter> to proceed.
  9. Select the disk with the lost or deleted partition and press <enter> to proceed.
  10. Select partition table type of the disk and press <enter>.

    Intel is the most common partition type with EFI GPT starting to gain popularity.

  11. Press <enter> to start analysing the disk.
  12. Press <enter> again to search for possible partitions on the selected disk.
  13. Select found partition and press <enter> to continue.
  14. Select Write and press <enter> to update the partition table.
  15. Press Y to confirm updating partition table.
  16. Press <enter> on Ok to proceed.
  17. Select Quit and press <enter> to return to disk selection menu.
  18. Select ''Quit' ' and press enter to quit the program.
  19. Check partitions again to confirm that the lost partition table is recovered.
  20. Reboot your machine.
    $ sudo reboot

    .

Discuss the article:

Share your thoughts, suggest corrections or just say Hi. Login not required.

Share!