File carving tools

Chưa phân loại
In computers, file carving consists of recovering and rebuilding, reconstructing or reassembling fragmented files after a disk was formatted, its filesystem or partition corrupted or damaged or the metadata of a file removed. All files contain metadata, metadata means: “data that provides information about other data”. Among more information, files metadata contains the location and structure of a file within the filesystem and physical blocks.  File Carving consists of bringing back files even if their metadata with the information of their location within the filesystem isn’t available.

This article describes some of the most popular available File Carving Tools for Linux including PhotoRec, Scalpel, Bulk Extractor with Record Carving, Foremost and TestDisk.

PhotoRec Carving Tool

Photorec allows you to recover media, documents and files from hard drives, optical disks or camera memories. PhotoRec tries to find the file data block from the superblock for Linux filesystems or from the volume boot record for WIndows filesystems. If not possible the software will check block by block comparing it with a PhotoRec’s database. It checks for all blocks while other tools only check for the start or end of a header, that’s why PhotoRec’s performance isn’t the best one when compared with tools using different carving methods like block header search, yet PhotoRec is perhaps the file carving tool with better results in this list, if time isn’t a problem PhotoRec is the first recommendation.

If PhotoRec manages to gather the file size from the file header it will compare the result of recovered files with the header discarding incomplete files. Yet PhotoRec will leave partial recovered files when possible, for example in the case of media files.

PhotoRec is Open Source and it is available for Linux, DOS, Windows and MacOS, you can download it for free from its official website at

Scalpel Carving Tool:

Scalpel is another alternative for file carving available for both Linux and Windows OS. Scalpel is part of The Sleuth Kit described at  Live Forensic Tools article. It is faster than PhotoRec and it is among the faster file carving tools but without the same performance of PhotoRec. It searches on header and footers blocks or clusters. Among its features there are multithreading for multicore CPUs, asynchronous I/O increasing performance. Scalpel is used both in professional forensics and data recovery, it is compatible with all filesystems.

You can get Scalpel for carving files by running in the terminal:

# git clone

Enter the installation directory with the command cd (Change Directory):

# cd scalpel

To install it run:

# ./bootstrap
#  ./configure
# make

On Debian based Linux distributions such as Ubuntu or Kali you can install scalpel from the apt package manager by running:

# sudo apt install scalpel

Configuration files may be at  /etc/scalpel/scalpel.conf’ or  /etc/scalpel.conf depending on your Linux distribution. You can find Scalpel options in the man page or online at

In conclusion Scalpel is faster than PhotoRect which has bette results when recovering files, the next tool is BulkExtractor With Record Carving.

Bulk Extractor with Record Carving Tool:

Like the tools previously mentioned Bulk Extractor with Record Carving is multi thread, it is an enhancement of the previous version “Bulk Extractor”. It allows to recover any kind of data from filesystems, disks and memory dump. Bulk Extractor with Record Carving can be used to develop other file recovery scanners. It supports additional plugins which can be used for carving, yet not for parsing. This tool is available both in text mode to be used from terminal and a graphical user friendly interface.

Bulk Extractor with Record Carving can be downloaded from its official website at

Foremost Carving Tool:

Foremost is perhaps, together with PhotoRect one of the most popular carving tools available for Linux and in the market in general, a curiosity is it was initially developed by the US Air Force. Foremost has a faster performance when compared with PhotoRect but PhotoRec is better recovering files. There is no graphical environment forForemost, it is used from the terminal and searches on headers, footers and data structure.  It is compatible with images of other tools such as dd or Encase for Windows.

Foremost supports any type of file carving including jpg, gif, png, bmp, avi, exe, mpg, wav, riff, wmv, mov, pdf, ole, doc, zip, rar, htm, and cpp. Foremost comes by default in Forensic distributions and security oriented like Kali Linux with a suite for Forensic tools.

On debian systems Foremost can be installed using the APT package manager, on Debian or based Linux distribution run:

# sudo apt install foremost

Once installed check the man page for available options or check online at
Despite being a text mode program Foremost is simple to use for file carving.


TestDisk is part of PhotoRec, it can fix and recover partitions, FAT32 boot sectors, it can also fix NTFS and Linux ext2,ext3,ext3 filesystems and restore files from all these partition types. TestDisk can be used both by experts and new users making recovering files process easy for domestic users, it is available for Linux, Unix (BSD and OS), MacOS, Microsoft Windows in all its versions and DOS.

TestDisk can be downloaded from its official website (PhotoRec’s one) at

PhotoRect has a testing environment for you to practise file carving, you can access at

Most of tools listed above are included in most popular Linux distributions focused on computer forensics such as Deft/Deft Zero live forensic tool, CAINE live forensic tool and probably on Santoku live forensic too, check this list for more information

I hope you found this tutorial on File Carving Tools useful. Keep following LinuxHint for more tips and updates on Linux and networking.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

How to Use Manjaro Hardware Detection Tool

Manjaro is based on the well-known Arch Linux. Among all the facilities, Manjaro Hardware Detection Tool is a unique one....

Graph Databases and Their Use Cases

To meet the demands of our connected world where massive amounts of data need to be represented in real-time and with lightning...

How to Configure dnsmasq on CentOS 7

dnsmasq is a very lightweight and simple DNS server. dnsmasq can be configured to be a DNS server and a DHCP server. In...
Bài Viết

Bài Viết Mới Cập Nhật

Huớng dẫn dùng proxy cho ios, iphone 2023

Cách gắn set proxy cho điện thoại android, oppo, giả lập android, Ldplayer Bằng Proxydroid

Mua Proxy Socks5 VN Chơi Game Gia Lập Tăng Cường Trải Nghiệm Chơi Game

Mua Proxy Mỹ, Us Nuôi Tài Khoản Etsy, eBay Tìm Hiểu Về Mua Proxy Mỹ tại

Mua Proxy Game – Giải pháp tuyệt vời cho việc chơi game trên mạng mà không bị giới hạn về vị trí địa lý