How to confirm dd does Not erase the bad blocks list made by e2fsck ?
An old 1500 GB HDD (hard disk drive), without data,
took about 33 hours (1932 minutes) to run this command:
time sudo e2fsck -c -c -k -C 0 /dev/sda1
output
e2fsck 1.46.5 (30-Dec-2021)
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done
_1500G_GEXT4: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
_1500G_GEXT4: ***** FILE SYSTEM WAS MODIFIED *****
_1500G_GEXT4: 11/91578368 files (0.0% non-contiguous), 6031026/366284288 blocks
real 1932m4.759s
user 0m2.296s
sys 0m7.618s
time sudo e2fsck -c -c -k -C 0 /dev/sda1
-c use badblocks(8) program to do a read-only scan
second -c makes it do a non-destructive write+read test,
External Hard Drive bad sectors recover/mark utility in linux
-k When combined with the -c option, any existing bad blocks
in the bad blocks list are preserved, and
any new bad blocks found by running badblocks(8)
will be added to the existing bad blocks list.
-C fd
-C 0 progress of the file system check can be monitored
see man e2fsck
said differently:
Would doing a dd command erase what took 33 hours to achieve?
Does a dd command erase the bad blocks list?
How to confirm dd does Not erase the bad blocks list made by e2fsck ?
A dd command means one or both:
time sudo dd if=/dev/urandom of=/dev/sd_ bs=64K status=progress
time sudo dd if=/dev/zero of=/dev/sd_ bs=64K status=progress
details:
lsblk -ae7 -oType,name,path,size,fsuse%,tran,pttype,fstype,label,partlabel,mountpoints |grep 'sda\|MOUNT'
TYPE NAME PATH SIZE FSUSE% TRAN PTTYPE FSTYPE LABEL PARTLABEL MOUNTPOINTS
disk sda /dev/sda 1.4T sata gpt
part └─sda1 /dev/sda1 1.4T gpt ext4 _1500G_GEXT4 PART_1
neofetch --stdout |grep 'OS:'
OS: Kubuntu 22.04.2 LTS x86_64
e2fsck -V
e2fsck 1.46.5 (30-Dec-2021)
Using EXT2FS Library version 1.46.5, 30-Dec-2021
--