Updating bad block inode Listen on sexchat
Important note: If the output of badblocks is going to be fed to the e2fsck or mke2fs programs, it is important that the block size is properly specified, since the block numbers which are generated are very dependent on the block size in use by the filesystem.
For this reason, it is strongly recommended that users not run badblocks directly, but rather use the -c option of the e2fsck and mke2fs programs.
The smartctl performs SMART tasks and can be used to print SMART self-tests and error logs among other tasks such as support for polling Tape Alert messages from SCSI tape drives.
The usage of this command will be clear as we proceed through this article.
The problem has occurred looks like a hardware problem. But we now know from this output that it is unused block.
The ‘dd’ command is very useful command if you are working on disk level. The ‘if’ option provides the input file for dd command. This file is used to write zeroes on the hard drive. The ‘bs’ is the block size and ‘count’ is the number of blocks to be written on the drive.The 'pvdisplay' command gives the size of PE of the LVM partition:# part=/dev/hdb3 ; pvdisplay -c $part | awk -F: '' 4096To get its size in LBA block size (512 bytes or 0.5 KB), we multiply this number by 2 : 4096 * 2 = 8192 blocks for each PE.Now we search the PE in which the bad block is residing: physical partition's bad block number / sizeof(PE)36194858 / 8192 = 4418.3176Now we need to find the logical partition corresponding to PE number 4418.# lvdisplay --maps |egrep 'Physical|LV Name|Type' LV Name /dev/WDC80Go/racine Type linear Physical volume /dev/hdb3 Physical extents 0 to 127 LV Name /dev/WDC80Go/usr Type linear Physical volume /dev/hdb3 Physical extents 128 to 1407 LV Name /dev/WDC80Go/var Type linear Physical volume /dev/hdb3 Physical extents 1408 to 1663 LV Name /dev/WDC80Go/tmp Type linear Physical volume /dev/hdb3 Physical extents 1664 to 1791 LV Name /dev/WDC80Go/home Type linear Physical volume /dev/hdb3 Physical extents 1792 to 3071 LV Name /dev/WDC80Go/ext1 Type linear Physical volume /dev/hdb3 Physical extents 3072 to 10751 LV Name /dev/WDC80Go/ext2 Type linear Physical volume /dev/hdb3 Physical extents 10752 to 18932The logical partition starts on PE 3072:(# PE's start of partition * sizeof(PE)) parttion offset[pe_start] = (3072 * 8192) 384 = 25166208There are 512 blocks of physical partition, so the bad block number is:(36194858 - 25166208) / (sizeof(fs block) / 512) = 11028650 / (4096 / 512) = 1378581.25You can verify if this is the actual bad block with dd command: If the command issues some error, then the calculation for the bad block is correct.as a note, on 13.04 you run palimpsest by just running "disks" from the ubuntu menu, however...
I dont' see an option to launch a self-test (possibly because I have only one drive, and it's the one running Ubuntu...) where /dev/sda1 is the drive you want to check. There's also 'badblocks' command which checks a device for, you guessed it, bad blocks.This article describes the actions that can be taken when smartmontools detect and report some bad blocks on the disks.