LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2012, 01:37 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
How to check the HD badsector


I use Redhat EL 3 server , I would like to check if the HD have sector or not , as the server is too old that do not support on-line checking , so I can not use the vendor utility to check it , does linux have such command / method to check ?

thx
 
Old 02-14-2012, 01:47 AM   #2
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Rep: Reputation: 25
Quote:
Originally Posted by ust View Post
I use Redhat EL 3 server , I would like to check if the HD have sector or not , as the server is too old that do not support on-line checking , so I can not use the vendor utility to check it , does linux have such command / method to check ?

thx
Open your terminal.
type
Code:
su
type your root password.
type
Code:
init1
to enter run level 1
type
Code:
e2fsck
and see some function option like this

Usage: e2fsck [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] device
Quote:
Emergency help:
-p Automatic repair (no questions)
-n Make no changes to the filesystem
-y Assume "yes" to all questions
-c Check for bad blocks and add them to the badblock list
-f Force checking even if filesystem is marked clean
-v Be verbose
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external_journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
 
Old 02-14-2012, 02:09 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by tailinlinux View Post
Open your terminal.
type
Code:
su
type your root password.
type
Code:
init1
to enter run level 1
type
Code:
e2fsck
and see some function option like this

Usage: e2fsck [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] device
thx reply

If I use this method to check badsector , I need to umount the drive first ?

thanks.
 
Old 02-14-2012, 02:35 AM   #4
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Rep: Reputation: 25
Quote:
Originally Posted by ust View Post
thx reply

If I use this method to check badsector , I need to umount the drive first ?

thanks.
You're welcome sir.

Yes you need to be on single user mode, for you to able run safe disk checking.

Aries

Last edited by tailinlinux; 02-14-2012 at 02:38 AM.
 
Old 02-14-2012, 02:49 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Or, as root, you can run touch /forcefsck and do a reboot. Linux will fsck all file systems during the reboot. More info here.

But fsck only checks the file system structure; it does not look for bad blocks.

Have you investigated the availability of a vendor-supplied utility that comes with a bootable media? The disk would have to be very old for that not to be available.

You could use the badblocks utility. More information here and here.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] problem with 6.9glibc make -k check 2>&1 | tee glibc-check-log bhismnarayan Linux From Scratch 3 10-01-2010 08:51 AM
problem with 6.9glibc make -k check 2>&1 | tee glibc-check-log bhismnarayan Linux From Scratch 1 09-30-2010 03:04 PM
Partition check, check double check Vincentius Linux - General 0 12-25-2004 05:47 AM
Boot disk; check. CD in drive; check. Doesn't work; check. Hal DamnSmallLinux 7 02-04-2004 02:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration