fixdisk error

Keith Dancey

New Member
Hi,

After maybe a dozen attempts, I appear unable to overcome this fixdisk error:

Code:
Press return to continue:                                                                                             
                                                                                                                      
      /---------------------------------------------\                                                                 
      |  M A I N T E N A N C E   M O D E   M E N U  |                                                                 
      \---------------------------------------------/                                                                 
                                                                                                                      
  [ Humax HDR-Fox T2 (humax) 1.03.12/3.13 ]                                                                           
                                                                                                                      
  Note: Some areas of the hard disk are not mounted.                                                                  
        Not all functions will be available.                                                                          
        (normal if you have just run a disk check)                                                                    
                                                                                                                      
fixdisk - Check and repair hard disk.                                                                                
   short - Run short hard-disk self test.                                                                             
    long - Run long hard-disk self test.                                                                              
   check - Check self-test progress.                                                                                  
    gptf - Re-format disk using GPT scheme.                                                                           
     epg - Clear persistent EPG data.                                                                                 
    dlna - Reset DLNA server database.                                                                                
       x - Leave maintenance mode (Humax will restart).                                                               
    diag - Run a diagnostic.                                                                                          
     cli - System command line (advanced users).                                                                      
                                                                                                                      
Please select option: fixdisk                                                                                         
Any additional options (-h for list or press return for none): -y -d                                                  
Are you sure you wish to run the hard disk checker (-y -d)? [Y/N] y                                                   
Running /bin/fix-disk                                                                                                 
PART: [3 1 2]                                                                                                         
FSCKOPTS: []                                                                                                          
                                                                                                                      
Checking disk sda (512 byte sectors)                                                                                  
                                                                                                                      
Partition /dev/sda1 is already unmounted                                                                              
Partition /dev/sda2 is already unmounted                                                                              
Partition /dev/sda3 is already unmounted                                                                              
                                                                                                                      
                                                                                                                      
Running short disk self test                                                                                          
Error at LBA 46406855
                                                                                                                      
/dev/sda:                                                                                                             
re-writing sector 46406855: succeeded                                                                                 
                                                                                                                      
Running short disk self test                                                                                          


No pending sectors found - skipping sector repair                                                                     
                                                                                                                      
Checking partition tables...                                                                                          
                                                                                                                      
MBR Status: MBR only                                                                                                  
GPT Status: not present                                                                                               
                                                                                                                      
Using superblock 0 on sda1                                                                                            
Using superblock 0 on sda2                                                                                            
Using superblock 0 on sda3                                                                                            
Dev: /dev/sda LBA: 46406855                                                                                           
LBA: 46406855 is on partition /dev/sda2, start: 2104515, bad sector offset: 44302340                                  
dumpe2fs 1.42.13 (17-May-2015)                                                                                        
Using superblock 0                                                                                                    
Block size: 4096                                                                                                      
LBA 46406855 maps to file system block 5537792 on /dev/sda2                                                           
                                                                                                                      
Checking to see if this block is in use...                                                                            
debugfs 1.42.13 (17-May-2015)                                                                                         
/dev/sda2: Can't read a block bitmap while reading block bitmap                                                       
testb: Filesystem not open                                                                                            
Unknown error                                                                                                         
fix-disk: session terminated with exit status 1                                                                       
                                                                                                                      
Press return to continue:


The "Error at LBA" gives a different address on each attempt...

Clearly, I do not know how the final error "can't read a block bitmap while reading a block bitmap" can occur, or why "testb: Filesystem not open" may happen, because I do not have access to the source code...

But, for those of you with greater experience, is there anything else I may try? Or is this disc simply considered well and truly dead?

Cheers,

keith
 
Last edited by a moderator:
It would be good if you could put your 'printouts' inside Code \Code tags so that readers can tell the difference between the printout and what you have typed. It also takes up a bit less space on the forum page.;)
 
Hi,

After maybe a dozen attempts, I appear unable to overcome this fixdisk error:
Code:
...
Checking disk sda (512 byte sectors)                                                                                  
                                                                                                                      
Partition /dev/sda1 is already unmounted                                                                              
Partition /dev/sda2 is already unmounted                                                                              
Partition /dev/sda3 is already unmounted                                                                              
                                                                                                                      
                                                                                                                      
Running short disk self test                                                                                          
Error at LBA 46406855
                                                                                                                      
/dev/sda:                                                                                                             
re-writing sector 46406855: succeeded                                                                                 
                                                                                                                      
Running short disk self test                                                                                          


No pending sectors found - skipping sector repair                                                                     
                                                                                                                      
Checking partition tables...                                                                                          
                                                                                                                      
MBR Status: MBR only                                                                                                  
GPT Status: not present                                                                                               
                                                                                                                      
Using superblock 0 on sda1                                                                                            
Using superblock 0 on sda2                                                                                            
Using superblock 0 on sda3                                                                                            
Dev: /dev/sda LBA: 46406855                                                                                           
LBA: 46406855 is on partition /dev/sda2, start: 2104515, bad sector offset: 44302340                                  
dumpe2fs 1.42.13 (17-May-2015)                                                                                        
Using superblock 0                                                                                                    
Block size: 4096                                                                                                      
LBA 46406855 maps to file system block 5537792 on /dev/sda2                                                           
                                                                                                                      
Checking to see if this block is in use...                                                                            
debugfs 1.42.13 (17-May-2015)                                                                                         
/dev/sda2: Can't read a block bitmap while reading block bitmap                                                       
testb: Filesystem not open                                                                                            
Unknown error                                                                                                         
fix-disk: session terminated with exit status 1                                                                       
                                                                                                                      
Press return to continue:


The "Error at LBA" gives a different address on each attempt...

Clearly, I do not know how the final error "can't read a block bitmap while reading a block bitmap" can occur, or why "testb: Filesystem not open" may happen, because I do not have access to the source code...
Not strictly true: see /var/lib/humaxtv_backup/mod/fix-disk (more easily accessed as /mod/boot/2/fix-disk once /mod is mounted) for the shell script called by the telnet menu's fixdisk option, and, eg, https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.13/ for the programs that it calls.

For instance, the message
Code:
...
Checking to see if this block is in use...                                                                            
debugfs 1.42.13 (17-May-2015)                                                                                         
/dev/sda2: Can't read a block bitmap while reading block bitmap                                                       
testb: Filesystem not open                                                                                            
Unknown error                                                                                                         
fix-disk: session terminated with exit status 1                                                                       
                                                                                                                      
Press return to continue:
comes from CF 3.13's fix-disk lines 374-6:
Code:
      echo -e "\nChecking to see if this block is in use..."
      dstat=$(debugfs -b $bs -s $sb -R "testb $fsbadblock" $bad_part | \
        sed -n -e '/^Block .* in use/{s/.*\(marked\|not\).*/\1/;p}')
In the second and third lines, the command debugfs is invoked on partition 2 with block-size -b 4096 (as printed a few lines above) and superblock -s 0 (ditto) and sub-command -R testb 5537792 to determine whether this block is in use; the output of this is flitered through the sed stream editor so that the output is either "marked" (in use) or "not" (not in use), and assigned as the value of dstat,

The debugfs sub-command testb fails because an allocation map ("block bitmap") can't be read at debugfs.c line 103.

To adapt from https://www.tldp.org/HOWTO/Filesystems-HOWTO-6.html, the disk layout of an Ext2/3 file system looks like this:
Code:
,---------+---------+---------+---------+---------,
| Boot    | Block   | Block   |   ...   | Block   |
| sector  | group 1 | group 2 |         | group n |
`---------+---------+---------+---------+---------'
Each block group contains a redundant copy of crucial filesystem control information (superblock and the filesystem descriptors, generally only in certain groups) followed by a part of the filesystem (a block bitmap, an inode bitmap, a piece of the inode table, and data blocks), as shown below:
Code:
,~~~~~~~~~+~~~~~~~~~+---------+---------+---------+---------,
| Super   | FS      | Block   | Inode   | Inode   | Data    |
| block   | desc.   | bitmap  | bitmap  | table   | blocks  |
`~~~~~~~~~+~~~~~~~~~+---------+---------+---------+---------'
In this layout, the super block is the master index of the whole filesystem and inodes are indexes of files and directories. The block bitmap records whether blocks in the block group are in use.

Your disk appears to have a bad sector affecting the block bitmap of at least one block group.

By design of the filesystem, the contents of the block bitmap can be reconstructed (by gathering block allocation data from all the inodes in the filesystem).

fix-disk tries to tell you which flles might have been damaged as it recovers from disk errors. However this isn't possible with the sort of error your disk is showing, at least with the current code. You can bypass this part of the recovery process with the -B "Skip block search" option of fix-disk.

But, for those of you with greater experience, is there anything else I may try? Or is this disc simply considered well and truly dead?
..
In summary, it's probably not dead, so try fix-disk again with the -B option: it should continue and then run the filesystem checker on each of the three partitons, which should fix the corrupt block bitmap. With any luck, the bad sector(s) won't have affected any recordings. fix-disk saves a log file to /mnt/hd3 from which an expert should able to check this.
 
Last edited:
Excellent! Thank you very much for taking the trouble to give such a comprehensive reply. I will have another go... (trying to rescue some recordings from my failing PVR is turning into a bit of a project). The 'heads up' info on sources is also greatly appreciated:)

I may be a little while - I have caring/visiting duties...
 
Back
Top