* [linux-lvm] Resizing a logical volume which is mounted (at /home)
@ 2012-01-16 13:06 Kiran Rao
2012-01-17 14:36 ` Males, Jess
0 siblings, 1 reply; 8+ messages in thread
From: Kiran Rao @ 2012-01-16 13:06 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]
To start off, here's an overview of my configuration. I'm dual-booting
Windows XP and Fedora Core 16. When I installed FC 16, here's how I created
the partitions:
1) Volume Group (vg_me) - ~73 GB
Out of this, the following are the logical volumes:
a) lvhome (mount point - /home) - ~48GB
b) lvroot (mount point - /) ~10GB
c) lvvar (mount point - /var) ~15GB
So, there's no free space left on the volume group.
Now, I feel the 48GB is not really necessary for the /home. I want to
redistribute the space among the 3 logical volumes within this VG, or
create a new one (/tech). In either case, I want to take the additional
space (around 20GB) from lvhome and give it to either / or to /tech.
Now, I tried the GUI (system-config-lvm) tool to do this. I can click on
lvhome and try to resize it. However, the problem is that since I am logged
in as a non-root user, the /home is mounted. Resizing requires one to
unmount it, but the unmount operation fails since I am mounted.
How do I work around this?
[-- Attachment #2: Type: text/html, Size: 1082 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Resizing a logical volume which is mounted (at /home)
2012-01-16 13:06 [linux-lvm] Resizing a logical volume which is mounted (at /home) Kiran Rao
@ 2012-01-17 14:36 ` Males, Jess
2012-01-19 2:50 ` Kiran Rao
0 siblings, 1 reply; 8+ messages in thread
From: Males, Jess @ 2012-01-17 14:36 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]
Log in as root:
- either once the system is completely booted, log in as root with the graphical prompt
- boot into single user mode. i.e. stop grub in its countdown, edit the boot configuration by appending single to the list of kernel parameters
Or, boot with a live CD/USB environment.
I would recommend this last option. Depending on the live environment, you might have to manually detect the volume group, but you're outside the installed system so you can change any logical volume without worry or conflict.
I would suggest the real lesson from all of this is: unless space constrained, never commit 100% of your vg. The whole point of abstracting your disk into lvm is for flexibility, and how can you have flexibility without a little spare disk to apportion later? I say this because you sound ready to slice X GB off lvhome and immediately commit it all to other logical volumes; keep some as spare.
-- Jess Males
From: linux-lvm-bounces@redhat.com [mailto:linux-lvm-bounces@redhat.com] On Behalf Of Kiran Rao
Sent: Monday, January 16, 2012 8:07 AM
To: linux-lvm@redhat.com
Subject: [linux-lvm] Resizing a logical volume which is mounted (at /home)
To start off, here's an overview of my configuration. I'm dual-booting Windows XP and Fedora Core 16. When I installed FC 16, here's how I created the partitions:
1) Volume Group (vg_me) - ~73 GB
Out of this, the following are the logical volumes:
a) lvhome (mount point - /home) - ~48GB
b) lvroot (mount point - /) ~10GB
c) lvvar (mount point - /var) ~15GB
So, there's no free space left on the volume group.
Now, I feel the 48GB is not really necessary for the /home. I want to redistribute the space among the 3 logical volumes within this VG, or create a new one (/tech). In either case, I want to take the additional space (around 20GB) from lvhome and give it to either / or to /tech.
Now, I tried the GUI (system-config-lvm) tool to do this. I can click on lvhome and try to resize it. However, the problem is that since I am logged in as a non-root user, the /home is mounted. Resizing requires one to unmount it, but the unmount operation fails since I am mounted.
How do I work around this?
[-- Attachment #2: Type: text/html, Size: 5871 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Resizing a logical volume which is mounted (at /home)
2012-01-17 14:36 ` Males, Jess
@ 2012-01-19 2:50 ` Kiran Rao
2012-01-19 5:43 ` Stuart D Gathman
2012-01-19 10:03 ` James Hawtin
0 siblings, 2 replies; 8+ messages in thread
From: Kiran Rao @ 2012-01-19 2:50 UTC (permalink / raw)
To: LVM general discussion and development
Thanks for the advice Jess.
Actually I am to blame for this. I did not properly understand the LVM
concept before doing this partitioning. I have lots of free space on
disk but that is *outside* the VG. Only later did I realize that the
whole point of having VGs is to have some free space *within* them!
On Tue, Jan 17, 2012 at 8:06 PM, Males, Jess <jmales@cio.sc.gov> wrote:
> Log in as root:
>
> -������������� either once the system is completely booted, log in as root
> with the graphical prompt
>
> -������������� boot into single user mode. i.e. stop grub in its countdown,
> edit the boot configuration by appending single to the list of kernel
> parameters
>
>
>
> Or, boot with a live CD/USB environment.
>
>
>
> I would recommend this last option.� Depending on the live environment, you
> might have to manually detect the volume group, but you�re outside the
> installed system so you can change any logical volume without worry or
> conflict.
>
>
>
> I would suggest the real lesson from all of this is: unless space
> constrained, never commit 100% of your vg.� The whole point of abstracting
> your disk into lvm is for flexibility, and how can you have flexibility
> without a little spare disk to apportion later?� I say this because you
> sound ready to slice X GB off lvhome and immediately commit it all to other
> logical volumes; keep some as spare.
>
>
>
>
>
> -- Jess Males
>
>
>
> From: linux-lvm-bounces@redhat.com [mailto:linux-lvm-bounces@redhat.com] On
> Behalf Of Kiran Rao
> Sent: Monday, January 16, 2012 8:07 AM
> To: linux-lvm@redhat.com
> Subject: [linux-lvm] Resizing a logical volume which is mounted (at /home)
>
>
>
> To start off, here's an overview of my configuration. I'm dual-booting
> Windows XP and Fedora Core 16. When I installed FC 16, here's how I created
> the partitions:
>
> 1) Volume Group (vg_me) - ~73 GB
>
> Out of this, the following are the logical volumes:
> a) lvhome (mount point - /home) - ~48GB
> b) lvroot (mount point - /) ~10GB
> c) lvvar (mount point - /var) ~15GB
>
> So, there's no free space left on the volume group.
>
> Now, I feel the 48GB is not really necessary for the /home. I want to
> redistribute the space among the 3 logical volumes within this VG, or create
> a new one (/tech).� In either case, I want to take the additional space
> (around 20GB) from lvhome and give it to either / or to /tech.
>
> Now, I tried the GUI (system-config-lvm) tool to do this. I can click on
> lvhome and try to resize it. However, the problem is that since I am logged
> in as a non-root user, the /home is mounted. Resizing requires one to
> unmount it, but the unmount operation fails since I am mounted.
>
> How do I work around this?
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Resizing a logical volume which is mounted (at /home)
2012-01-19 2:50 ` Kiran Rao
@ 2012-01-19 5:43 ` Stuart D Gathman
2012-01-19 10:03 ` James Hawtin
1 sibling, 0 replies; 8+ messages in thread
From: Stuart D Gathman @ 2012-01-19 5:43 UTC (permalink / raw)
To: linux-lvm
Long ago, Nostradamus foresaw that on 01/18/2012 09:50 PM, Kiran Rao
would write:
> Thanks for the advice Jess.
>
> Actually I am to blame for this. I did not properly understand the LVM
> concept before doing this partitioning. I have lots of free space on
> disk but that is *outside* the VG. Only later did I realize that the
> whole point of having VGs is to have some free space *within* them!
It is easy to add free space outside the VG to the VG. Just run
pvcreate on the partition, and vgextend to add it to the VG. Should you
wish to subsequently remove the PV from the VG, use pvmove to move all
LVs off of the PV, then vgreduce to remove the PV from the VG.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Resizing a logical volume which is mounted (at /home)
2012-01-19 2:50 ` Kiran Rao
2012-01-19 5:43 ` Stuart D Gathman
@ 2012-01-19 10:03 ` James Hawtin
1 sibling, 0 replies; 8+ messages in thread
From: James Hawtin @ 2012-01-19 10:03 UTC (permalink / raw)
To: LVM general discussion and development
Kiran Rao wrote:
> Thanks for the advice Jess.
>
> Actually I am to blame for this. I did not properly understand the LVM
> concept before doing this partitioning. I have lots of free space on
> disk but that is *outside* the VG. Only later did I realize that the
> whole point of having VGs is to have some free space *within* them!
>
>
Well that is easy then, if they free space is directly after your
current PV, you can just extend the partition in the partition table
then use PV resize to grow (cleaner but tricker),.
The Second thing "Easily" way you could do is create a new partition
using the free space, then create a PV on that, then extend the volume
group to also use that partition. Simplez
James
^ permalink raw reply [flat|nested] 8+ messages in thread
* [linux-lvm] Resizing a logical volume which is mounted (at /home)
@ 2012-01-16 13:21 Kiran Rao
2012-01-17 18:15 ` Stuart D. Gathman
0 siblings, 1 reply; 8+ messages in thread
From: Kiran Rao @ 2012-01-16 13:21 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]
To start off, here's an overview of my configuration. I'm dual-booting
Windows XP and Fedora Core 16. When I installed FC 16, here's how I created
the partitions:
1) Volume Group (vg_me) - ~73 GB
Out of this, the following are the logical volumes:
a) lvhome (mount point - /home) - ~48GB
b) lvroot (mount point - /) ~10GB
c) lvvar (mount point - /var) ~15GB
So, there's no free space left on the volume group.
Now, I feel the 48GB is not really necessary for the /home. I want to
redistribute the space among the 3 logical volumes within this VG, or
create a new one (/tech). In either case, I want to take the additional
space (around 20GB) from lvhome and give it to either / or to /tech.
Now, I tried the GUI (system-config-lvm) tool to do this. I can click on
lvhome and try to resize it. However, the problem is that since I am logged
in as a non-root user, the /home is mounted. Resizing requires one to
unmount it, but the unmount operation fails since I am mounted.
How do I work around this?
[-- Attachment #2: Type: text/html, Size: 1100 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Resizing a logical volume which is mounted (at /home)
2012-01-16 13:21 Kiran Rao
@ 2012-01-17 18:15 ` Stuart D. Gathman
2012-01-18 2:45 ` Kiran Rao
0 siblings, 1 reply; 8+ messages in thread
From: Stuart D. Gathman @ 2012-01-17 18:15 UTC (permalink / raw)
To: LVM general discussion and development
Long ago, Nostradamus foresaw that on Jan 16, Kiran Rao would write:
> Now, I tried the GUI (system-config-lvm) tool to do this. I can click on
> lvhome and try to resize it. However, the problem is that since I am logged
> in as a non-root user, the /home is mounted. Resizing requires one to
> unmount it, but the unmount operation fails since I am mounted.
>
> How do I work around this?
Log out of GUI
Switch to text console (on linux try Ctrl-Alt-F3 for vt3)
Login as root
Unmount /home
resize2fs <device-for-home>
# WARNING! Make sure lvresize size is >= resize2fs size. If you aren't
# sure about the units, make lvresize larger than you think you made
# the filesystem. You can always expand the filesystems again, but
# you can't undo shrinking the LV too far.
lvresize <device-for-home>
mount /home
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [linux-lvm] Resizing a logical volume which is mounted (at /home)
2012-01-17 18:15 ` Stuart D. Gathman
@ 2012-01-18 2:45 ` Kiran Rao
0 siblings, 0 replies; 8+ messages in thread
From: Kiran Rao @ 2012-01-18 2:45 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]
Thanks Stuart.
That's what I did finally. Logged in as root in the console (in fact I
booted into recovery mode from GRUB in order to do this).
Also, to ensure that the underlying file system is also resized
accordingly, I used the -r option.
lvresize -r -L-20G vgme/lvhome
lvresize -r -L+20G vgme/lvroot
That did the trick. Thanks.
On Tue, Jan 17, 2012 at 11:45 PM, Stuart D. Gathman <stuart@bmsi.com> wrote:
> Long ago, Nostradamus foresaw that on Jan 16, Kiran Rao would write:
>
> Now, I tried the GUI (system-config-lvm) tool to do this. I can click on
>> lvhome and try to resize it. However, the problem is that since I am
>> logged
>> in as a non-root user, the /home is mounted. Resizing requires one to
>> unmount it, but the unmount operation fails since I am mounted.
>>
>> How do I work around this?
>>
>
> Log out of GUI
> Switch to text console (on linux try Ctrl-Alt-F3 for vt3)
> Login as root Unmount /home
> resize2fs <device-for-home>
> # WARNING! Make sure lvresize size is >= resize2fs size. If you aren't
> # sure about the units, make lvresize larger than you think you made
> # the filesystem. You can always expand the filesystems again, but
> # you can't undo shrinking the LV too far.
> lvresize <device-for-home>
> mount /home
>
> --
> Stuart D. Gathman <stuart@bmsi.com>
> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
> "Confutatis maledictis, flammis acribus addictis" - background song for
> a Microsoft sponsored "Where do you want to go from here?" commercial.
>
> ______________________________**_________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/**mailman/listinfo/linux-lvm<https://www.redhat.com/mailman/listinfo/linux-lvm>
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-**HOWTO/<http://tldp.org/HOWTO/LVM-HOWTO/>
>
[-- Attachment #2: Type: text/html, Size: 2625 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-01-19 10:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 13:06 [linux-lvm] Resizing a logical volume which is mounted (at /home) Kiran Rao
2012-01-17 14:36 ` Males, Jess
2012-01-19 2:50 ` Kiran Rao
2012-01-19 5:43 ` Stuart D Gathman
2012-01-19 10:03 ` James Hawtin
-- strict thread matches above, loose matches on Subject: below --
2012-01-16 13:21 Kiran Rao
2012-01-17 18:15 ` Stuart D. Gathman
2012-01-18 2:45 ` Kiran Rao
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).