Checking Bad Sector/Bad Blocks via Terminal

Bad Sector/Bad Block

A bad sector is a sector on a computer’s disk drive that cannot be used due to permanent damage to the disk surface.

There are two ways to detect bad sectors in Linux: you can use the Disk Utility GUI, or use the command line. You can use the badblocks command to check your hard disk for bad sectors:

$ sudo badblocks -v /dev/sdb1

For more info type the following command:

$ man badblocks

Badblocks will give us the number of bad sectors in our hard disk drive.

Ubuntu upgrade: 12.04 LTS Precise Pangolin

Recently, I just upgraded my Ubuntu 11.10 (Oneiric Ocelot) to the current release of Ubuntu 12.04 LTS (Precise Pangolin). I notice that there’s a quicker response compare to the previous ubuntu installed and with the crappy system-box that I usually use for testing… I would say the upgrade was good and wise decision for me.

What’s New with Ubuntu


 


Display System Information via Terminal

System Information Commands

df: The df command displays filesystem disk space usage for all mounted partitions. “df -h” is probably the most useful – it uses megabytes (M) and gigabytes (G) instead of blocks to report. (-h means “human-readable”)

-h, –human-readable print sizes in human readable format (e.g., 1K 234M 2G)

-T, –print-type print file system type

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              10G  5.1G  4.5G  52% /home
/dev/sdb1              25G   23G  2.2G  92% /media/Label

$df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext4     10G  5.1G  4.5G  52% /home
/dev/sdb1  fuseblk     25G   23G  2.2G  92% /media/Label

For more info type the following command:

$df --help

du: The du command displays the disk usage for a directory. It can either display the space used for all subdirectories or the total for the directory you run it on.

-h, –human-readable print sizes in human readable format (e.g., 1K 234M 2G)
      –si like -h, but use powers of 1000 not 1024

-s, –summarize display only a total for each argument

$ du -h /home/user
1024k /home/user/files
5.1G /home/user

$du -sh /home/user
5.1G /home/user

For more info type the following command:

$du --help