My NAS HDD has failed to boot. So I decided to check and mark badblocks HDD via following commands attaching to Ubuntu.
sudo badblocks -sv /dev/sdb > /tmp/bads.txt
sudo e2fsck -l /tmp/bads.txt /dev/sdb
Unfortunately, I receive the following error. Would you please inform how I can mark the bad blocks discovered by badblocks command.
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/sdb