How to use systemrescue to clean hard drive​?

SystemRescue (formerly known as SystemRescueCd) is a Linux-based system administration tool designed to help you repair and recover data from your hard drive, troubleshoot problems, and clean drives securely. 

Overview of SystemRescue

SystemRescue is a powerful tool that provides various utilities for managing and repairing disks. It’s especially useful in situations where a regular operating system environment isn’t accessible, such as in cases of corrupted or inaccessible file systems, failed partitions, or during operating system installation.

SystemRescue is live system software, meaning you run it directly from a USB stick, CD, or DVD without needing to install it on your hard drive. It includes several utilities such as:

GParted for partition management.

Partimage and ddrescue for disk cloning and backup.

Shred for secure data deletion.

Fsck and e2fsck for file system repair.

You can perform a variety of tasks with SystemRescue, but in this tutorial, we will focus on how to use it for cleaning a hard drive.

Why Clean a Hard Drive?

There are multiple reasons why you might need to clean a hard drive:

Selling or Donating a Drive: If you’re preparing to sell, give away, or recycle an old hard drive, you should clean it to prevent unauthorized access to your data.

Fixing Corrupted Data: Sometimes, cleaning a drive by removing partitions and creating new ones can help resolve issues such as corrupted file systems.

Reinstalling the Operating System: Before performing a fresh OS installation, it’s a good idea to clean the drive to ensure no old files or settings remain that could interfere with the new OS.

Securing Sensitive Data: If you want to permanently erase sensitive data beyond recovery, it’s necessary to wipe the drive securely.

Preparing to Use SystemRescue

Before you begin, ensure you have the following:

SystemRescue Boot Media: Download the SystemRescue ISO file from the official website (https://www.system-rescue.org/) and create a bootable USB drive, CD, or DVD.

For USB: Use a tool like Rufus (Windows) or dd (Linux) to create a bootable USB drive.

Backup Your Data: If you have important data on the hard drive that you want to recover or keep, ensure you back it up to an external storage device before proceeding.

Access to the Command Line: SystemRescue provides both a graphical interface (via GParted) and a command-line interface for more advanced tasks. You’ll need a terminal for most of the cleaning operations.

Booting Into SystemRescue

Insert the bootable USB or CD/DVD into the computer that you wish to clean.

Reboot the computer and access the boot menu (usually by pressing F12. F2. ESC, or DEL depending on your machine).

Select the SystemRescue boot device and press Enter.

Once SystemRescue boots, you will be presented with a terminal and a desktop environment if you choose the graphical version.

Identifying the Hard Drive to Clean

Before cleaning, you need to identify the correct hard drive. Use the lsblk command to list all block devices (hard drives, partitions, USB drives, etc.):

bash

lsblk

This will show a list of all available storage devices and partitions. Look for the device you want to clean (usually something like /dev/sda, /dev/sdb, or /dev/nvme0n1 for NVMe drives). Make sure you identify the correct device by checking its size and any partitions associated with it.

Step 1: Unmount Partitions

If the hard drive has any mounted partitions, you will need to unmount them before you can clean it. Use the umount command:

bash

umount /dev/sda1 umount /dev/sda2

If the partitions are in use or you encounter an error, you may need to boot into a live environment to safely unmount them.

Step 2: Securely Wipe the Drive (Optional)

If you want to permanently delete all data on the hard drive, you’ll need to securely erase it. One common tool in SystemRescue for secure wiping is the shred command. The shred command overwrites the drive with random data multiple times to prevent recovery.

Here’s how to securely wipe the entire drive:

bash

shred -v -n 3 /dev/sda

Explanation of the flags:

-v: Verbose mode (displays progress).

-n 3: Overwrites the drive 3 times (this is a good balance between security and time).

/dev/sda: The target device (replace with the correct device name for your drive).

This process can take a significant amount of time depending on the size of the drive.

Step 3: Create New Partitions

Once the drive is wiped, you may want to create new partitions. You can use GParted (a graphical partition manager) or parted (command-line tool) for this task. Here, we will use GParted to create a new partition table:

Launch GParted from the SystemRescue menu.

Select the correct hard drive from the drop-down menu in the top-right corner of the GParted window.

To create a new partition table, go to Device > Create Partition Table.

Choose a partition table type (usually GPT for newer systems or MBR for older systems).

Click Apply.

Now, you can create a new partition on the hard drive. Right-click on the unallocated space and select New.

Choose the file system (e.g., ext4 for Linux systems, NTFS for Windows) and set the partition size.

Once you’ve configured the partition, click Apply to create the partition.

Step 4: Format the New Partition

After creating a partition, it’s time to format it with the desired file system.

Right-click on the new partition and select Format to.

Choose the appropriate file system (e.g., ext4. NTFS, FAT32).

Click Apply.

Alternatively, you can use the mkfs command for formatting the partition from the terminal. For example:

bash

mkfs.ext4 /dev/sda1

Replace /dev/sda1 with the correct partition identifier.

Step 5: Verify the Cleaned Drive

To verify that the drive has been successfully cleaned, you can use the following commands:

List Partitions: Run lsblk to ensure that the partitions have been created correctly.

Check File System: Use the fsck (file system check) command to verify the integrity of the file system.

bash

fsck /dev/sda1

If everything checks out, you can safely use the drive for your intended purpose.

Step 6: Mount the Partition and Use the Drive

If you want to mount the partition and start using it immediately, you can mount it manually or through the graphical file manager.

To mount via the command line:

bash

mount /dev/sda1 /mnt

This will mount the partition at the /mnt directory.

Step 7: Reboot and Finalize

Once you have finished cleaning and partitioning your hard drive, you can reboot your system and remove the SystemRescue boot media.

bash

reboot

Your hard drive is now clean and ready to be used for a fresh installation or storage.

Conclusion

Using SystemRescue to clean a hard drive is a powerful and secure way to erase and manage your storage devices. By following these steps, you can:

Securely wipe a hard drive using the shred command.

Create new partitions using GParted.

Format the partitions with the desired file system.

Verify the success of the cleaning process.

While the process may take some time, especially for secure erasure, it’s an essential step if you want to ensure that your data is properly wiped and your drive is ready for a fresh start. Always double-check the device you are cleaning to avoid accidental data loss.

About us and this blog

Panda Assistant is built on the latest data recovery algorithms, ensuring that no file is too damaged, too lost, or too corrupted to be recovered.

Request a free quote

We believe that data recovery shouldn’t be a daunting task. That’s why we’ve designed Panda Assistant to be as easy to use as it is powerful. With a few clicks, you can initiate a scan, preview recoverable files, and restore your data all within a matter of minutes.

Subscribe to our newsletter!

More from our blog

See all posts