Re: How to fix bad superblock or xfs_repair: error - read only 0 of 512 bytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

Thank you for your help. Growing back lv to original size helped.

I am really thankful.

Is there a way for lvm to warn users while invoking lvreduce to check
if the file system should be shrunk before lvreduce.

Regards,

Utpal Bora
Ph.D. Scholar
Computer Science & Engineering
IIT Hyderabad
http://utpalbora.com
PGP key fingerprint: 2F12 635E 409F 11AC 1502  BB41 7705 9980 A062 FA70

Regards,

Utpal Bora
Ph.D. Scholar
Computer Science & Engineering
IIT Hyderabad
http://utpalbora.com
PGP key fingerprint: 2F12 635E 409F 11AC 1502  BB41 7705 9980 A062 FA70



On Sun, Dec 29, 2019 at 10:13 AM Eric Sandeen <sandeen@xxxxxxxxxxx> wrote:
>
> On Dec 28, 2019, at 3:11 AM, Utpal Bora <cs14mtech11017@xxxxxxxxxx> wrote:
> >
> > Hi,
> >
> > My XFS home drive is corrupt after trying to extend it with lvm.
> > This is what I did to extend the partition.
> > 1. Extend Volume group to use a new physical volume of around 1.2TB.
> > This was successful without any error.
> >    vgextend vg-1 /dev/sdc1
> >
> > 2. Extend logical volume (home-lv) to use the free space.
> >    lvextend -l 100%FREE /dev/mapper/vg--1-home--lv -r
> >
> This probably invoked xfs_growfs
>
> > 3. Resized home-lv and reduce 55 GB
> >   lvreduce -L 55G  /dev/mapper/vg--1-home--lv -r
> >
> XFS cannot shrink.  This corrupted your filesystem by truncating the block device.
>
> > I assumed that -r will invoke xfs_grow internally.
> > Everything was working fine until the server was restarted.
> > After restart, the home volume is not mounting. Please see the following.
> >
> > server% sudo mount -t xfs /dev/mapper/vg--1-home--lv /home
> > mount: /home: can't read superblock on /dev/mapper/vg--1-home--lv.
> >
> > server% dmesg| tail
> > [162580.208796] attempt to access beyond end of device
> > [162580.208800] dm-3: rw=4096, want=6650552320, limit=6640066560
> > [162580.208805] XFS (dm-3): last sector read failed
>
> Because you chopped off 55g from the end.
>
> > server% sudo xfs_repair -n
>
> Repair cannot read blocks that have been removed from the filesystem.
>
>
> > /dev/mapper/vg--1-home--lv
> > Phase 1 - find and verify superblock...
> > xfs_repair: error - read only 0 of 512 bytes
>
> Failed to read a backup super beyond the end of the reduced lv.
>
> Grow the lv back to 100% I.e. the size before the lvreduce and it’ll probably be ok again
>
> -Eric
>
> > OS: Ubuntu Server 18.04.3
> > Kernel: 4.15.0-72-generic
> >
> > I have gone through the earlier posts on this subject. They did not help me.
> >
> > Is it possible to repair the XFS volume? Kindly suggest.
> >
> > Regards,
> >
> > Utpal Bora
> > Ph.D. Scholar
> > Computer Science & Engineering
> > IIT Hyderabad
> >
>




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux