linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Utpal Bora <cs14mtech11017@iith.ac.in>
Cc: linux-xfs@vger.kernel.org
Subject: Re: How to fix bad superblock or xfs_repair: error - read only 0 of 512 bytes
Date: Sat, 28 Dec 2019 20:43:02 -0800	[thread overview]
Message-ID: <FED1D514-006F-4522-A227-66889C82B82C@sandeen.net> (raw)
In-Reply-To: <CAH3av2k4c63LKQ0eG9twweXEgC7QD7G_w3=c23tSO5rLP_cAfQ@mail.gmail.com>

On Dec 28, 2019, at 3:11 AM, Utpal Bora <cs14mtech11017@iith.ac.in> 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
> 


  parent reply	other threads:[~2019-12-29  4:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-28 11:11 How to fix bad superblock or xfs_repair: error - read only 0 of 512 bytes Utpal Bora
2019-12-29  3:15 ` Chris Murphy
2019-12-29  5:58   ` Utpal Bora
2019-12-29  4:43 ` Eric Sandeen [this message]
2019-12-29  5:58   ` Utpal Bora
  -- strict thread matches above, loose matches on Subject: below --
2012-01-21 10:29 Christian Kildau
2012-01-23  4:31 ` Dave Chinner
2012-01-23  9:23   ` Christian Kildau
2012-01-24  5:04     ` Eric Sandeen
2012-01-24  7:08       ` Christian Kildau
2012-01-24 10:13       ` Christian Kildau
2012-01-24 14:12         ` Roger Willcocks
2012-01-24 15:46           ` Christian Kildau
2012-01-24 15:50             ` Eric Sandeen
2012-01-24 15:52               ` Christian Kildau
2012-01-24 15:57                 ` Eric Sandeen
2012-01-24 17:25                   ` Roger Willcocks
2012-01-24 18:10                     ` Christian Kildau
2012-01-23 10:43   ` Christian Kildau
2012-01-21 10:03 Christian Kildau
2012-01-24  4:51 ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FED1D514-006F-4522-A227-66889C82B82C@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=cs14mtech11017@iith.ac.in \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).