linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <bmr@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Cc: tariq wali <ganaiwali@gmail.com>
Subject: Re: [linux-lvm] lvreduce nightmare
Date: Fri, 18 May 2012 10:57:01 +0100	[thread overview]
Message-ID: <4FB61CED.6000309@redhat.com> (raw)
In-Reply-To: <CAGQjrKb6_HuVc2Ro8vnkMwEmHg-H4gJHJVf_Q5GVaZfSM1p7yA@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/16/2012 04:48 PM, tariq wali wrote:
> Filesystem                       Size  Used Avail   Use% Mounted
> on /dev/mapper/vg0-data         2.2T  1.7T  433G  80%  /data
> 
> Out of the available *433G* I wanted to reduce *100G* in vg0 so
> that I could use it for a new partition and this is what I did ..
> 
> * e2fsck -f /dev/vg0/data resize2fs /dev/vg0/data 100G

This command will attempt to reduce the file system to 1OOG *total*.
It could not have succeeded given the file system state shown by df above.

> lvreduce -L -100G -n /dev/vg0/data*

This truncated the last 100G of the file system. Immediately stopping
at this point, restoring LVM metadata and fscking would have fixed this.

> *e2fsck -f /dev/vg0/data -n* * * after the fsck completed it would
> prompt to fix superblock/inodes which I replied with 'yes' however
> the problem still persists that if i mount /data it goes into
> read-only mode .

With -n the fsck should not write to the disk but if it was prompting
you for y/n to fixes then it probably was not run with that option.

> I have reduced lvm's with those  sequence of commands in the past
> but i just dont understand why it seems to have failed this time
> although i did get 100G free space in vg0 but the partition /data
> seems useless ..

The resize2fs invocation used was incorrect and probably failed
causing the subsequent device resize to truncate the file system. The
fsck then trashed what was left while trying to fix it.

Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+2HOwACgkQ6YSQoMYUY94EJACgqZXdY+xM9nnYzWB2yfUzYrSl
VfUAoJe0I0e84iy22Riapx818DkHfRgb
=ADc8
-----END PGP SIGNATURE-----

      parent reply	other threads:[~2012-05-18  9:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16 15:48 [linux-lvm] lvreduce nightmare tariq wali
2012-05-17 23:13 ` Ray Morris
2012-05-18  0:21   ` Stuart D Gathman
2012-05-18  1:16   ` Andy Smith
2012-05-18 10:25   ` Bryn M. Reeves
2012-05-18 14:13     ` tariq wali
2012-05-19 15:58       ` Stuart D Gathman
2012-05-19 23:14       ` Andy Smith
2012-05-20  8:59         ` tariq wali
2012-05-20 19:45           ` Andy Smith
2012-05-21  9:02           ` Bryn M. Reeves
2012-05-20 21:39       ` Raptorfan
2012-05-18  9:57 ` Bryn M. Reeves [this message]

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=4FB61CED.6000309@redhat.com \
    --to=bmr@redhat.com \
    --cc=ganaiwali@gmail.com \
    --cc=linux-lvm@redhat.com \
    /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).