At 02:20:32 on Thursday Thursday 18 November 2010, David Haller <dnh@opensuse.org> wrote:
Hello,
On Tue, 16 Nov 2010, Stan Goodman wrote:
After fsck finishes, its report includes (these are numbers from a few days ago): "/dev/sda7/:21727/2564096 files (0.7% non-contiguous 1982750/10241429 blocks".
I interpret this as meaning that there are bad blocks on the HD.
Those numbers have nothing whatsoever to do with bad blocks.
Bad blocks was my guess (I had not found any explanation of what the numbers mean). Carlos quickly told me that my guess was wrong, but your detailed explanation is much appreciated. The diagnostic test on the disk in question, which found no defects.
An ext2/3/4 filesystem has a fixed number of inodes, determined on creation. Each file (regular file, directory, symlink, socked, device, named pipe) uses one inode. Hardlinks do not need additional inodes, just some space in the directory. So, the first pair of numbers tells you that currently there are 21727 inodes out of 2564096 inodes in use. Compare with the output of 'df -i /dev/sda7'...
Very clear. It wouldn't have been a lot of trouble for the output of fsck to provide that level of labeling.
Of those 21727 files, there are 0.7% (or about 152 files) not contiguously on the disk, the file has two or more "pieces". E.g., with each '=' or '-' being one block (usually 4 KiB)
The designation "non-contiguous" is very clear.
whatever file_one file_two [..] Rest_of_file_one next_file ---------========-----------[..]-================-----------
The sequences of blocks '=' where file_one "resides" on the disk is not in one piece, it is 'non-contiguous'.
The second pair of numbers tells you how many blocks the filesystem has (10241429) and how many of those are in use by files (1982750). Compare with the output of 'df /dev/sda7', but you'll need to adjust the block-size. Assuming 4KiB:
df -B 4096 /dev/sda7
You can find out how large your blocks are (and a lot more) by using:
tune2fs -l /dev/sda7
***** # tune2fs -l /dev/sda7 tune2fs 1.41.11 (14-Mar-2010) Filesystem volume name: <none> Last mounted on: /home Filesystem UUID: 681b8f76-77c1-44b9-9c89-ed9027b2a4c2 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 2564096 Block count: 10241429 Reserved block count: 512071 Free blocks: 8254037 Free inodes: 2541547 First block: 0 Block size: 4096 Fragment size: 4096 Reserved GDT blocks: 1021 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 8192 Inode blocks per group: 512 Flex block group size: 16 Filesystem created: Mon Sep 13 22:40:36 2010 Last mount time: Sun Jul 4 03:00:08 2010 Last write time: Sun Jul 4 03:00:08 2010 Mount count: 1 Maximum mount count: -1 Last checked: Sun Jul 4 03:01:09 2010 Check interval: 0 (<none>) Lifetime writes: 25 GB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: 7beec659-fa23-417b-804d-254d47341e59 Journal backup: inode blocks ***** Interesting that the file system was most recently mounted and written two months before it was created. But I do not see that it is running out of inodes (under 1%) or blocks (20%); why is it complaining?
or just for the blocksize:
tune2fs -l /dev/sda7 | grep -i Block.size
If you want to find out if your disk has bad blocks, run
smartctl -s on /dev/sda smartctl -A /dev/sda
***** # smartctl -A /dev/sda smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (openSUSE RPM) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 119 099 006 Pre-fail Always - 226329685 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 816 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 064 060 030 Pre-fail Always - 3056198 9 Power_On_Hours 0x0032 098 098 000 Old_age Always - 2032 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 408 183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0 188 Command_Timeout 0x0032 100 094 000 Old_age Always - 150 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 072 051 045 Old_age Always - 28 (Lifetime Min/Max 21/28) 194 Temperature_Celsius 0x0022 028 049 000 Old_age Always - 28 (0 20 0 0) 195 Hardware_ECC_Recovered 0x001a 047 019 000 Old_age Always - 226329685 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 32388348382196 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 163897792 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 1026609259 *****
as root. The relevant attributes are 5, 196, 197 and 198. Use e.g.:
196 is missing from the output. If I am reading this correctly, the disk is on its last legs. This is not an old disk (less than a year, much less than I remembered). Am I misinterpreting it?
smartctl -A /dev/sda | \ awk '$1 ~ /^(5|19[678])/ { if( $NF != 0 ) { print FILENAME " " $2 "\t" $NF; } }'
to filter for those attributes.
HTH,
Many thanks... -- Stan Goodman Qiryat Tiv'on Israel -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org