- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to check hard disk for bad sectors under linux...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 11:27 PM
03-07-2004 11:27 PM
how to check hard disk for bad sectors under linux ?
I use linux SuSE 8.2 and Ext3 file system.
kind regards
chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 11:41 PM
03-07-2004 11:41 PM
Re: how to check hard disk for bad sectors under linux ?
first umount the disk partition
then
e2fsck -c umounted partition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2004 11:43 PM
03-07-2004 11:43 PM
Re: how to check hard disk for bad sectors under linux ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 12:44 AM
03-08-2004 12:44 AM
Solutionshutdown -rF now
forces checking on reboot.
Ext3 is a problem on checking, as partition is always considered as consistent because of the journal. It's a good idea to proceed to the file checking from time to time at boot time.
You can set it with tune2fs :
tune2fs -c 12 -i 25 /dev/hda3
for example : this will force file checking every 12 boots, or every 25 days (first delay) on hda3. It's a good idea to use it, my experience (and many others' undoubtedly !) shows that with journalisation, it's often too late when you realize that consitency is not there anymore !
hth
J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 01:05 AM
03-08-2004 01:05 AM
Re: how to check hard disk for bad sectors under linux ?
I was under the impression that this does not check for bad areas on the disk, it only checks for inconsistancies in the filesystem itself. Am I wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 01:13 AM
03-08-2004 01:13 AM
Re: how to check hard disk for bad sectors under linux ?
I've forgotten: my /boot is on Ext2 file system and rest on Ext3
# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/hda3 ext3 41286828 7017948 32171596 18% /
/dev/hda1 ext2 46636 6008 38220 14% /boot
/dev/hda4 ext3 35364880 1866420 31701992 6% /usr
shmfs shm 386252 0 386252 0% /dev/shm
can I use this command
tune2fs -c 12 -i 25 /dev/hda
for the whole disk an all partitions ?
greetings
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 01:17 AM
03-08-2004 01:17 AM
Re: how to check hard disk for bad sectors under linux ?
Even if both problems are related, the right command is undoubtedly here badblocks -nsv /dev/hda1 n to make non destructive tests, s to tell you which blocks are tested (be careful : slooows the process), and v to tell you if everything goes right.
Obviously 0 here chris...
J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 01:26 AM
03-08-2004 01:26 AM
Re: how to check hard disk for bad sectors under linux ?
As /boot is ext2, it shouldn't have this problem, as it should be checked.
you still can use tune2fs to tune checking intervals. But the command applies to each partition, so you have to enter it for each.
Entering it today with the same values will make checking occur the same day, but you can't use /dev/hda with it.
J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 01:29 AM
03-08-2004 01:29 AM
Re: how to check hard disk for bad sectors under linux ?
that means badblocks test is looking for bad sectors also ?
what's different exactly between blocks and sectors ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 02:09 AM
03-08-2004 02:09 AM
Re: how to check hard disk for bad sectors under linux ?
From that, each operating system groups sectors in order to simplify disk administration (if your average file size is 3.5 ko, it would be faster to administrate 4.0 ko as the minimum unit to describe a file, instead of administrating 7 sectors to describe the same file. That's why most OSes group sectors in blocks. It looses some space, as in ths example I loose 0.5 ko for the file, but it goes in this example 8 time faster than administrating each sector).
On doing fdisk /dev/hda, you'll be able to check disk block size :
For example :
[root@localhost etc]# fdisk -l /dev/hda
Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylindres of 16065 * 512 = 8225280 bytes
Périphérique Amorce Début Fin Blocs Id Système
/dev/hda1 * 1 382 3068383+ 7 HPFS/NTFS
/dev/hda2 383 1148 6152895 7 HPFS/NTFS
/dev/hda3 1149 1786 5124735 c Win95 FAT32 (LBA)
/dev/hda4 1787 4864 24724035 5 Etendue
/dev/hda5 1787 2296 4096543+ 83 Linux
/dev/hda6 2297 2678 3068383+ 83 Linux
/dev/hda7 2679 2805 1020096 82 Echange Linux
/dev/hda8 2806 2901 771088+ 83 Linux
/dev/hda9 2902 4481 12691318+ 83 Linux
/dev/hda10 4482 4863 3068383+ 83 Linux
The block size is :
Units = cylindres of 16065 * 512 = 8225280 bytes. The block size is units / 1024, here 8132.5, which is odd, I know. Sorry. Most of the time it is 1024 bytes, 2048, 4096 or 81
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2004 10:45 AM
03-26-2004 10:45 AM
Re: how to check hard disk for bad sectors under linux ?
but is it any difference between
blocks and sectors ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2004 11:12 AM
03-26-2004 11:12 AM
Re: how to check hard disk for bad sectors under linux ?
There isn't necessarily any direct correlation between a sector and a block. When you start talking RAID array's, this becomes very clear.