TestDisk

Recover lost partitions & fix disks.

KaliParrotLinuxmedium

pkg: testdisk

TestDisk repairs partition tables and recovers deleted partitions and boot sectors.

Syntax

testdisk

Example

sudo testdisk /dev/sdb

Scans the disk to find and restore lost partitions.

Options & flags

What each switch does. Toggle them in the builder below to assemble a command.

(interactive)Menu-driven partition recovery.
(device) </dev/sdb>Disk/image to operate on.
/log <value>Write a session log.

Command builder

Tick options (and fill any values) to build a ready-to-copy command.

testdisk

Usage examples

testdisk /dev/sdb

Recover lost partitions interactively.

Advantages
  • Recovers whole partitions
  • Many filesystem types
Disadvantages
  • Can write to disk — careful
  • Text UI learning curve
Tags
#recovery#partitions

Official docs: TestDisk

Related commands

Frequently asked questions

What is TestDisk used for?
TestDisk repairs partition tables and recovers deleted partitions and boot sectors.
What is an example TestDisk command?
A common example is: sudo testdisk /dev/sdb — Scans the disk to find and restore lost partitions.
Is TestDisk part of Kali Linux?
Yes. TestDisk ships with Kali Linux (and Parrot OS). If missing, install it with: sudo apt install testdisk.
What category of security tool is TestDisk?
TestDisk is a Forensics tool with a medium-risk profile when run against a live target.

Try recon tools live

Run real scans against a domain you control, stage by stage.

Open the lab →