Check Encrypted Home drive for Bad Sectors

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
Zeno
Posts: 155
Joined: Wed Feb 19, 2020 1:08 am

Check Encrypted Home drive for Bad Sectors

#1 Post by Zeno »

Hi,
Im using MX Linux.
I have one seperate Hard Drive with Home flag. It is encrypted.
Now, I want to check the drive for Bad Sector.

I used Gparted of the installed MX. Not possible.
Then I tried to check it with Gparted from Booting from live MX cd Gparted. Not possible.

Can one show me the way for that.
Thanks

User avatar
Eadwine Rose
Administrator
Posts: 14428
Joined: Wed Jul 12, 2006 2:10 am

Re: Check Encrypted Home drive for Bad Sectors

#2 Post by Eadwine Rose »

Two topics of yours moved from chat to help section. Please be mindful where you post, thanks.
MX-23.6_x64 July 31 2023 * 6.1.0-34amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.216.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

Huckleberry Finn

Re: Check Encrypted Home drive for Bad Sectors

#3 Post by Huckleberry Finn »

In all cases it needs to be decrypted (as there won't be access).

Read-write test (non-destructive)

User avatar
MadMax
Posts: 483
Joined: Wed Aug 04, 2021 3:25 pm

Re: Check Encrypted Home drive for Bad Sectors

#4 Post by MadMax »

Does badblocks require it to be decrypted, though? Since you run it against the block device, it should happily check every sector of random data it finds there. The story gets a little more complicated if you actually have bad blocks. Then you need to mount the file system to find out if and which files are affected.

Just make sure to run a non-destructive test.

Also just mentioned for completeness, badblocks will only work properly on a mechanical drive (which I think you have, since you wrote "hard drive"), since SSD controllers can remap bad blocks internally. Also bad blocks on SSDs aren't as bad as they are for a HDD.
If it ain't broke, don't fix it.
Main: MX 23 | Second: Mint 22 | HTPC: Linux Lite 7 | VM Machine: Debian 12 | Testrig: Arch/FreeBSD 14 | Work: RHEL 8

User avatar
m_pav
Developer
Posts: 1732
Joined: Sun Aug 06, 2006 3:02 pm

Re: Check Encrypted Home drive for Bad Sectors

#5 Post by m_pav »

What MadMax said.

The badblocks command runs irrespective of the overlying file system. Boot a Live instance then after determining the correct drive location, e.g., "/dev/sda2", run the following command, replacing /dev/sda2 with the actual nomenclature of the partition you wish to check.

By default, badblocks runs in read-only mode so you should not have any issues other than a long wait because the process can take a considerable amount of time. The -s in the command will show progress.

Code: Select all

sudo badblocks -s /dev/sda2
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

Zeno
Posts: 155
Joined: Wed Feb 19, 2020 1:08 am

Re: Check Encrypted Home drive for Bad Sectors

#6 Post by Zeno »

MadMax wrote: Tue Jan 03, 2023 7:00 am Does badblocks require it to be decrypted, though? Since you run it against the block device, it should happily check every sector of random data it finds there. The story gets a little more complicated if you actually have bad blocks. Then you need to mount the file system to find out if and which files are affected.

Just make sure to run a non-destructive test.

Also just mentioned for completeness, badblocks will only work properly on a mechanical drive (which I think you have, since you wrote "hard drive"), since SSD controllers can remap bad blocks internally. Also bad blocks on SSDs aren't as bad as they are for a HDD.
Yes it is Mechanical Hard Drive.

Post Reply

Return to “MX Help”