From: Brian McCullough <bdmc@bdmcc-us.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [LINUX-LVM] shrinking a volume inside an LVM
Date: Fri, 4 Jan 2008 14:38:19 -0500 [thread overview]
Message-ID: <20080104193819.GA2021@bdmcc-us.com> (raw)
In-Reply-To: <F61B3F3722111146AF452DF29FDCCF5F038D1BD6@xchg03.bolivar.k12.mo.us>
On Fri, Jan 04, 2008 at 01:07:42PM -0600, Kemp, Levi wrote:
> I'm sure it's been asked before, but I must be terrible at searching because I cannot find the answer. I have, like many, followed defaults and ended up wiht a boot partion and a lvm. Inside the lvm is a / and a swap. I'd like to shrink the / so that I can do another install of a different distro without upsetting my current one. I don't have another computer, or equal setup to run my test on and cannot take this one down yet either. If it's impossible let me know, but either way thanks for the help.
This is relatively easy, as long as you are careful.
First, which filesystem format are you using? I will base my answer on
ext2/ext3, because that's what I am most familiar with, others can
answer better if you have something else.
Second, I presume from your question that / is not full.
1. Boot with a Rescue Disk or Live CD ( you need to make sure that your
LVM is not Live and being used. )
2. Start a terminal window and run:
3. vgchange -a y
4. e2fsck -f /dev/"volgroupname"/"volname of '/'" ( you can fill in the
blanks )
5. mkdir /mnt1
6. mount /dev/"volgroupname"/"volname of '/'" /mnt1
7. df ( check the amount of space occupied in / )
8. umount /mnt1
9. resize2fs /dev/"volgroupname"/"volname of '/'" "amount occupied +
some"
10. lvreduce -L "size from 9" /dev/"volgroupname"/"volname of '/'"
( If you want to be extra paranoid, you can add a "-t" parameter once,
and then run it without. )
11. resize2fs /dev/"volgroupname"/"volname of '/'"
( This will adjust the filesystem to fit the Logical Volume. )
At this point, you should have a smaller / volume and some free space.
Note that resize2fs will insist on the e2fsck, and may require it more
often than I have shown.
I have put in a couple of paranoia steps, such as 6-8, to make sure that
you are using the correct sizes in the next couple of steps.
Have fun!
Brian
next prev parent reply other threads:[~2008-01-04 19:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <F61B3F3722111146AF452DF29FDCCF5F038D1BD3@xchg03.bolivar.k12.mo.us>
2008-01-04 19:07 ` [LINUX-LVM] shrinking a volume inside an LVM Kemp, Levi
2008-01-04 19:38 ` Brian McCullough [this message]
2008-01-04 20:50 ` Kemp, Levi
2008-01-04 20:59 ` Stuart D. Gathman
2008-01-04 21:58 ` Kemp, Levi
2008-01-05 6:37 ` Brian McCullough
2008-01-05 6:35 ` Brian McCullough
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=20080104193819.GA2021@bdmcc-us.com \
--to=bdmc@bdmcc-us.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.