You are on page 1of 6


The Beginner’s Guide to Linux Disk Utilities

How-To Geek

The Beginner’s Guide to Linux Disk Utilities

Knowing how to check the condition of your hard disk is useful to determine when to replace your hard disk. In today’s article, we will show you some Linux disk utilities to diagnose the health of your hard disk. Image by Scoobay

S.M.A.R.T System
Most modern ATA and SCSI hard disks have a Self-Monitoring, Analysis, and Reporting Technology (SMART) system. SMART hard disks internally monitor their own health and performance. The SMART tool assesses the condition of your hard disk based on: the throughput of the hard disk, the seek errors rate of the magnetic heads, and other attributes that your hard disk manufacturer built into their hard disk. Most implementations of SMART systems allow users to perform self-tests to monitor the performance and reliability of their hard disks. The simplest way to perform a SMART system test with Ubuntu is using the ‘Disk Utility’ under the ‘System’ > ‘Administration’ menu.


as well as whether a SMART system is enabled on the hard disk.3/21/2014 The Beginner’s Guide to Linux Disk Utilities The disk utility lets you see the model. http://www.howtogeek. serial number. The ‘Run Self-test’ button lets you initiate a short. and the overall health assessment of the hard 2/6 . firmware.extended. or a conveyance self-test on the hard disk. The ‘SMART data’ button lets you see the SMART features of your hard disk. 3/6 . you’ll see a progress meter. You can use the ‘Check Filesystem’ feature of the ‘Disk Utility’ to perform the same check. beside the Disk Utility GUI. The ‘Attributed section’ lets you see the errors and self-test information.if you are not a command line geek like us. that only comes as a command line tool.howtogeek. The File System Check (FSCK). that we can use to diagnose the health of our hard disk. is one of the tools that we often use to check the condition of our hard disk. File System Check There some other tools. letting you see how far through the test is and what the estimated time of completion is.3/21/2014 The Beginner’s Guide to Linux Disk Utilities When you execute these tests.

or when we simply want to show off our command line Kungfu skills to our friends. You can run the ‘fdisk’ command to find out your system partitions: s u d of d i s kl Scheduled File System Checks If you’re using Ubuntu. you will notice that Ubuntu runs an FSCK session when you boot your system from time to time. You need to unmount the file system using the ‘umount’ command.3/21/2014 The Beginner’s Guide to Linux Disk Utilities Of course. there are some situations where we have to use the command line tool to check our file system. you can re-schedule the scan using the ‘tune2fs’ command. Fixing a mounted file system with FSCK could end up creating more damage than the original problem. There is one thing to note before you run FSCK. If you find this scheduled check annoying. when our Linux box fails to boot. the FSCK command line tool looks like something that only a computer geek can handle. Here’s how it typically looks like: The mount count parameter tells us that Ubuntu scans our hard disk after 33 disk mounts. s u d ou m o u n t/ d e v / s d b The FSCK command is pretty straightforward: s u d of s c kte x t 4/ d e v / s d b This command checks an ext4 file system (/dev/sdb) for inconsistencies. But you will find that FSCK is a very easy tool to use. http://www. At first. For example when we are using a headless 4/6 . You should replace /dev/sdb with your own partition.howtogeek.

whether it’s Microsoft Office applications. such as physical damage to the disk surface. or learning to use web applications to save time. you can use the badblocks command to check your hard disk for bad sectors: s u d ob a d b l o c k sv/ d e v / s d b 1 Badblock will give us the number of bad sectors in our hard disk. and Disk Utility are some of the disk utilities that we often use to scan our hard disks. You can either look for a new hard disk.3/21/2014 The Beginner’s Guide to Linux Disk Utilities We can configure the mount count using the ‘-c’ option: s u d ot u n e 2 f sc3 5/ d e v / s d a 1 This command will re-configure Ubuntu to scan our hard disk after 35 hard disk mounts when the system boots. Zainul spends his time trying to make technology more productive.5b a db l o c k sf o u n d . Note: change ‘/dev/sda1/’ with your own partition Bad Blocks A bad sector is a sector on a computer’s disk drive that cannot be used due to permanent damage (or an OS inability to successfully access it). or if you are a command line geek like us. You have two options when you see bad blocks.howtogeek. Do share with the other fellow readers if you know other Linux disk utilities to scan hard disks.1 1 : 5 7e l a p s e d 3 1 3 4 5 6 3d o n e . Published 12/15/10 202.8 : 3 3e l a p s e d 3 1 3 4 5 6 1d o n e . z a i n u l @ z a i n u l l a p t o p : ~ $s u d ob a d b l o c k sv/ d e v / s d b 1 C h e c k i n gb l o c k s0t o9 7 6 8 3 2 0 0 C h e c k i n gf o rb a db l o c k s( r e a d o n l yt e s t ) :3 1 3 4 5 2 8d o n e . or mark these bad blocks as unusable hard disk sectors. s u d ob a d b l o c k s/ d e v / s d b>/ h o m e / z a i n u l / b a d b l o c k s After 5/6 . sudo fsck -l bad-blocks /dev/sdb FSCK. we need to feed the flat file into the FSCK command to mark these bad sectors as ‘unusable’ sectors.3 : 2 7e l a p s e d 3 1 3 4 5 6 0d o n e .1 0 : 1 5e l a p s e d 3 1 3 4 5 6 2d o n e .056 Views http://www. This involves two steps: First we have to write the location of the bad sectors into a flat file. There are two ways to detect bad sectors in Linux: you can use the Disk Utility GUI. Badblocks.1 3 : 3 9e l a p s e d d o n e P a s sc o m p l e t e d .

com/howto/37659/the-beginners-guide-to-linux-disk-utilities/ 6/6 SHOW ARCHIVED READER COMMENTS (14) http://www.3/21/2014 The Beginner’s Guide to Linux Disk Utilities Sponsored Content by Taboola FROM THE WEB ‘Warren Buffett 7 of the Worst The Secret Way to Inside Look At Indicator’ Signals Defending Champions Save Hundreds of Porsche’s 2015 911 Collapse in Stock M… in History Dollars on 5-star Ho… GT3 RS New sm ax ftbpro A Luxury Travel Blog Segm Top Exercises That Will Kill Your Cellulite Lifegooroo Life and Photography with Multiple Sclerosis Living Like You 20 World's Most 10 Most Dangerous Peaceful Countries to People Foods for Live Dogs Am erikanki Wom anitely Got Feedback? Join the discussion at discuss.