"If at first you don't succeed; call it version 1.0"
All articles
Last comments
me again
If you would like to backup your system to ISO- disk image or clone a partition.
humble pie
I think it works, Mint 18 xfce. Have installed clonezilla from the mint package manager, called it [sudo clonezilla] and it opened.
hoek
This is awesome!
david mabitsi
i cant seem to be winning uninstalling linux mint 17.2
Archive
«    December 2016    »
MonTueWedThuFriSatSun
 1234
567891011
12131415161718
19202122232425
262728293031 
» » How to check and fix the disk for errors and bad sectors

How to check and fix the disk for errors and bad sectors

How to check and fix the disk for errors and bad sectors in Linux Mint

In Linux Mint after a certain number of mounts hard drives ("restart computer") forced to on fsck to check the hard drive. Many people know that using tune2fs can be controlled intervals fsck checksBut sometimes you need to check the disk "here and now". If you run fsck with an indication of your drive, the more likely they mounted and fsck will warn you that it is fraught for you. How can that be? To unmount to check? But what about the root?



Sorry for the spelling and phonetic errors in the text.
Owner and main writer of MintGuide.org is not a native English speaker.


A simple disk check can be enjoyed in the system. On the next boot, the system will automatically check all drives, then safely downloaded to your desktop.

sudo touch /forcefsck

The sudo command (after entering password) will give you the right to create using touch an empty file in the root of the drive /forcefsck, which serves as a signal (flag) for fsck, need to check the disks.
You have to reboot and fsck will start to scan all hard disks listed in /etc/fstab.

Also you can check the system disk in Gparted in LiveCD mode. To do this, unmount the desired partition, right click, Check.

But what do we do if we need to check and block bad sectors on the System partition?

The following steps can be performed either by booting to a LiveCD.

BUT if you will check the external (not the system disk), you can easily to do it from your "home" system, from pre-unmount the scanned section.


I will show an example in LiveCD mode.

1. Boot into LiveCD mode

2. Watch full list of storage volumes:

sudo fdisk -l

In my example this section alone, because I show you an example on a virtual machineI need to check sda1

How to check and fix the disk for errors and bad sectors in Linux MintHow to check and fix the disk for errors and bad sectors in Linux Mint

3. To dispel doubts, whether the selected drive, you can check the model of the hard drive (carefully, instead of sda1 in the command written sda):

sudo hdparm -i /dev/sda | grep Model

4. If the volume is mounted, before checking should be unmounted:

sudo umount /dev/sda1

5. Checking for badblocks. where badblocks.log file that records the number of dead blocks.

sudo badblocks -v -s /dev/sda1 > badblocks.log

How to check and fix the disk for errors and bad sectors in Linux MintHow to check and fix the disk for errors and bad sectors in Linux Mint

6. Marking bad blocks (marked blocks will be ignored by the system in future):

sudo e2fsck -l badblocks.log /dev/sda1

How to check and fix the disk for errors and bad sectors in Linux MintHow to check and fix the disk for errors and bad sectors in Linux Mint

That's all. The same procedure should be done after formatting the new drives.

Fix your HDD disk:

Before you check the file system must be unmounted, for example:

umount /dev/sda1

This single command can do all the previous steps at one time

sudo fsck -t -y -f -c /dev/sda1

The keys and command options fsck:
y - always answer yes to all questions (there is an alternative: the -p key starts the test in a fully automatic mode);

f - forces a file system check (even if the file system is marked as fully functional)

c - looking for broken blocks (bad blocks), and then marks them accordingly

Remember: if bad sectors began to appear, it's time to change the hard drive.

To monitor the status of your HDD or SDD, use the GSmartControl utility.

Good Luck!!!

Edited by Shekin - 15-07-2016, 09:36
Reason: Info updated

Related articles

5 comments

  1. JD
    my laptop's HD has been failing. i divided it into 18 partitions (w/ several distros. distro addict here) to see if the damage will creep. i've been using it this way for about 2-3 years now. but i've had no way of quantifying the damage.

    i used the single command for each partition. now i can see how bad each partition is. many thanks!
  2. ujjawal
    sir
    i have install mint17.3 then when installing it it says that a hard disk error
    what i will do now
    1. Shekin
      so did I in this case
      1. run the livecd and treat the disk using gparted
      Screenshot
      2. if you installed the system, boot into recovery mode and fix the disk
      Screenshot 1
      Screenshot 2
      x64 Linux Mint 18 cinnamon
  3. Shekin
    thx, fixed
    x64 Linux Mint 18 cinnamon
  4. syndrael
    Hello,
    Two things to tell:
    1. Thank for this post, i'll try your tutorial, but i see a mistake "badblock.log" vs "badblockS.log" in two commands.
    2. Login via G+ doesn't work: Detected a problem with PHP sessions work on our server. You need to contact your hosting support, to verify that the PHP sessions.
    Best regards from Paris France and thanks again for your site..
  • bowtiesmilelaughingblushsmileyrelaxedsmirk
    heart_eyeskissing_heartkissing_closed_eyesflushedrelievedsatisfiedgrin
    winkstuck_out_tongue_winking_eyestuck_out_tongue_closed_eyesgrinningkissingstuck_out_tonguesleeping
    worriedfrowninganguishedopen_mouthgrimacingconfusedhushed
    expressionlessunamusedsweat_smilesweatdisappointed_relievedwearypensive
    disappointedconfoundedfearfulcold_sweatperseverecrysob
    joyastonishedscreamtired_faceangryragetriumph
    sleepyyummasksunglassesdizzy_faceimpsmiling_imp
    neutral_faceno_mouthinnocent
Login via
Up