Apps to fix disks and recover data in Linux – Part II

Apps to fix disks and recover data in Linux - Part II

Apps to fix disks and recover data in Linux – Part II

A few hours ago, we offered you a great Part I of this publication whose theme or objective is to learn about applications or programs for «check and fix disks and recover data on any GNU/Linux operating system», Windows and macOS. And since, in it we focus on the GUI type, that is, graphical for use on the desktop, In this one we will focus on the CLI type, that is, for the terminal (Console).

So, below we will show you some very modern and well-known, At the end, 2 of them that, although old, are still functional and available, in most GNU/Linux Distros repositories.

Tips to check and fix disks and recover data in Linux

Tips to check and fix disks and recover data in Linux

But, before starting to discuss each of the most basic CLI type software tools to achieve «check and fix disks and recover data on any GNU/Linux operating system», we recommend you explore the previous related post of this same topic, at the end of it:

Tips to check and fix disks and recover data in Linux
Related article:
Apps to fix disks and recover data in Linux – Part I

Essential CLI Apps to Fix Disks and Recover Data on Linux

Essential CLI Apps to Fix Disks and Recover Data on Linux

fsck y E2Fsck

fsck

Fsck and E2Fsck are 2 different software utilities with basically the same goal. Meanwhile, the first can be used by installing the 'util-linux' package, the second can be used by installing the package 'e2fsprogs'.

E2Fsck

In the case of fsck, this allows check and optionally repair one or more types of Linux file systems by using their corresponding device names, mount points, file system label or UUID specifier, and a parallel approach, to reduce the total amount of time needed to verify them all. While, in the case of E2Fsck, this does basically the same thing, but focused only on the ext2, ext3 and ext4 file systems. And especially, for ext3 and ext4 file systems that use Journal, to handle errors that occur when closing inappropriately or suddenly.

Related article:
Tips: More than 400 commands for GNU / Linux that you should know 😀

TestDisk and PhotoRec

TestDisk

Meanwhile, TestDisk is a partition scanner and disk recovery tool, PhotoRec It is limited to being a file recovery tool. That is, both software utilities are from the same developer and the second is integrated into the first. And while TestDisk checks partition and boot sectors of disks thus, recovering lost partitions; PhotoRec focuses on being a file data recovery software tool ideal for recovering lost images from a digital camera memory or even hard drives. Although, it is also useful for searching for non-audio/video headers, and recovering files of that type.

PhotoRec

In addition, TestDisk is ideal for recover lost data on numerous file systems, such as: NTFS, FAT12, FAT16, FAT32, exFAT, ext2, ext3, ext4, btrfs, BeFS, CramFS, HFS, JFS, Linux Raid, Linux Swap, LVM, LVM2, NSS, ReiserFS, UFS, XFS. While, PhotoRec includes recovery support for over 440 file formats, including JPG/PNG files, and MS Office and OpenOffice formats. And to learn how to use it, we recommend directly exploring its Official website and official documentation.

Related article:
Recover deleted files easily with Photorec from the console

BadBlocks

BadBlocks

BadBlocks is a terminal utility (CLI) used to search for damaged or bad blocks on a disk device or storage device (usually on a disk partition), through the special file corresponding to it. For example: /dev/sda1. And it can be indicated, or not, from which disk sector to start and end the diagnosis and repair.

In addition, To use it you must have the e2fsprogs package installed, which provides management support for the ext2, ext3 and ext4 file systems, which are the main types of file systems used for hard drives in Debian and other Linux systems. That is, this package includes and provides users with terminal utilities to create, review and maintain file systems based on ext2, ext3 and ext4. While, to learn how to use it you can explore its section in Spanish within the Arch Wiki.

Related article:
Repair sectors and recover a hard disk (HDD) in Linux

Scapel y Foremost

Scalpel

Scalpel is an old computer forensics program still in use, suitable for recovering lost files by reading a database of header and footer definitions, and is capable of extracting matching files from a set of image files or device files without format. It is file system independent and is capable of working on FAT16, FAT32, exFAT, NTFS, Ext2, Ext3, Ext4, JFS, XFS, ReiserFS, raw partitions, and more file systems. Basically, it is a complete rewrite of the older Foremost 0.69 app, but it is still useful for both digital forensic investigations and file recovery.

Foremost

Foremost is an old computer forensics program still in use, ideal for recovering lost files based on their headers, footers and internal data structures. Therefore, it is ideal for working on disk image files, such as those generated by dd, Safeback, Encase, among others; or directly on a unit. Headers and footers can be specified using a configuration file, or you can use command line switches to specify built-in file types. These built-in types analyze the data structures of a given file format, allowing for more reliable and faster recovery.

Having reached this point, we invite you to visit the great Arch Wiki, in case you want to know more about programs and utilities for file recovery. And in future installments (parts), we hope to delve into each of the CLI tools mentioned here, to teach in detail how to use them.

SystemRescue: New version 8.0 available from March 2021
Related article:
SystemRescue: New version 8.0 available from March 2021

Summary image for post 2024

Summary

In summary, we hope that, as with the first part of this publication, this small guide to CLI apps focused on allowing the «check and fix disks and recover data on any GNU/Linux operating system» or others such as Windows and macOS, allows you to successfully face and solve these tasks. And if you know of any other CLI software tool ideal for this objective, we invite you to mention it via comments, for the benefit of everyone, and thus continue contributing with the dissemination and massification of everything related to the Linuxverse.

Lastly, remember visit our «homepage» en español. Or, in any other language (just by adding 2 letters to the end of our current URL, for example: ar, de, en, fr, ja, pt and ru, among many others) to find out more current content. Additionally, we invite you to join our Official Telegram channel to read and share more news, guides and tutorials from our website. And also, the next Alternative Telegram channel to learn more about the Linuxverse in general.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.