8

I did a search beforehand and I don't think a similar question has been asked before.

I have two hard disk drives - a 1TB Seagate and a 1TB Western Digital. My Seagate drive crashed a while back and I suspect it may have some damaged sectors. I was just wondering what is the best way to perform a hard drive scan in Ubuntu and check hard disk health in general? I know both Seagate and WD provide their own software for scanning and repairing drives - can these be installed in Ubuntu? If not then can anyone tell me what method is recommended? Or, is it better to use the manufacturer's proprietary software through Windows?

Time4Tea
  • 295
  • 2
  • 3
  • 14
  • http://www.thegeekstuff.com/2012/08/fsck-command-examples/ – krowe Dec 16 '14 at 00:10
  • 2
    It looks like fsck can be used to check a Unix filesystem, but what I'm asking about is scanning the disk itself, regardless of filesystem (for example, scanning my Windows HDD). I've read that it's recommended to use the manufacturer's own software if possible - is there an acceptable alternative in Ubuntu? – Time4Tea Dec 16 '14 at 00:51
  • Read it again. fsck can handle most filesystems (including FAT by default, and NTFS with a small modification) – krowe Dec 16 '14 at 01:04

3 Answers3

4

You can use the command smartctl from the package smartmontools:

sudo apt install smartmontools
sudo smartctl -a /dev/sda

Where /dev/sda is the name of the device you want to scan.

yPhil
  • 1,557
  • 14
  • 25
4

I did a bit more reading into this myself. These two pages gives some tips about scanning hard drives/filesystems in Linux (they also mention fsck and badblocks):

http://www.howtogeek.com/howto/37659/the-beginners-guide-to-linux-disk-utilities/

http://mypage.uniserve.ca/~thelinuxguy/doc/hdtest.html

There is also the Ubuntu 'Disk Utility' package, which allows checking of the HDD SMART status.

Time4Tea
  • 295
  • 2
  • 3
  • 14
3

A standard filesystem scan is usually done with fsck. This application handles most filesystems out of the box. However, you may need to install NTFS support separately on some installations.

If you'd like to do a surface scan of your drive you can use e2fsck. Use the -c option to do a bad sector scan.

It should also be mentioned that nearly every Linux distro is also configured by default to periodically scan your fixed drives on boot. They will also typically be setup to do this on a schedule (this is important since most Linux boxes rarely need to be reset).

krowe
  • 443
  • 2
  • 12