Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 6361  / 3 Years ago, mon, july 5, 2021, 8:25:43

My hard drive is partly visible (only 4.1 GB of 2TB) in "Disks" and has a bad sector. I have tried using the smartmontools to check for bad sectors and then used badblocks -svn /dev/sda for which I get the response


badblocks: Permission denied while trying to determine device size

Then I tried to use installation utility but the 18.04 LTS stops responding at selecting language.


error starting SMART self test


"Disk is OK, one bad sector"


Edit 3: New development in the issue - the live usb has started to become unresponsive/ freezing.


Edit 4: using the method provided by 1st answer I am getting the error shown:


Gparted: input/output error during read of /dev/sda


error fsyncing/closing /dev/sda


fdisk output - can't see the disk


More From » 18.04

 Answers
2

The Disks, fdisk, and gparted screenshots don't look very promising...


fsck


First check your file system.



  • boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode

  • open a terminal window by pressing Ctrl+Alt+T

  • type sudo fdisk -l

  • identify the /dev/sdXX device name for your "Linux Filesystem"

  • type sudo fsck -f /dev/sdXX, replacing sdXX with the number you found earlier

  • repeat the fsck command if there were errors

  • type reboot


bad block


Note: do NOT abort a bad block scan!


Note: do NOT bad block a SSD


Note: backup your important files FIRST!


Note: this will take many hours


Note: you may have a pending HDD failure


Boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode.


In terminal...


sudo fdisk -l # identify all "Linux Filesystem" partitions


sudo e2fsck -fcky /dev/sdXX # read-only test


or


sudo e2fsck -fccky /dev/sdXX # non-destructive read/write test (recommended)


The -k is important, because it saves the previous bad block table, and adds any new bad blocks to that table. Without -k, you loose all of the prior bad block information.


The -fccky parameter...


   -f    Force checking even if the file system seems clean.

-c This option causes e2fsck to use badblocks(8) program to do
a read-only scan of the device in order to find any bad blocks.
If any bad blocks are found, they are added to the bad block
inode to prevent them from being allocated to a file or direc‐
tory. If this option is specified twice, then the bad block scan
will be done using a non-destructive read-write test.

-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.

-y Assume an answer of `yes' to all questions; allows e2fsck to be
used non-interactively. This option may not be specified at the
same time as the -n or -p options.

Update #1:


The HDD is defective. Replace it. It may still be under warranty. Check with Seagate.


[#2637] Tuesday, July 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
icielight

Total Points: 158
Total Questions: 92
Total Answers: 93

Location: San Marino
Member since Thu, Jun 30, 2022
2 Years ago
;