1

I have 2 logical volumes in a volume group that span two hard drives. The problem that I'm currently having is that the I can no longer mount the volume group because the superblock is misreporting the size of the logical volume I want to mount.

root@ops:~# fdisk -l /dev/sda /dev/sdb                                    

Disk /dev/sda: 500.1 GB, 500107861504 bytes                               
255 heads, 63 sectors/track, 60801 cylinders, total 976773167 sectors     
Units = sectors of 1 * 512 = 512 bytes                                    
Sector size (logical/physical): 512 bytes / 512 bytes                     
I/O size (minimum/optimal): 512 bytes / 512 bytes                         
Disk identifier: 0x0004bd90                                               

   Device Boot      Start         End      Blocks   Id  System            
/dev/sda1   *        2048      499711      248832   83  Linux             
/dev/sda2          501758   976771071   488134657    5  Extended          
/dev/sda5          501760   976771071   488134656   8e  Linux LVM         

Disk /dev/sdb: 500.1 GB, 500107861504 bytes                               
255 heads, 63 sectors/track, 60801 cylinders, total 976773167 sectors     
Units = sectors of 1 * 512 = 512 bytes                                    
Sector size (logical/physical): 512 bytes / 512 bytes                     
I/O size (minimum/optimal): 512 bytes / 512 bytes                         
Disk identifier: 0x00000000                                               

Disk /dev/sdb doesn't contain a valid partition table                     

root@ops:~# lvdisplay                                           
  --- Logical volume ---                                        
  LV Path                /dev/ops-vg-restore/root               
  LV Name                root                                   
  VG Name                ops-vg-restore                         
  LV UUID                uIvK4y-7ks6-A7CK-1N4X-gK1g-7mgZ-7OV0wB 
  LV Write Access        read/write                             
  LV Creation host, time ops, 2014-04-30 09:53:37 -0400         
  LV Status              available                              
  # open                 0                                      
  LV Size                927.24 GiB                             
  Current LE             237373                                 
  Segments               2                                      
  Allocation             inherit                                
  Read ahead sectors     auto                                   

  - currently set to     256                                    
  Block device           252:0                                  

  --- Logical volume ---                                        
  LV Path                /dev/ops-vg-restore/swap_1             
  LV Name                swap_1                                 
  VG Name                ops-vg-restore                         
  LV UUID                kkuVNB-9fu8-jDW1-A3A9-9P9N-VTDK-gmXsgz 
  LV Write Access        read/write                             
  LV Creation host, time ops, 2014-04-30 09:53:37 -0400         
  LV Status              available                              
  # open                 0                                      
  LV Size                3.99 GiB                               
  Current LE             1022                                   
  Segments               1                                      
  Allocation             inherit                                
  Read ahead sectors     auto                                   
  - currently set to     256                                    
  Block device           252:1     

root@ops:~# mount /dev/ops-vg-restore/root /mnt/ops-vg-restore/                         
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ops--vg--restore-root,  
       missing codepage or helper program, or other error                               
       In some cases useful info is found in syslog - try                               
       dmesg | tail  or so                                                              

dmesg returns

[Tue Feb 10 11:33:10 2015] EXT4-fs (dm-0): bad geometry: block count 1219824640 exceeds size of device (243069952 blocks) 

Does this mean I should create a new partition on sdb? and then create an lvm partition or try to fix the superblock issues using e2fsck?

[EDIT more information requested]

root@ops:~# pvs
  PV         VG             Fmt  Attr PSize   PFree 
  /dev/sda5  ops-vg-restore lvm2 a--  465.52g 48.00m
  /dev/sdb   ops-vg-restore lvm2 a--  465.76g     0 
  /dev/sdd1                 lvm2 a--    1.82t  1.82t

root@ops:~# vgs
  VG             #PV #LV #SN Attr   VSize   VFree 
  ops-vg-restore   2   2   0 wz--n- 931.28g 48.00m

root@ops:~# lvs
  LV     VG             Attr      LSize   Pool Origin Data%  Move Log Copy%  Convert
  root   ops-vg-restore -wi-a---- 927.24g                                           
  swap_1 ops-vg-restore -wi-a----   3.99g       

[Another bit of extra information]

root@ops:~# e2fsck -v -f /dev/ops-vg-restore/root
e2fsck 1.42.9 (4-Feb-2014)
The filesystem size (according to the superblock) is 1219824640 blocks
The physical size of the device is 243069952 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? no
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Error reading block 243073024 (Invalid argument) while reading inode and block bitmaps.  Ignore error<y>? yes
Force rewrite<y>? 
...

The above continues for a really long time until at which point it exits without any more information or I don't ignore the error. Then I get,

Error reading block 243269632 (Invalid argument) while reading inode and block bitmaps.  Ignore error<y>? no
e2fsck: Can't read a block bitmap while retrying to read bitmaps for /dev/ops-vg-restore/root
Error writing block 243073024 (Invalid argument).  Ignore error<y>? yes
e2fsck: aborted


root@ops:~# fdisk -l /dev/ops-vg-restore/root

Disk /dev/ops-vg-restore/root: 995.6 GB, 995614523392 bytes
255 heads, 63 sectors/track, 121043 cylinders, total 1944559616 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/ops-vg-restore/root doesn't contain a valid partition table
  • 2
    Sorry, but we don't have any psychics here. You'll need to post the output from each of the commands pvs, vgs and lvs. – Michael Hampton Feb 10 '15 at 17:04
  • Interesting. The LVM structure looks functional. Have you tried checking the filesystem? – Michael Hampton Feb 10 '15 at 17:09
  • Can you add 'fdisk -l /dev/ops-vg-restore/root' so that we're sure LVM and fdisk are both reporting same size? – Jakov Sosic Feb 10 '15 at 17:27
  • Did you by any chance run lvreduce without shrinking FS before reducing LV?! – Jakov Sosic Feb 10 '15 at 17:29
  • 1
    Hm. At this point you just might need a psychic. I strongly suspect you are going to need your backups. – Michael Hampton Feb 10 '15 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.