* [linux-lvm] Automatically GROW an LV to max size
@ 2002-01-23 19:24 Tracy R Reed
2002-01-23 19:31 ` Steve Wray
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Tracy R Reed @ 2002-01-23 19:24 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 965 bytes --]
I'm the system administrator for MP3.com. I talked to some Sistina
developers who visited the office a year or so ago but don't recall their
names now, sorry. One if the things I asked for in LVM (and would still
like to see) is a switch to create an LV that is as big as the remaining
disk space available.
We have a redhat based kickstart install that sets up a basic / and then
creates an LV out of the rest of the disk. Currently we have hard coded
the size of the remaining disk but it would be really slick if we could
just pass an option to lvcreate which would just create an lv with the
most space possible.
Right now if we ever install on anything other than one of our standard
36G disks we have to delete the lv that was made and resize it or if the
disk is smaller than 36G the hard coded lvcreate size will fail due to
lack of space.
There's got to be a cleaner way to do it.
--
Tracy Reed http://www.ultraviolet.org
[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [linux-lvm] Automatically GROW an LV to max size
2002-01-23 19:24 [linux-lvm] Automatically GROW an LV to max size Tracy R Reed
@ 2002-01-23 19:31 ` Steve Wray
2002-01-23 20:15 ` Markus Dobel
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Steve Wray @ 2002-01-23 19:31 UTC (permalink / raw)
To: linux-lvm
I imagine this would be fairly easy to do with a script?
Check the size with fdisk, then pass that along to
the lvm tools.
Perl should be able to handle that?
This is a suggestion only, I'm no programmer!
8-)
> -----Original Message-----
> From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> Behalf Of Tracy R Reed
> Sent: Thursday, 24 January 2002 2:24 p.m.
> To: linux-lvm@sistina.com
> Subject: [linux-lvm] Automatically GROW an LV to max size
>
>
> I'm the system administrator for MP3.com. I talked to some Sistina
> developers who visited the office a year or so ago but don't recall their
> names now, sorry. One if the things I asked for in LVM (and would still
> like to see) is a switch to create an LV that is as big as the remaining
> disk space available.
>
> We have a redhat based kickstart install that sets up a basic / and then
> creates an LV out of the rest of the disk. Currently we have hard coded
> the size of the remaining disk but it would be really slick if we could
> just pass an option to lvcreate which would just create an lv with the
> most space possible.
>
> Right now if we ever install on anything other than one of our standard
> 36G disks we have to delete the lv that was made and resize it or if the
> disk is smaller than 36G the hard coded lvcreate size will fail due to
> lack of space.
>
> There's got to be a cleaner way to do it.
>
> --
> Tracy Reed http://www.ultraviolet.org
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [linux-lvm] Automatically GROW an LV to max size
2002-01-23 19:24 [linux-lvm] Automatically GROW an LV to max size Tracy R Reed
2002-01-23 19:31 ` Steve Wray
@ 2002-01-23 20:15 ` Markus Dobel
2002-02-04 12:46 ` [linux-lvm] I/O Error removing a file John Moser
2002-01-23 20:26 ` [linux-lvm] Automatically GROW an LV to max size Petro
2002-01-24 6:36 ` Heinz J . Mauelshagen
3 siblings, 1 reply; 11+ messages in thread
From: Markus Dobel @ 2002-01-23 20:15 UTC (permalink / raw)
To: linux-lvm
On Wed, Jan 23, 2002 at 05:23:46PM -0800, Tracy R Reed wrote:
>
> We have a redhat based kickstart install that sets up a basic / and then
> creates an LV out of the rest of the disk. Currently we have hard coded
> the size of the remaining disk but it would be really slick if we could
> just pass an option to lvcreate which would just create an lv with the
> most space possible.
>
[...]
>
> There's got to be a cleaner way to do it.
Maybe not cleaner, but more flexible (and as it's only used for an
installer, where the output of vgdisplay is kind of defined, maybe
usable):
--- snip ---
#!/bin/bash
VG="vg0" # Name of the volume group
LV="data" # Name of the logical vol.
FREE_PEs=$(vgdisplay $VG|grep "^Free PE"|sed "s/^[a-zA-Z /]\+\([0-9]\+\).*/\\1/")
lvcreate -l $FREE_PEs -n $LV $VG
--- snip ---
You may want to doublecheck the regex before using this. And yes, a
switch in lvmcreate would be nicer, too. Just in case, you need a
solution *now*.
Regards, Markus
--
Free the Fluffy Bunny.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [linux-lvm] Automatically GROW an LV to max size
2002-01-23 19:24 [linux-lvm] Automatically GROW an LV to max size Tracy R Reed
2002-01-23 19:31 ` Steve Wray
2002-01-23 20:15 ` Markus Dobel
@ 2002-01-23 20:26 ` Petro
2002-01-24 6:36 ` Heinz J . Mauelshagen
3 siblings, 0 replies; 11+ messages in thread
From: Petro @ 2002-01-23 20:26 UTC (permalink / raw)
To: linux-lvm
On Wed, Jan 23, 2002 at 05:23:46PM -0800, Tracy R Reed wrote:
> I'm the system administrator for MP3.com. I talked to some Sistina
> developers who visited the office a year or so ago but don't recall
> their
> names now, sorry. One if the things I asked for in LVM (and would still
> like to see) is a switch to create an LV that is as big as the remaining
> disk space available.
> We have a redhat based kickstart install that sets up a basic / and then
> creates an LV out of the rest of the disk. Currently we have hard coded
> the size of the remaining disk but it would be really slick if we could
> just pass an option to lvcreate which would just create an lv with the
> most space possible.
> Right now if we ever install on anything other than one of our standard
> 36G disks we have to delete the lv that was made and resize it or if the
> disk is smaller than 36G the hard coded lvcreate size will fail due to
> lack of space.
> There's got to be a cleaner way to do it.
It's been almost a year since I was inside kickstart, but you should
be able to customize the script to read the remaining disk space,
then call lvcreate with a variable.
--
Share and Enjoy.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [linux-lvm] Automatically GROW an LV to max size
2002-01-23 19:24 [linux-lvm] Automatically GROW an LV to max size Tracy R Reed
` (2 preceding siblings ...)
2002-01-23 20:26 ` [linux-lvm] Automatically GROW an LV to max size Petro
@ 2002-01-24 6:36 ` Heinz J . Mauelshagen
3 siblings, 0 replies; 11+ messages in thread
From: Heinz J . Mauelshagen @ 2002-01-24 6:36 UTC (permalink / raw)
To: linux-lvm
Tracy,
here's a simple script with a CL check to cut what you want.
Regards,
Heinz -- The LVM Guy --
#!/bin/sh
cmd=`basename $0`
if [ $# -ne 1 ]; then
echo -e "$cmd -- please call with just one logical volume path\n"
exit 1
fi
LVNAME=$1
VGNAME=`echo $LVNAME|sed 's!/dev/!!;s!/.*$!!'`
FREE_PE=`vgdisplay $VGNAME|sed '/Free.*PE/!d;s!^.*Size !!;s!^ *!!;s! .*$!!'`
lvextend -l+$FREE_PE $LVNAME
On Wed, Jan 23, 2002 at 05:23:46PM -0800, Tracy R Reed wrote:
> I'm the system administrator for MP3.com. I talked to some Sistina
> developers who visited the office a year or so ago but don't recall their
> names now, sorry. One if the things I asked for in LVM (and would still
> like to see) is a switch to create an LV that is as big as the remaining
> disk space available.
>
> We have a redhat based kickstart install that sets up a basic / and then
> creates an LV out of the rest of the disk. Currently we have hard coded
> the size of the remaining disk but it would be really slick if we could
> just pass an option to lvcreate which would just create an lv with the
> most space possible.
>
> Right now if we ever install on anything other than one of our standard
> 36G disks we have to delete the lv that was made and resize it or if the
> disk is smaller than 36G the hard coded lvcreate size will fail due to
> lack of space.
>
> There's got to be a cleaner way to do it.
>
> --
> Tracy Reed http://www.ultraviolet.org
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
Mauelshagen@Sistina.com +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 11+ messages in thread
* [linux-lvm] I/O Error removing a file
2002-01-23 20:15 ` Markus Dobel
@ 2002-02-04 12:46 ` John Moser
2002-02-05 3:59 ` Heinz J . Mauelshagen
0 siblings, 1 reply; 11+ messages in thread
From: John Moser @ 2002-02-04 12:46 UTC (permalink / raw)
To: linux-lvm
I encountered what I was able to diagnose as a hardware error on one of the
hard drives in my system. In order to make sure my data was safe, I added
an additional drive, and performed a pvmove of the data onto the healthy
drive (moving all the PE's off the bad disk). That all went fairly well
(except for taking forever).
However, I still have a few files which are giving me troubles.
root@vpn:/home/vpnwork# rm -R TestData2k
rm: cannot remove `TestData2k': Input/output error
Is there a way to remove these files so that I can recreate them? I'm using
LVM version 1.0.1-rc4, on a Linux kernel 2.5.0.
Thanks,
-John Moser
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [linux-lvm] I/O Error removing a file
2002-02-04 12:46 ` [linux-lvm] I/O Error removing a file John Moser
@ 2002-02-05 3:59 ` Heinz J . Mauelshagen
2002-02-05 10:38 ` John Moser
0 siblings, 1 reply; 11+ messages in thread
From: Heinz J . Mauelshagen @ 2002-02-05 3:59 UTC (permalink / raw)
To: linux-lvm
On Mon, Feb 04, 2002 at 12:48:34PM -0600, John Moser wrote:
> I encountered what I was able to diagnose as a hardware error on one of the
> hard drives in my system. In order to make sure my data was safe, I added
> an additional drive, and performed a pvmove of the data onto the healthy
> drive (moving all the PE's off the bad disk). That all went fairly well
> (except for taking forever).
>
> However, I still have a few files which are giving me troubles.
>
> root@vpn:/home/vpnwork# rm -R TestData2k
> rm: cannot remove `TestData2k': Input/output error
John,
so you don't have PEs allocated on the failed drive any longer?
If so, this looks like you still have another hardware flaw (cables?)
or a bug in 2.5.
What does "fsck -f" say about your filesystem?
>
> Is there a way to remove these files so that I can recreate them? I'm using
> LVM version 1.0.1-rc4, on a Linux kernel 2.5.0.
>
> Thanks,
> -John Moser
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
--
Regards,
Heinz -- The LVM Guy --
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
Mauelshagen@Sistina.com +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [linux-lvm] I/O Error removing a file
2002-02-05 3:59 ` Heinz J . Mauelshagen
@ 2002-02-05 10:38 ` John Moser
2002-02-20 15:37 ` [linux-lvm] Partition resizing and whatnot John Moser
0 siblings, 1 reply; 11+ messages in thread
From: John Moser @ 2002-02-05 10:38 UTC (permalink / raw)
To: linux-lvm
Needless to say, I forgot to run fsck one last time. ;) That removed the
illegal inodes, and the files along with it. Problem solved.
I guess in the IT field, writing emails to support lists sometimes is all
you need to inspire the proper solution.
-John
-----Original Message-----
From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
Behalf Of Heinz J . Mauelshagen
Sent: Tuesday, February 05, 2002 3:59 AM
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] I/O Error removing a file
On Mon, Feb 04, 2002 at 12:48:34PM -0600, John Moser wrote:
> I encountered what I was able to diagnose as a hardware error on one of
the
> hard drives in my system. In order to make sure my data was safe, I added
> an additional drive, and performed a pvmove of the data onto the healthy
> drive (moving all the PE's off the bad disk). That all went fairly well
> (except for taking forever).
>
> However, I still have a few files which are giving me troubles.
>
> root@vpn:/home/vpnwork# rm -R TestData2k
> rm: cannot remove `TestData2k': Input/output error
John,
so you don't have PEs allocated on the failed drive any longer?
If so, this looks like you still have another hardware flaw (cables?)
or a bug in 2.5.
What does "fsck -f" say about your filesystem?
>
> Is there a way to remove these files so that I can recreate them? I'm
using
> LVM version 1.0.1-rc4, on a Linux kernel 2.5.0.
>
> Thanks,
> -John Moser
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
--
Regards,
Heinz -- The LVM Guy --
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
Mauelshagen@Sistina.com +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-
_______________________________________________
linux-lvm mailing list
linux-lvm@sistina.com
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* [linux-lvm] Partition resizing and whatnot
2002-02-05 10:38 ` John Moser
@ 2002-02-20 15:37 ` John Moser
2002-02-20 17:31 ` Andreas Dilger
2002-02-21 2:57 ` William Blunn
0 siblings, 2 replies; 11+ messages in thread
From: John Moser @ 2002-02-20 15:37 UTC (permalink / raw)
To: linux-lvm
So, after installation the ATA update patches that people recommended, I now
have a linux system that recognizes the full 160 gigabytes of disk space on
my disks. However, I'm not entirely sure as to how I should go about
resizing my filesystem. I'm already well aquanted with adding disks to
existing filesystems and growing them. However, what are the recommended
steps for taking existing disk partitions, resizing them to fill the disks
they reside on, and then resizing the LVM/e2fs filesystems that use those
disks?
Any help would be appreciated (preferably step by step if you can manage).
Thanks,
-John Moser
--------------------------------
University of Wisconsin-Madison
Engine Research Center, Rm. 1011
Engineering Research
263-2761
Systems Administrator
jmoser@erc.wisc.edu
--------------------------------
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [linux-lvm] Partition resizing and whatnot
2002-02-20 15:37 ` [linux-lvm] Partition resizing and whatnot John Moser
@ 2002-02-20 17:31 ` Andreas Dilger
2002-02-21 2:57 ` William Blunn
1 sibling, 0 replies; 11+ messages in thread
From: Andreas Dilger @ 2002-02-20 17:31 UTC (permalink / raw)
To: John Moser; +Cc: linux-lvm
On Feb 20, 2002 15:40 -0600, John Moser wrote:
> So, after installation the ATA update patches that people recommended, I now
> have a linux system that recognizes the full 160 gigabytes of disk space on
> my disks. However, I'm not entirely sure as to how I should go about
> resizing my filesystem. I'm already well aquanted with adding disks to
> existing filesystems and growing them. However, what are the recommended
> steps for taking existing disk partitions, resizing them to fill the disks
> they reside on, and then resizing the LVM/e2fs filesystems that use those
> disks?
With the current LVM setup, you are probably just as well off to create a
new partition on the remaining space, make it a PV, and then use the PEs
as you see fit. Anything else means binary editing of PV and VG structs
at this point, so you probably don't want to do it...
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [linux-lvm] Partition resizing and whatnot
2002-02-20 15:37 ` [linux-lvm] Partition resizing and whatnot John Moser
2002-02-20 17:31 ` Andreas Dilger
@ 2002-02-21 2:57 ` William Blunn
1 sibling, 0 replies; 11+ messages in thread
From: William Blunn @ 2002-02-21 2:57 UTC (permalink / raw)
To: linux-lvm; +Cc: John Moser
John Moser <jmoser@erc.wisc.edu> wrote:
> So, after installation the ATA update patches that people recommended,
> I now have a linux system that recognizes the full 160 gigabytes of
> disk space on my disks. However, I'm not entirely sure as to how I
> should go about resizing my filesystem. I'm already well aquanted
> with adding disks to existing filesystems and growing them.
??? You can't add a disk to a filesystem.
You can put a PV on a disk and add that to a VG.
(Or, possibly, you could add a disk to the end of a linear MD group,
although this would be pointless with LVM.)
> However, what are the recommended steps for taking existing disk
> partitions, resizing them to fill the disks they reside on,
I wouldn't recommend trying to go down this path:
Resizing the partitions would be no problem, just use fdisk to delete
the existing partition and create a new one with the same start point,
but with a higher end point. The problem would be resizing the PVs,
which I don't think is supported. So I don't think it would be a good
idea to go down this path.
Surely the obvious way to do it is:
(a) Using fdisk, create new partition(s) in the newly-usable tail end(s)
of your disk(s)
(b) *** Re-boot. The kernel cannot re-interpret a partition table if any
of the partitions are in use. In all probability you will have
partitions in use on that/those disk(s) so you will need to re-boot
to make the kernel re-interpret the partition table(s).
(b) create PVs in the new partitions (pvcreate)
(c) add the PVs to your VG(s) (vgextend)
Your VG will then be larger by the amount of PEs which could be fitted
into the new PVs in the new partitions. You can then extend your LVs at
your leisure.
You will probably lose a tiny bit at the end of the existing partitions,
and you may be able to fit one less PE in your new partition(s), because
the size of your existing partitions will probably not be exact
multiples of the PE size, but it's not worth worrying about.
> and then resizing the LVM/e2fs filesystems that use those disks?
??? Unrelated ? This is all basic stuff to do with LV side. Just follow
the documentation: umount ... / e2fsadm ... / mount ... . (Just make
sure you have a suitably up-to-date version of ext2resize; I use version
1.1.17.)
Regards,
Bill
--
William H. Blunn - bill+linuxlvm@tao-group.com
Tao
62/63 Suttons Business Park, Earley, READING, RG6 1AZ, United Kingdom
Tel: +44 118 901 2999 - Fax: +44 118 901 2963 - http://tao-group.com/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-02-21 2:57 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-23 19:24 [linux-lvm] Automatically GROW an LV to max size Tracy R Reed
2002-01-23 19:31 ` Steve Wray
2002-01-23 20:15 ` Markus Dobel
2002-02-04 12:46 ` [linux-lvm] I/O Error removing a file John Moser
2002-02-05 3:59 ` Heinz J . Mauelshagen
2002-02-05 10:38 ` John Moser
2002-02-20 15:37 ` [linux-lvm] Partition resizing and whatnot John Moser
2002-02-20 17:31 ` Andreas Dilger
2002-02-21 2:57 ` William Blunn
2002-01-23 20:26 ` [linux-lvm] Automatically GROW an LV to max size Petro
2002-01-24 6:36 ` Heinz J . Mauelshagen
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).