Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

The Beginner's Guide To Linux Disk Utilities

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

3/21/2014

The Beginners Guide to Linux Disk Utilities

How-To Geek

The Beginners 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 todays 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.

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

1/6

3/21/2014

The Beginners Guide to Linux Disk Utilities

The disk utility lets you see the model, serial number, firmware, and the overall health assessment of the hard disk, as well as whether a SMART system is enabled on the hard disk.

The SMART data button lets you see the SMART features of your hard disk.

The Run Self-test button lets you initiate a short,extended, or a conveyance self-test on the hard disk.

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

2/6

3/21/2014

The Beginners Guide to Linux Disk Utilities

When you execute these tests, youll see a progress meter, letting you see how far through the test is and what the estimated time of completion is.

The Attributed section lets you see the errors and self-test information.

File System Check


There some other tools, beside the Disk Utility GUI, that we can use to diagnose the health of our hard disk. The File System Check (FSCK), that only comes as a command line tool, is one of the tools that we often use to check the condition of our hard disk. You can use the Check Filesystem feature of the Disk Utility to perform the same check,if you are not a command line geek like us.

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

3/6

3/21/2014

The Beginners 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. For example when we are using a headless system, when our Linux box fails to boot, or when we simply want to show off our command line Kungfu skills to our friends. At first, the FSCK command line tool looks like something that only a computer geek can handle; But you will find that FSCK is a very easy tool to use. There is one thing to note before you run FSCK; You need to unmount the file system using the umount command. Fixing a mounted file system with FSCK could end up creating more damage than the original problem. 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. You should replace /dev/sdb with your own partition. 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 youre using Ubuntu, you will notice that Ubuntu runs an FSCK session when you boot your system from time to time. If you find this scheduled check annoying, you can re-schedule the scan using the tune2fs command. Heres how it typically looks like:

The mount count parameter tells us that Ubuntu scans our hard disk after 33 disk mounts.

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

4/6

3/21/2014

The Beginners 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. Note: change /dev/sda1/ with your own partition

Bad Blocks
A bad sector is a sector on a computers disk drive that cannot be used due to permanent damage (or an OS inability to successfully access it), such as physical damage to the disk surface. There are two ways to detect bad sectors in Linux: you can use the Disk Utility GUI, or if you are a command line geek like us, 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.

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 ,3 : 2 7e l a p s e d 3 1 3 4 5 6 0d o n e ,8 : 3 3e l a p s e d 3 1 3 4 5 6 1d o n e ,1 0 : 1 5e l a p s e d 3 1 3 4 5 6 2d o n e ,1 1 : 5 7e l a p s e d 3 1 3 4 5 6 3d o n e ,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 ,5b a db l o c k sf o u n d .

You have two options when you see bad blocks. You can either look for a new hard disk, or mark these bad blocks as unusable hard disk sectors. This involves two steps: First we have to write the location of the bad sectors into a flat file. 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 that, we need to feed the flat file into the FSCK command to mark these bad sectors as unusable sectors. sudo fsck -l bad-blocks /dev/sdb

FSCK, Badblocks, and Disk Utility are some of the disk utilities that we often use to scan our hard disks. Do share with the other fellow readers if you know other Linux disk utilities to scan hard disks.

Zainul spends his time trying to make technology more productive, whether its Microsoft Office applications, or learning to use web applications to save time.

Published 12/15/10 202,056 Views

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

5/6

3/21/2014

The Beginners 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 Porsches 2015 911 Collapse in Stock M in History Dollars on 5-star Ho GT3 RS
New sm ax ftbpro A Luxury Travel Blog Segm ent.com

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

SHOW ARCHIVED READER COMMENTS (14)

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

6/6

You might also like