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
Check Encrypted Home drive for Bad Sectors
- Eadwine Rose
- Administrator
- Posts: 14428
- Joined: Wed Jul 12, 2006 2:10 am
Re: Check Encrypted Home drive for Bad Sectors
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
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
Re: Check Encrypted Home drive for Bad Sectors
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.
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
Main: MX 23 | Second: Mint 22 | HTPC: Linux Lite 7 | VM Machine: Debian 12 | Testrig: Arch/FreeBSD 14 | Work: RHEL 8
Re: Check Encrypted Home drive for Bad Sectors
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.
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
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
Re: Check Encrypted Home drive for Bad Sectors
Yes it is Mechanical Hard Drive.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.