All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Converting my Root file system to LVM
@ 2001-05-22 16:02 Rupert Heesom
  2001-05-22 16:22 ` Rupert Heesom
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Rupert Heesom @ 2001-05-22 16:02 UTC (permalink / raw)
  To: linux-lvm

I've been practicing LVM techniques on a spare 2nd disk which I'm adding
to my root file system using LVM.  I think I've got the hang of how LVs,
PVs, and VGs work.

I've followed the lvm-howto on how to create a root filesystem.

I've created a partition on the 2nd disk (/dev/sdb1), converted it to a
PV.

I've created a VG (/dev/vg) & LV (/dev/vg/root) on that disk.

I've copied the contents of my non-LVM root partition over to the LV -
(find / -xdev | cpio -pvmd /mnt/tmp)

I've moved /etc/lilo.conf to my /boot partition, and created a symlink
to /boot/lilo.conf in /etc.

I've created an initial RAMdisk on /boot -  (/boot/initrd-lvm-2.4.3.gz).
I created one RAM disk initially to see how it worked, then ran the
"lvmcreate_initrd" again once my LVol was created (and the files copied
across).

I've altered my lilo.conf to look like - .....

[rupert@localhost rupert]$cat /etc/lilo.conf
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
linear
default=linux-2_4
message=/boot/message

image=/boot/vmlinuz-2.2.16-22
	label=linux-2_2
	initrd=/boot/initrd-2.2.16-22.img
	read-only
	root=/dev/sda5
	append="mem=384M"

image=/boot/vmlinuz-2.4.3
	label=linux-2_4
	read-only
	root=/dev/sda5
	append="mem=384M"

image=/boot/vmlinuz-2.4.3
	initrd=/boot/initrd-lvm-2.4.3.gz
	root=/dev/vg/root
	label=lvm
	append="mem=384M ramdisk_size=8192"

#image=/usr/src/linux/arch/i386/boot/bzImage
#	label=linux_test
#	read-only
#	root=/dev/sda5
#	append="mem=384M"


...... And I've run lilo of course.



Now, when I boot up into the LVM partition, I get the following error
msgs -

lvm - Module successfully initialised.
/sbin/vgscan: sed: command not found.
/sbin/vgscan: /lib/lvm-iop10/: is a directory
/sbin/vgscan: exec: /lib/lvm-iop10/: cannot execute:  permission denied.

/sbin/vgchange:  <same msgs>

Obviously the kernel can't find the LVM tools.  Would these not be
included in the lvm initrd?  If they are, and the kernel still can't
find them, what do I change so that the kernel CAN find the LVM tools?

Tnx for any help.

I'M NEARLY THERE!!

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 16:02 [linux-lvm] Converting my Root file system to LVM Rupert Heesom
@ 2001-05-22 16:22 ` Rupert Heesom
  2001-05-22 22:56 ` Steve Wray
  2001-05-22 23:25 ` [linux-lvm] Converting my Root file system to LVM Andreas Dilger
  2 siblings, 0 replies; 26+ messages in thread
From: Rupert Heesom @ 2001-05-22 16:22 UTC (permalink / raw)
  To: linux-lvm

Having looked at another thread also with Root boot problems, I've had a
look at my kernel (2.4.3) .config file options for the initrd.  Since my
lilo.conf file has the RAM disk size set to 8192, would the kernel
setting (4096) get in the way of this?

CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y


On 22 May 2001 12:02:03 -0400, Rupert Heesom wrote:
> I've been practicing LVM techniques on a spare 2nd disk which I'm adding
> to my root file system using LVM.  I think I've got the hang of how LVs,
> PVs, and VGs work.

> 
> Now, when I boot up into the LVM partition, I get the following error
> msgs -
> 
> lvm - Module successfully initialised.
> /sbin/vgscan: sed: command not found.
> /sbin/vgscan: /lib/lvm-iop10/: is a directory
> /sbin/vgscan: exec: /lib/lvm-iop10/: cannot execute:  permission denied.
> 
> /sbin/vgchange:  <same msgs>
> 
> Obviously the kernel can't find the LVM tools.  Would these not be
> included in the lvm initrd?  If they are, and the kernel still can't
> find them, what do I change so that the kernel CAN find the LVM tools?

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 16:02 [linux-lvm] Converting my Root file system to LVM Rupert Heesom
  2001-05-22 16:22 ` Rupert Heesom
@ 2001-05-22 22:56 ` Steve Wray
  2001-05-22 23:53   ` Rupert Heesom
  2001-05-22 23:25 ` [linux-lvm] Converting my Root file system to LVM Andreas Dilger
  2 siblings, 1 reply; 26+ messages in thread
From: Steve Wray @ 2001-05-22 22:56 UTC (permalink / raw)
  To: linux-lvm

AHA!
you too, huh?
You'll have to add sed to the initial ramdisk.

Its in /boot/initrd<something>.gz
unzip it and mount it with
mount -o loop /boot/initrd<something> /mnt/<somewhere>

then simply 
cp /bin/sed /mnt/<somewhere>/bin/

then unmount it, re-gzip it and away you go!

And what *I'd* like to know is why isn't sed on the 
initrd in the first plade if the scripts need it??


> -----Original Message-----
> From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> Behalf Of Rupert Heesom
> Sent: Wednesday, May 23, 2001 4:02 AM
> To: linux-lvm@sistina.com
> Subject: [linux-lvm] Converting my Root file system to LVM
> 
> 
> I've been practicing LVM techniques on a spare 2nd disk which I'm adding
> to my root file system using LVM.  I think I've got the hang of how LVs,
> PVs, and VGs work.
> 
> I've followed the lvm-howto on how to create a root filesystem.
> 
> I've created a partition on the 2nd disk (/dev/sdb1), converted it to a
> PV.
> 
> I've created a VG (/dev/vg) & LV (/dev/vg/root) on that disk.
> 
> I've copied the contents of my non-LVM root partition over to the LV -
> (find / -xdev | cpio -pvmd /mnt/tmp)
> 
> I've moved /etc/lilo.conf to my /boot partition, and created a symlink
> to /boot/lilo.conf in /etc.
> 
> I've created an initial RAMdisk on /boot -  (/boot/initrd-lvm-2.4.3.gz).
> I created one RAM disk initially to see how it worked, then ran the
> "lvmcreate_initrd" again once my LVol was created (and the files copied
> across).
> 
> I've altered my lilo.conf to look like - .....
> 
> [rupert@localhost rupert]$cat /etc/lilo.conf
> boot=/dev/sda
> map=/boot/map
> install=/boot/boot.b
> prompt
> timeout=50
> linear
> default=linux-2_4
> message=/boot/message
> 
> image=/boot/vmlinuz-2.2.16-22
> 	label=linux-2_2
> 	initrd=/boot/initrd-2.2.16-22.img
> 	read-only
> 	root=/dev/sda5
> 	append="mem=384M"
> 
> image=/boot/vmlinuz-2.4.3
> 	label=linux-2_4
> 	read-only
> 	root=/dev/sda5
> 	append="mem=384M"
> 
> image=/boot/vmlinuz-2.4.3
> 	initrd=/boot/initrd-lvm-2.4.3.gz
> 	root=/dev/vg/root
> 	label=lvm
> 	append="mem=384M ramdisk_size=8192"
> 
> #image=/usr/src/linux/arch/i386/boot/bzImage
> #	label=linux_test
> #	read-only
> #	root=/dev/sda5
> #	append="mem=384M"
> 
> 
> ...... And I've run lilo of course.
> 
> 
> 
> Now, when I boot up into the LVM partition, I get the following error
> msgs -
> 
> lvm - Module successfully initialised.
> /sbin/vgscan: sed: command not found.
> /sbin/vgscan: /lib/lvm-iop10/: is a directory
> /sbin/vgscan: exec: /lib/lvm-iop10/: cannot execute:  permission denied.
> 
> /sbin/vgchange:  <same msgs>
> 
> Obviously the kernel can't find the LVM tools.  Would these not be
> included in the lvm initrd?  If they are, and the kernel still can't
> find them, what do I change so that the kernel CAN find the LVM tools?
> 
> Tnx for any help.
> 
> I'M NEARLY THERE!!
> 
> -- 
> regs
> rupert
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 16:02 [linux-lvm] Converting my Root file system to LVM Rupert Heesom
  2001-05-22 16:22 ` Rupert Heesom
  2001-05-22 22:56 ` Steve Wray
@ 2001-05-22 23:25 ` Andreas Dilger
  2001-05-23 13:14   ` Michael Tokarev
  2 siblings, 1 reply; 26+ messages in thread
From: Andreas Dilger @ 2001-05-22 23:25 UTC (permalink / raw)
  To: linux-lvm

Rupert Heesom writes:
> Now, when I boot up into the LVM partition, I get the following error
> msgs -
> 
> lvm - Module successfully initialised.
> /sbin/vgscan: sed: command not found.
> /sbin/vgscan: /lib/lvm-iop10/: is a directory
> /sbin/vgscan: exec: /lib/lvm-iop10/: cannot execute:  permission denied.
> 
> /sbin/vgchange:  <same msgs>
> 
> Obviously the kernel can't find the LVM tools.  Would these not be
> included in the lvm initrd?  If they are, and the kernel still can't
> find them, what do I change so that the kernel CAN find the LVM tools?

No, the problem is in the wrapper script for the LVM tools.  It is using
"sed" in the script, but that is not on the initrd.  I don't see sed in
my LVM wrapper script, so you must have a different one.  Either fix the
wrapper script (edit /sbin/vgscan should be enough), or add "sed" to the
list of required files, INITRDFILES, in lvmcreate_initrd.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 22:56 ` Steve Wray
@ 2001-05-22 23:53   ` Rupert Heesom
  2001-05-23  4:01     ` Steve Wray
  2001-05-23 16:49     ` Andreas Dilger
  0 siblings, 2 replies; 26+ messages in thread
From: Rupert Heesom @ 2001-05-22 23:53 UTC (permalink / raw)
  To: linux-lvm

Many thanks for the 2 replies!

Well, since I had the same problem as Steve, I implemented his solution.

Tnx, Steve for the easy howto of your's below.
BTW, what on earth is that "mount -o loop" command?

As I tap on my keyboard, I am working inside of my new LVol, so it
worked, guys!

Since my LVol is on my 2nd disk, next, I think I'll try extending my
Lvol back to cover my 1st disk as well.

One more bit of help, if you can? -

I want to pvmove the file contents of my 2nd disk (/dev/sdb) to my 1st
disk (/dev/sda).  My 1st disk is nice & quiet!  Now the lvm-howto
specifies my next step (adding the "old partition" into the Lvol) as --

pvcreate /dev/sda   <using my device names>
vgextend vg /dev/sda

---  Seeing as I want to do a pvmove of data from /dev/sdb to /dev/sda,
when would I do the pvmove?   As I understand LVM, I need to have the PV
created and integrated into the VG before I can use pvmove - is this
correct?   Then, once pvmove is used, I can then extend the LV & file
system to cover both PVs using e2fsadm, right?


On 23 May 2001 10:56:39 +1200, Steve Wray wrote:
> AHA!
> you too, huh?
> You'll have to add sed to the initial ramdisk.
> 
> Its in /boot/initrd<something>.gz
> unzip it and mount it with
> mount -o loop /boot/initrd<something> /mnt/<somewhere>
> 
> then simply 
> cp /bin/sed /mnt/<somewhere>/bin/
> 
> then unmount it, re-gzip it and away you go!
> 
> And what *I'd* like to know is why isn't sed on the 
> initrd in the first plade if the scripts need it??

Well, it seems not all had the same problem, so I don't know!!??

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 23:53   ` Rupert Heesom
@ 2001-05-23  4:01     ` Steve Wray
  2001-05-23  5:03       ` S. Michael Denton
  2001-05-23 13:14       ` [linux-lvm] Converting my Root file system to LVM Rupert Heesom
  2001-05-23 16:49     ` Andreas Dilger
  1 sibling, 2 replies; 26+ messages in thread
From: Steve Wray @ 2001-05-23  4:01 UTC (permalink / raw)
  To: linux-lvm

> From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> Behalf Of Rupert Heesom

> Tnx, Steve for the easy howto of your's below.
> BTW, what on earth is that "mount -o loop" command?

Glad to have helped!
the "-o loop" tells mount to mount the file on the loopback device.
This allows ordinary files (not just block devices) to carry a filesystem.
Its quite cool!
:)

 
> Since my LVol is on my 2nd disk, next, I think I'll try extending my
> Lvol back to cover my 1st disk as well.

Just watch out for your /boot parition.
You might want to copy lilo.conf over to the /boot partition
and make /etc/lilo.conf a symlink to it there.

 
> One more bit of help, if you can? -
> 
> I want to pvmove the file contents of my 2nd disk (/dev/sdb) to my 1st
> disk (/dev/sda).  My 1st disk is nice & quiet!  Now the lvm-howto
> specifies my next step (adding the "old partition" into the Lvol) as --

phew... I have no idea about moving things from PV to PV,
however, you may want to look at setting up a miniroot-in-a-ramdisk
for this sort of thing. I suspect you need to have the VGs deactivated,
and you can't do *that* when its in use as the root LV.

Check out;
http://innominate.org/~graichen/projects/miniroot

miniroot is fantastic, but it needs some work to make it useful
for LVM.
Mainly, just unzip and mount it (like you did for the initrd file before)
and copy over the lvm programs and libraries.

You'll need to set up a lilo entry too, of course.
I think its well documented.

BTW; I'd *seriously* recommend this for anyone with LVM root.
It can get you out of trouble!

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM
  2001-05-23  4:01     ` Steve Wray
@ 2001-05-23  5:03       ` S. Michael Denton
  2001-05-23 14:11         ` Rupert Heesom
  2001-05-23 13:14       ` [linux-lvm] Converting my Root file system to LVM Rupert Heesom
  1 sibling, 1 reply; 26+ messages in thread
From: S. Michael Denton @ 2001-05-23  5:03 UTC (permalink / raw)
  To: linux-lvm

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

With pvmove-ing an lv, it's actually quite easy... and I've done it
several times with the VG active... here's how:

pvcreate <new-pv>
vgextend <vg> <new-pv>
[make sure <new-pv> has at least as many pe's as <old-pv>]
pvmove <old-pv> <new-pv> (may require a -f or something if the lv's
are open)
vgreduce <vg> <old-pv> (unless you want to keep the old pv for
expansion or something)

viola!  all lv's that were on <old-pv> are now on <new-pv> :)  This
is also how I "defragment" the lv's if it gets too crazy with the
allocation... although you really don't need to do this (i just like
to keep the vgdisplay -v's easier to parse with scripts, etc :) )

- -----Original Message-----
From: linux-lvm-admin@sistina.com
[mailto:linux-lvm-admin@sistina.com]On
Behalf Of Steve Wray
Sent: Wednesday, 23 May 2001 00:02
To: linux-lvm@sistina.com
Subject: RE: [linux-lvm] Converting my Root file system to LVM


> From: linux-lvm-admin@sistina.com
> [mailto:linux-lvm-admin@sistina.com]On Behalf Of Rupert Heesom

> Tnx, Steve for the easy howto of your's below.
> BTW, what on earth is that "mount -o loop" command?

Glad to have helped!
the "-o loop" tells mount to mount the file on the loopback device.
This allows ordinary files (not just block devices) to carry a
filesystem.
Its quite cool!
:)

 
> Since my LVol is on my 2nd disk, next, I think I'll try extending
> my Lvol back to cover my 1st disk as well.

Just watch out for your /boot parition.
You might want to copy lilo.conf over to the /boot partition
and make /etc/lilo.conf a symlink to it there.

 
> One more bit of help, if you can? -
> 
> I want to pvmove the file contents of my 2nd disk (/dev/sdb) to my
> 1st disk (/dev/sda).  My 1st disk is nice & quiet!  Now the
> lvm-howto
> specifies my next step (adding the "old partition" into the Lvol)
> as --  

phew... I have no idea about moving things from PV to PV,
however, you may want to look at setting up a miniroot-in-a-ramdisk
for this sort of thing. I suspect you need to have the VGs
deactivated,
and you can't do *that* when its in use as the root LV.

Check out;
http://innominate.org/~graichen/projects/miniroot

miniroot is fantastic, but it needs some work to make it useful
for LVM.
Mainly, just unzip and mount it (like you did for the initrd file
before)
and copy over the lvm programs and libraries.

You'll need to set up a lilo entry too, of course.
I think its well documented.

BTW; I'd *seriously* recommend this for anyone with LVM root.
It can get you out of trouble!


_______________________________________________
linux-lvm mailing list
linux-lvm@sistina.com
http://lists.sistina.com/mailman/listinfo/linux-lvm


-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.1

iQA/AwUBOwtEhnC+DNfF0nVpEQLMOwCfazYeopl/VrVdNYDEn7rAnWlYqJEAn0Mj
cZX/Oh9MBo5nxV6GBJlC08pT
=LSkE
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-24  0:24                 ` Rupert Heesom
@ 2001-05-23  6:11                   ` Glenn Shannon
  2001-05-24 12:29                     ` Ben Lutgens
  0 siblings, 1 reply; 26+ messages in thread
From: Glenn Shannon @ 2001-05-23  6:11 UTC (permalink / raw)
  To: linux-lvm

Rupert Heesom wrote:

> On 23 May 2001 22:36:20 -0500, Austin Gonyou wrote:
> 
>> I'd say use reiser of XFS for your LVM partition. The grow utilities are
>> pretty kick ass and seem to work really well.
> 
> 
> Thanks for your advice.
> 
> However, right now I need more help getting LVM to properly shut down
> when the PC is unmounting the disks in the /etc/rc.d/init.d/halt script.
> 
> An extract from another post of mine:
> 
> I've discovered that my /etc/rc.d/init.d/halt script is set up
> incorrectly for LVM.  When I previously installed LVM, I followed
> instructions, and put a "vgchange -an" into the halt script just after
> /proc is umounted.
> 
> What I'm finding now is that when I'm shutting the PC down, vgchange is
> complaining that it can't close the VG down because there's an active
> partition (something like that).  I've had a look at the halt script,
> and I can't figure out exactly how umounting the LV & deactivating the
> VG would work.
> 
> I put a tentative line right above the "/sbin/vgchange -an" saying
> "umount /dev/vg/root".   However, if I'm unmounting root BEFORE
> deactivating the VG, then the system won't find the /sbin/vgchange util
> will it?  
> 
>>>>  I've tried shutting the PC down with that extra "halt" script line
>>> 
> in there.  It doesn't help at all.
> 
> I do have  /boot/initrd-lvm-2.4.3.gz which is used at boot time.  This
> ramdisk does have /sbin/vgchange in it (which you probably know).  If
> root is unmounted when /sbin/vgchange is called, will the system use the
> ramdisk?   If so, how does it know to use it?   (I'm kinda new to
> figuring out how ramdisks work, I just follow instructions and they
> work!)
> 
> 
>> -- 
>> Austin Gonyou
>> Systems Architect, CCNA
>> Coremetrics, Inc.
>> Phone: 512-796-9023
>> email: austin@coremetrics.com
>> 
>> On 23 May 2001, Rupert Heesom wrote:
>> 
>>> As I write this, a new kernel is being compiled with the patch for
>>> online ext2resizing.  According to xconfig, enabling the option was
>>> DANGEROUS!
>>> 
>>> As I think about it, since I've installed that root ramdisk (works
>>> great), I don't actually need to be able to resize my LVM partition
>>> mounted.  Still, it's good to have a kernel with such a capability.
>>> 
>>> I'm not concerned now about UNMOUNTING / deactivating the LVM when
>>> shutting the PC down.  That doesn't seem to be working at all.  (See
>>> another post of mine re details there).
>>> 
>>> Perhaps you would know how to help me there?  I'll experiment a bit
>>> myself, but I'm afraid of damaging the LV, since when I reboot my PC,
>>> the VG is not yet deactivated!  However it _has_ happened twice now
>>> without a problem.
>>> 
>>> On 23 May 2001 16:56:35 -0600, Andreas Dilger wrote:
>>> 
>>>> If you patch your kernel with the online ext2 patches, you can resize
>>>> your root partition while it is still mounted.  You will still need a
>>>> reboot to install the new kernel, however, but only the one time.  See
>>>> http://sourceforge.net/projects/ext2resize/
>>>> 
>>>> It still isn't a bad idea to have a small non-LVM partition on one of
>>>> your disks which has a kernel you can boot from, along with useful
>>>> tools in /lib and /sbin.  I guess miniroot is such a thing.
>>> 
>> _______________________________________________
>> 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
>> 
Try this:

Right before the line in your /etc/init.d/halt script (it may be named 
different than that however, like shutdown or maybe even reboot):

Before the line that remounts the root (/) partition read-only, put the 
line:

lsof >/lsof.output

Then reboot. There should be a file in / called lsof.output. Read that 
and it will let you know all files in use (which would be the reason 
that it can't unmount the partition).

Good luck!

Glenn Shannon

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-24 12:29                     ` Ben Lutgens
@ 2001-05-23 12:35                       ` Glenn Shannon
  0 siblings, 0 replies; 26+ messages in thread
From: Glenn Shannon @ 2001-05-23 12:35 UTC (permalink / raw)
  To: linux-lvm

I am sure you do...I was merely observing that it may be the same 
problem I had (due to me *improperly* copying the files from the 
physical partition to the new LVM partition) and these are the steps I 
took to resolve it.

I am betting he will see many files opened on /usr/lib.

Hopefully that is NOT the case however. I was lucky enough to have 2 
identical RedHat installs at my disposal to create a script and create 
files that my other scripts could read to redo the symlinking.

If he requires those, the I will gladly let him have them provided he 
has another machine to create the linklists from.

One of many such tools I have found a necessity from time to time :)

Glenn

Ben Lutgens wrote:

> On Wed, May 23, 2001 at 03:11:27PM +0900, Glenn Shannon wrote:
> 
>> Rupert Heesom wrote:
>> 
>>> On 23 May 2001 22:36:20 -0500, Austin Gonyou wrote:
>>> 
>>>> I'd say use reiser of XFS for your LVM partition. The grow utilities are
>>>> pretty kick ass and seem to work really well.
>>> 
> 
> I run it as my root device with reiserfs on it and don't bother with init /
> shutdown scripts. No problems.
> 
>>> 
>>> Thanks for your advice.
>>> 
>>> However, right now I need more help getting LVM to properly shut down
>>> when the PC is unmounting the disks in the /etc/rc.d/init.d/halt script.
>>> 
>>> An extract from another post of mine:
>>> 
>>> I've discovered that my /etc/rc.d/init.d/halt script is set up
>>> incorrectly for LVM.  When I previously installed LVM, I followed
>>> instructions, and put a "vgchange -an" into the halt script just after
>>> /proc is umounted.
>>> 
>>> What I'm finding now is that when I'm shutting the PC down, vgchange is
>>> complaining that it can't close the VG down because there's an active
>>> partition (something like that).  I've had a look at the halt script,
>>> and I can't figure out exactly how umounting the LV & deactivating the
>>> VG would work.
>>> 
>>> I put a tentative line right above the "/sbin/vgchange -an" saying
>>> "umount /dev/vg/root".   However, if I'm unmounting root BEFORE
>>> deactivating the VG, then the system won't find the /sbin/vgchange util
>>> will it?  
>>> 
>>>>>>  I've tried shutting the PC down with that extra "halt" script line
>>>>> 
>>> in there.  It doesn't help at all.
>>> 
>>> I do have  /boot/initrd-lvm-2.4.3.gz which is used at boot time.  This
>>> ramdisk does have /sbin/vgchange in it (which you probably know).  If
>>> root is unmounted when /sbin/vgchange is called, will the system use the
>>> ramdisk?   If so, how does it know to use it?   (I'm kinda new to
>>> figuring out how ramdisks work, I just follow instructions and they
>>> work!)
>>> 
>>> 
>>>> -- 
>>>> Austin Gonyou
>>>> Systems Architect, CCNA
>>>> Coremetrics, Inc.
>>>> Phone: 512-796-9023
>>>> email: austin@coremetrics.com
>>>> 
>>>> On 23 May 2001, Rupert Heesom wrote:
>>>> 
>>>>> As I write this, a new kernel is being compiled with the patch for
>>>>> online ext2resizing.  According to xconfig, enabling the option was
>>>>> DANGEROUS!
>>>>> 
>>>>> As I think about it, since I've installed that root ramdisk (works
>>>>> great), I don't actually need to be able to resize my LVM partition
>>>>> mounted.  Still, it's good to have a kernel with such a capability.
>>>>> 
>>>>> I'm not concerned now about UNMOUNTING / deactivating the LVM when
>>>>> shutting the PC down.  That doesn't seem to be working at all.  (See
>>>>> another post of mine re details there).
>>>>> 
>>>>> Perhaps you would know how to help me there?  I'll experiment a bit
>>>>> myself, but I'm afraid of damaging the LV, since when I reboot my PC,
>>>>> the VG is not yet deactivated!  However it _has_ happened twice now
>>>>> without a problem.
>>>>> 
>>>>> On 23 May 2001 16:56:35 -0600, Andreas Dilger wrote:
>>>>> 
>>>>>> If you patch your kernel with the online ext2 patches, you can resize
>>>>>> your root partition while it is still mounted.  You will still need a
>>>>>> reboot to install the new kernel, however, but only the one time.  See
>>>>>> http://sourceforge.net/projects/ext2resize/
>>>>>> 
>>>>>> It still isn't a bad idea to have a small non-LVM partition on one of
>>>>>> your disks which has a kernel you can boot from, along with useful
>>>>>> tools in /lib and /sbin.  I guess miniroot is such a thing.
>>>>> 
>>>> _______________________________________________
>>>> 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
>>>> 
>> Try this:
>> 
>> Right before the line in your /etc/init.d/halt script (it may be named 
>> different than that however, like shutdown or maybe even reboot):
>> 
>> Before the line that remounts the root (/) partition read-only, put the 
>> line:
>> 
>> lsof >/lsof.output
>> 
>> Then reboot. There should be a file in / called lsof.output. Read that 
>> and it will let you know all files in use (which would be the reason 
>> that it can't unmount the partition).
>> 
>> Good luck!
>> 
>> Glenn Shannon
>> 
>> _______________________________________________
>> 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] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 23:25 ` [linux-lvm] Converting my Root file system to LVM Andreas Dilger
@ 2001-05-23 13:14   ` Michael Tokarev
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Tokarev @ 2001-05-23 13:14 UTC (permalink / raw)
  To: linux-lvm

Andreas Dilger wrote:
[]
> No, the problem is in the wrapper script for the LVM tools.  It is using
> "sed" in the script, but that is not on the initrd.  I don't see sed in
> my LVM wrapper script, so you must have a different one.  Either fix the
> wrapper script (edit /sbin/vgscan should be enough), or add "sed" to the
> list of required files, INITRDFILES, in lvmcreate_initrd.

Initrd intended to be used with exactly one version of kernel, so there should
be NO sed there -- it is used to determine kernel iop version, but that known
at an initrd creation time.  Initrd should contain real utils, not wrappers.

Regards,
 Michael.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM
  2001-05-23  4:01     ` Steve Wray
  2001-05-23  5:03       ` S. Michael Denton
@ 2001-05-23 13:14       ` Rupert Heesom
  1 sibling, 0 replies; 26+ messages in thread
From: Rupert Heesom @ 2001-05-23 13:14 UTC (permalink / raw)
  To: linux-lvm

On 23 May 2001 16:01:37 +1200, Steve Wray wrote:
> > From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> > Behalf Of Rupert Heesom
> 
> > Tnx, Steve for the easy howto of your's below.
> > BTW, what on earth is that "mount -o loop" command?
> 
> Glad to have helped!
> the "-o loop" tells mount to mount the file on the loopback device.
> This allows ordinary files (not just block devices) to carry a filesystem.
> Its quite cool!
> :)

That IS pretty cool.

> 
>  
> > Since my LVol is on my 2nd disk, next, I think I'll try extending my
> > Lvol back to cover my 1st disk as well.
> 
> Just watch out for your /boot parition.
> You might want to copy lilo.conf over to the /boot partition
> and make /etc/lilo.conf a symlink to it there.

Yes, I've done that already.  The suggestion was in the man page for
"lvmcreate_initrd".

> 
>  
> > One more bit of help, if you can? -
> > 
> > I want to pvmove the file contents of my 2nd disk (/dev/sdb) to my 1st
> > disk (/dev/sda).  My 1st disk is nice & quiet!  Now the lvm-howto
> > specifies my next step (adding the "old partition" into the Lvol) as --
> 
> phew... I have no idea about moving things from PV to PV,
> however, you may want to look at setting up a miniroot-in-a-ramdisk
> for this sort of thing. I suspect you need to have the VGs deactivated,
> and you can't do *that* when its in use as the root LV.

I think the concept is covered (to a degree) in the lvm-howto under
"removing an old disk" or something like that.

I've practiced this pvmove thing on my 2nd disk when it was spare.
From what I remember, the both PVs had to be inside a VG.  The pvmove
itself wasn't a problem for me, but the LV had to be dismounted to
resize it. I will have to extend my LV & resize the file system using
e2fsadm, so I will have to dismount the root volume.  It sounds like I
DO need the root ram disk which you mention.  I'll read up about it.

> 
> Check out;
> http://innominate.org/~graichen/projects/miniroot
> 
> miniroot is fantastic, but it needs some work to make it useful
> for LVM.
> Mainly, just unzip and mount it (like you did for the initrd file before)
> and copy over the lvm programs and libraries.
> 
> You'll need to set up a lilo entry too, of course.
> I think its well documented.
> 
> BTW; I'd *seriously* recommend this for anyone with LVM root.
> It can get you out of trouble!
> 
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> 

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM
  2001-05-23  5:03       ` S. Michael Denton
@ 2001-05-23 14:11         ` Rupert Heesom
  2001-05-23 22:56           ` Andreas Dilger
  0 siblings, 1 reply; 26+ messages in thread
From: Rupert Heesom @ 2001-05-23 14:11 UTC (permalink / raw)
  To: linux-lvm

Hi Michael:

Thanks for the notes below.

Yes, I do want to keep the old PV active.  My whole exercise here is to
use LVM to expand my root partition to cover 2 disk.  Therefore I've
created a PV on my 2nd disk (new one I'm adding onto the PC) and that's
up and running as my root currently.  Now I'm trying to copy the file
system to my orig disk (better disk) and expand the LV to cover both
disks. 

The expanding the LV & file system using e2fsadm is what I'm dithering
about now.   I think it's necessary to umount the LV to change it's size
(my e2fsadm is using the resize2fs util).  Since my current new root is
already an LVM partition, I need some way of unmounting it, doing the
LVM work on it, then remounting it.

I think the miniroot ramdisk which Steve Wray pointed out is probably my
answer. However I do wonder whether it's possible to do this another
way?   The miniroot ramdisk is still a great idea that I will implement.



On 23 May 2001 01:03:02 -0400, S. Michael Denton wrote:
> With pvmove-ing an lv, it's actually quite easy... and I've done it
> several times with the VG active... here's how:
> 
> pvcreate <new-pv>
> vgextend <vg> <new-pv>
> [make sure <new-pv> has at least as many pe's as <old-pv>]
> pvmove <old-pv> <new-pv> (may require a -f or something if the lv's
> are open)
> vgreduce <vg> <old-pv> (unless you want to keep the old pv for
> expansion or something)
> 
> viola!  all lv's that were on <old-pv> are now on <new-pv> :)  This
> is also how I "defragment" the lv's if it gets too crazy with the
> allocation... although you really don't need to do this (i just like
> to keep the vgdisplay -v's easier to parse with scripts, etc :) )
> 

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM [last question]
  2001-05-23 16:49     ` Andreas Dilger
@ 2001-05-23 15:02       ` Rupert Heesom
  2001-05-23 22:24         ` [linux-lvm] Converting my Root file system to LVM [lastquestion] Steve Wray
  0 siblings, 1 reply; 26+ messages in thread
From: Rupert Heesom @ 2001-05-23 15:02 UTC (permalink / raw)
  To: linux-lvm

On 23 May 2001 10:49:13 -0600, Andreas Dilger wrote:
> Rupert Heesom writes:
> 
> Yes, you can do that...  However, once you have LVM you should start to
> think differently about "partitions" and such.  You can create a lot of
> small partitions for different needs.
> 
> Why is this useful?  Because it makes moving stuff around, updating the
> OS, etc easier.  You can have multiple OS installs, but keep your /home
> and /mp3 data available to both.  You can put /mp3 on a new disk and it
> will spin down when you are not listening to them.  You can put /var/log
> and /var/spool/mail on different LVs so that lots of logs or lots of
> email don't make your system unusable.

Tnx for the advise here.  I'll try to start thinking in those terms.

I've now got one more question which I'll post in this msg -

I've discovered that my /etc/rc.d/init.d/halt script is set up
incorrectly for LVM.  When I previously installed LVM, I followed
instructions, and put a "vgchange -an" into the halt script just after
/proc is umounted.

What I'm finding now is that when I'm shutting the PC down, vgchange is
complaining that it can't close the VG down because there's an active
partition (something like that).  I've had a look at the halt script,
and I can't figure out exactly how umounting the LV & deactivating the
VG would work.

I put a tentative line right above the "/sbin/vgchange -an" saying
"umount /dev/vg/root".   However, if I'm unmounting root BEFORE
deactivating the VG, then the system won't find the /sbin/vgchange util
will it?  

I do have  /boot/initrd-lvm-2.4.3.gz which is used at boot time.  This
ramdisk does have /sbin/vgchange in it (which you probably know).  If
root is unmounted when /sbin/vgchange is called, will the system use the
ramdisk?   If so, how does it know to use it?   (I'm kinda new to
figuring out how ramdisks work, I just follow instructions and they
work!)

Once I'm satisfied that my LVM setup is not good, then I'm going to try
taking the plunge & extending the LV to my other disk.

BTW, since my other disk still has the old file system on it, is this
filesystem wiped when I change partition type to "8e", or when I create
a PV on it, or not at all?  I can't think that anything but the e2fsadm
extending the LV file system onto the other disk will wipe the previous
contents out.

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM
  2001-05-22 23:53   ` Rupert Heesom
  2001-05-23  4:01     ` Steve Wray
@ 2001-05-23 16:49     ` Andreas Dilger
  2001-05-23 15:02       ` [linux-lvm] Converting my Root file system to LVM [last question] Rupert Heesom
  1 sibling, 1 reply; 26+ messages in thread
From: Andreas Dilger @ 2001-05-23 16:49 UTC (permalink / raw)
  To: linux-lvm

Rupert Heesom writes:
> I want to pvmove the file contents of my 2nd disk (/dev/sdb) to my 1st
> disk (/dev/sda).  My 1st disk is nice & quiet!  Now the lvm-howto
> specifies my next step (adding the "old partition" into the Lvol) as --
> 
> pvcreate /dev/sda   <using my device names>
> vgextend vg /dev/sda
> 
> ---  Seeing as I want to do a pvmove of data from /dev/sdb to /dev/sda,
> when would I do the pvmove?   As I understand LVM, I need to have the PV
> created and integrated into the VG before I can use pvmove - is this
> correct?   Then, once pvmove is used, I can then extend the LV & file
> system to cover both PVs using e2fsadm, right?

Yes, you can do that...  However, once you have LVM you should start to
think differently about "partitions" and such.  You can create a lot of
small partitions for different needs.

Why is this useful?  Because it makes moving stuff around, updating the
OS, etc easier.  You can have multiple OS installs, but keep your /home
and /mp3 data available to both.  You can put /mp3 on a new disk and it
will spin down when you are not listening to them.  You can put /var/log
and /var/spool/mail on different LVs so that lots of logs or lots of
email don't make your system unusable.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM [lastquestion]
  2001-05-23 15:02       ` [linux-lvm] Converting my Root file system to LVM [last question] Rupert Heesom
@ 2001-05-23 22:24         ` Steve Wray
  2001-05-24  6:41           ` Andreas Dilger
  0 siblings, 1 reply; 26+ messages in thread
From: Steve Wray @ 2001-05-23 22:24 UTC (permalink / raw)
  To: linux-lvm

> From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> Behalf Of Rupert Heesom
[snip]
> What I'm finding now is that when I'm shutting the PC down, vgchange is
> complaining that it can't close the VG down because there's an active
> partition (something like that).  I've had a look at the halt script,
> and I can't figure out exactly how umounting the LV & deactivating the
> VG would work.
> 
> I put a tentative line right above the "/sbin/vgchange -an" saying
> "umount /dev/vg/root".   However, if I'm unmounting root BEFORE
> deactivating the VG, then the system won't find the /sbin/vgchange util
> will it?  
> 
> I do have  /boot/initrd-lvm-2.4.3.gz which is used at boot time.  This
> ramdisk does have /sbin/vgchange in it (which you probably know).  If
> root is unmounted when /sbin/vgchange is called, will the system use the
> ramdisk?   If so, how does it know to use it?   (I'm kinda new to
> figuring out how ramdisks work, I just follow instructions and they
> work!)

Hey thats a good point... maybe a halt-time ramdisk?
:)


[snip]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM
  2001-05-23 14:11         ` Rupert Heesom
@ 2001-05-23 22:56           ` Andreas Dilger
  2001-05-23 23:18             ` [linux-lvm] Is now: Resizing & LVM shutdown Rupert Heesom
  0 siblings, 1 reply; 26+ messages in thread
From: Andreas Dilger @ 2001-05-23 22:56 UTC (permalink / raw)
  To: linux-lvm

Rupert writes:
> The expanding the LV & file system using e2fsadm is what I'm dithering
> about now.   I think it's necessary to umount the LV to change it's size
> (my e2fsadm is using the resize2fs util).  Since my current new root is
> already an LVM partition, I need some way of unmounting it, doing the
> LVM work on it, then remounting it.
> 
> I think the miniroot ramdisk which Steve Wray pointed out is probably my
> answer. However I do wonder whether it's possible to do this another
> way?   The miniroot ramdisk is still a great idea that I will implement.

If you patch your kernel with the online ext2 patches, you can resize
your root partition while it is still mounted.  You will still need a
reboot to install the new kernel, however, but only the one time.  See
http://sourceforge.net/projects/ext2resize/

It still isn't a bad idea to have a small non-LVM partition on one of
your disks which has a kernel you can boot from, along with useful
tools in /lib and /sbin.  I guess miniroot is such a thing.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-23 22:56           ` Andreas Dilger
@ 2001-05-23 23:18             ` Rupert Heesom
  2001-05-24  3:36               ` Austin Gonyou
  2001-05-24  6:54               ` Andreas Dilger
  0 siblings, 2 replies; 26+ messages in thread
From: Rupert Heesom @ 2001-05-23 23:18 UTC (permalink / raw)
  To: linux-lvm

As I write this, a new kernel is being compiled with the patch for
online ext2resizing.  According to xconfig, enabling the option was
DANGEROUS!

As I think about it, since I've installed that root ramdisk (works
great), I don't actually need to be able to resize my LVM partition
mounted.  Still, it's good to have a kernel with such a capability.

I'm not concerned now about UNMOUNTING / deactivating the LVM when
shutting the PC down.  That doesn't seem to be working at all.  (See
another post of mine re details there).

Perhaps you would know how to help me there?  I'll experiment a bit
myself, but I'm afraid of damaging the LV, since when I reboot my PC,
the VG is not yet deactivated!  However it _has_ happened twice now
without a problem.

On 23 May 2001 16:56:35 -0600, Andreas Dilger wrote:
> 
> If you patch your kernel with the online ext2 patches, you can resize
> your root partition while it is still mounted.  You will still need a
> reboot to install the new kernel, however, but only the one time.  See
> http://sourceforge.net/projects/ext2resize/
> 
> It still isn't a bad idea to have a small non-LVM partition on one of
> your disks which has a kernel you can boot from, along with useful
> tools in /lib and /sbin.  I guess miniroot is such a thing.

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-24  3:36               ` Austin Gonyou
@ 2001-05-24  0:24                 ` Rupert Heesom
  2001-05-23  6:11                   ` Glenn Shannon
  0 siblings, 1 reply; 26+ messages in thread
From: Rupert Heesom @ 2001-05-24  0:24 UTC (permalink / raw)
  To: linux-lvm; +Cc: austin

On 23 May 2001 22:36:20 -0500, Austin Gonyou wrote:
> I'd say use reiser of XFS for your LVM partition. The grow utilities are
> pretty kick ass and seem to work really well.

Thanks for your advice.

However, right now I need more help getting LVM to properly shut down
when the PC is unmounting the disks in the /etc/rc.d/init.d/halt script.

An extract from another post of mine:

I've discovered that my /etc/rc.d/init.d/halt script is set up
incorrectly for LVM.  When I previously installed LVM, I followed
instructions, and put a "vgchange -an" into the halt script just after
/proc is umounted.

What I'm finding now is that when I'm shutting the PC down, vgchange is
complaining that it can't close the VG down because there's an active
partition (something like that).  I've had a look at the halt script,
and I can't figure out exactly how umounting the LV & deactivating the
VG would work.

I put a tentative line right above the "/sbin/vgchange -an" saying
"umount /dev/vg/root".   However, if I'm unmounting root BEFORE
deactivating the VG, then the system won't find the /sbin/vgchange util
will it?  

>>>  I've tried shutting the PC down with that extra "halt" script line
in there.  It doesn't help at all.

I do have  /boot/initrd-lvm-2.4.3.gz which is used at boot time.  This
ramdisk does have /sbin/vgchange in it (which you probably know).  If
root is unmounted when /sbin/vgchange is called, will the system use the
ramdisk?   If so, how does it know to use it?   (I'm kinda new to
figuring out how ramdisks work, I just follow instructions and they
work!)


> -- 
> Austin Gonyou
> Systems Architect, CCNA
> Coremetrics, Inc.
> Phone: 512-796-9023
> email: austin@coremetrics.com
> 
> On 23 May 2001, Rupert Heesom wrote:
> 
> > As I write this, a new kernel is being compiled with the patch for
> > online ext2resizing.  According to xconfig, enabling the option was
> > DANGEROUS!
> >
> > As I think about it, since I've installed that root ramdisk (works
> > great), I don't actually need to be able to resize my LVM partition
> > mounted.  Still, it's good to have a kernel with such a capability.
> >
> > I'm not concerned now about UNMOUNTING / deactivating the LVM when
> > shutting the PC down.  That doesn't seem to be working at all.  (See
> > another post of mine re details there).
> >
> > Perhaps you would know how to help me there?  I'll experiment a bit
> > myself, but I'm afraid of damaging the LV, since when I reboot my PC,
> > the VG is not yet deactivated!  However it _has_ happened twice now
> > without a problem.
> >
> > On 23 May 2001 16:56:35 -0600, Andreas Dilger wrote:
> > >
> > > If you patch your kernel with the online ext2 patches, you can resize
> > > your root partition while it is still mounted.  You will still need a
> > > reboot to install the new kernel, however, but only the one time.  See
> > > http://sourceforge.net/projects/ext2resize/
> > >
> > > It still isn't a bad idea to have a small non-LVM partition on one of
> > > your disks which has a kernel you can boot from, along with useful
> > > tools in /lib and /sbin.  I guess miniroot is such a thing.
> >
> >
> 
> _______________________________________________
> 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
> 

-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-23 23:18             ` [linux-lvm] Is now: Resizing & LVM shutdown Rupert Heesom
@ 2001-05-24  3:36               ` Austin Gonyou
  2001-05-24  0:24                 ` Rupert Heesom
  2001-05-24  6:54               ` Andreas Dilger
  1 sibling, 1 reply; 26+ messages in thread
From: Austin Gonyou @ 2001-05-24  3:36 UTC (permalink / raw)
  To: Rupert Heesom; +Cc: linux-lvm

I'd say use reiser of XFS for your LVM partition. The grow utilities are
pretty kick ass and seem to work really well.

-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-796-9023
email: austin@coremetrics.com

On 23 May 2001, Rupert Heesom wrote:

> As I write this, a new kernel is being compiled with the patch for
> online ext2resizing.  According to xconfig, enabling the option was
> DANGEROUS!
>
> As I think about it, since I've installed that root ramdisk (works
> great), I don't actually need to be able to resize my LVM partition
> mounted.  Still, it's good to have a kernel with such a capability.
>
> I'm not concerned now about UNMOUNTING / deactivating the LVM when
> shutting the PC down.  That doesn't seem to be working at all.  (See
> another post of mine re details there).
>
> Perhaps you would know how to help me there?  I'll experiment a bit
> myself, but I'm afraid of damaging the LV, since when I reboot my PC,
> the VG is not yet deactivated!  However it _has_ happened twice now
> without a problem.
>
> On 23 May 2001 16:56:35 -0600, Andreas Dilger wrote:
> >
> > If you patch your kernel with the online ext2 patches, you can resize
> > your root partition while it is still mounted.  You will still need a
> > reboot to install the new kernel, however, but only the one time.  See
> > http://sourceforge.net/projects/ext2resize/
> >
> > It still isn't a bad idea to have a small non-LVM partition on one of
> > your disks which has a kernel you can boot from, along with useful
> > tools in /lib and /sbin.  I guess miniroot is such a thing.
>
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM [lastquestion]
  2001-05-23 22:24         ` [linux-lvm] Converting my Root file system to LVM [lastquestion] Steve Wray
@ 2001-05-24  6:41           ` Andreas Dilger
  2001-05-24 10:52             ` Rupert Heesom
  2001-05-24 14:22             ` AJ Lewis
  0 siblings, 2 replies; 26+ messages in thread
From: Andreas Dilger @ 2001-05-24  6:41 UTC (permalink / raw)
  To: linux-lvm

Steve Wray writes:
> > If root is unmounted when /sbin/vgchange is called, will the system
> > use the ramdisk?   If so, how does it know to use it?   (I'm kinda
> > new to figuring out how ramdisks work, I just follow instructions
> > and they work!)
> 
> Hey thats a good point... maybe a halt-time ramdisk? :)

Actually, I posted a similar question to linux-kernel, but I think it was
lost in the noise.  Basically, it _is_ possible to have a "finitrd" for
just this situation (at least on 2.4).  You unmount all but root, set up
a ramfs, and pivot_root into the ramfs.  You can then unmount root (not
just a read-only remount), and properly shutdown LVM/RAID/etc.  Haven't
tried it myself, but it should work.

Note that LVM doesn't actually write anything to disk with "vgchange -an",
so there is no real need to do this.  

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-23 23:18             ` [linux-lvm] Is now: Resizing & LVM shutdown Rupert Heesom
  2001-05-24  3:36               ` Austin Gonyou
@ 2001-05-24  6:54               ` Andreas Dilger
  1 sibling, 0 replies; 26+ messages in thread
From: Andreas Dilger @ 2001-05-24  6:54 UTC (permalink / raw)
  To: linux-lvm

Rupert Heesom writes:
> As I write this, a new kernel is being compiled with the patch for
> online ext2resizing.  According to xconfig, enabling the option was
> DANGEROUS!

It really is very safe, AFAIK.  I have never had reports of people
losing any data with ext2resize or ext2online.  The only recent bug
reports have been because the checking in the code has been too
strict and it refused to resize someones strange filesystem layout
when it should have...

The only reason that it is still marked dangerous is that anything which
mucks with your filesystem has the _potential_ for causing problems.
Don't let anyone tell you otherwise.  Backups are always a good idea
for all sorts of other reasons.

Once it is part of the official kernel, and has been running without
problems for a while then I will remove the DANGEROUS designation.
Until then, I don't really get much feedback on how widely it is used,
so I would rather be cautious.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM [lastquestion]
  2001-05-24  6:41           ` Andreas Dilger
@ 2001-05-24 10:52             ` Rupert Heesom
  2001-05-24 22:07               ` Steve Wray
  2001-05-24 14:22             ` AJ Lewis
  1 sibling, 1 reply; 26+ messages in thread
From: Rupert Heesom @ 2001-05-24 10:52 UTC (permalink / raw)
  To: linux-lvm

On 24 May 2001 00:41:18 -0600, Andreas Dilger wrote:
> Steve Wray writes:
> Actually, I posted a similar question to linux-kernel, but I think it was
> lost in the noise.  Basically, it _is_ possible to have a "finitrd" for
> just this situation (at least on 2.4).  You unmount all but root, set up
> a ramfs, and pivot_root into the ramfs.  You can then unmount root (not
> just a read-only remount), and properly shutdown LVM/RAID/etc.  Haven't
> tried it myself, but it should work.
> 
> Note that LVM doesn't actually write anything to disk with "vgchange -an",
> so there is no real need to do this.  

I guess that's the answer I was looking for.... no real need to do a 
"vgchange -an" at shutdown.  I was sure that it was not healthy for LVM.
But if it doesn't matter, then I'll just take out the shutdown command.

BTW, if the VG _isn't_ shut down, what happens to it, ie it was active,
then it's suddenly activated again on bootup.  Doesn't sound like clean
functionality to me.

BTW, the finitrd sounds like a cool thing.  I think I'll stick with
simplicity right now (assuming it's safe).


-- 
regs
rupert

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Is now: Resizing & LVM shutdown
  2001-05-23  6:11                   ` Glenn Shannon
@ 2001-05-24 12:29                     ` Ben Lutgens
  2001-05-23 12:35                       ` Glenn Shannon
  0 siblings, 1 reply; 26+ messages in thread
From: Ben Lutgens @ 2001-05-24 12:29 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 4766 bytes --]

On Wed, May 23, 2001 at 03:11:27PM +0900, Glenn Shannon wrote:
>Rupert Heesom wrote:
>
>> On 23 May 2001 22:36:20 -0500, Austin Gonyou wrote:
>> 
>>> I'd say use reiser of XFS for your LVM partition. The grow utilities are
>>> pretty kick ass and seem to work really well.

I run it as my root device with reiserfs on it and don't bother with init /
shutdown scripts. No problems.

>> 
>> 
>> Thanks for your advice.
>> 
>> However, right now I need more help getting LVM to properly shut down
>> when the PC is unmounting the disks in the /etc/rc.d/init.d/halt script.
>> 
>> An extract from another post of mine:
>> 
>> I've discovered that my /etc/rc.d/init.d/halt script is set up
>> incorrectly for LVM.  When I previously installed LVM, I followed
>> instructions, and put a "vgchange -an" into the halt script just after
>> /proc is umounted.
>> 
>> What I'm finding now is that when I'm shutting the PC down, vgchange is
>> complaining that it can't close the VG down because there's an active
>> partition (something like that).  I've had a look at the halt script,
>> and I can't figure out exactly how umounting the LV & deactivating the
>> VG would work.
>> 
>> I put a tentative line right above the "/sbin/vgchange -an" saying
>> "umount /dev/vg/root".   However, if I'm unmounting root BEFORE
>> deactivating the VG, then the system won't find the /sbin/vgchange util
>> will it?  
>> 
>>>>>  I've tried shutting the PC down with that extra "halt" script line
>>>> 
>> in there.  It doesn't help at all.
>> 
>> I do have  /boot/initrd-lvm-2.4.3.gz which is used at boot time.  This
>> ramdisk does have /sbin/vgchange in it (which you probably know).  If
>> root is unmounted when /sbin/vgchange is called, will the system use the
>> ramdisk?   If so, how does it know to use it?   (I'm kinda new to
>> figuring out how ramdisks work, I just follow instructions and they
>> work!)
>> 
>> 
>>> -- 
>>> Austin Gonyou
>>> Systems Architect, CCNA
>>> Coremetrics, Inc.
>>> Phone: 512-796-9023
>>> email: austin@coremetrics.com
>>> 
>>> On 23 May 2001, Rupert Heesom wrote:
>>> 
>>>> As I write this, a new kernel is being compiled with the patch for
>>>> online ext2resizing.  According to xconfig, enabling the option was
>>>> DANGEROUS!
>>>> 
>>>> As I think about it, since I've installed that root ramdisk (works
>>>> great), I don't actually need to be able to resize my LVM partition
>>>> mounted.  Still, it's good to have a kernel with such a capability.
>>>> 
>>>> I'm not concerned now about UNMOUNTING / deactivating the LVM when
>>>> shutting the PC down.  That doesn't seem to be working at all.  (See
>>>> another post of mine re details there).
>>>> 
>>>> Perhaps you would know how to help me there?  I'll experiment a bit
>>>> myself, but I'm afraid of damaging the LV, since when I reboot my PC,
>>>> the VG is not yet deactivated!  However it _has_ happened twice now
>>>> without a problem.
>>>> 
>>>> On 23 May 2001 16:56:35 -0600, Andreas Dilger wrote:
>>>> 
>>>>> If you patch your kernel with the online ext2 patches, you can resize
>>>>> your root partition while it is still mounted.  You will still need a
>>>>> reboot to install the new kernel, however, but only the one time.  See
>>>>> http://sourceforge.net/projects/ext2resize/
>>>>> 
>>>>> It still isn't a bad idea to have a small non-LVM partition on one of
>>>>> your disks which has a kernel you can boot from, along with useful
>>>>> tools in /lib and /sbin.  I guess miniroot is such a thing.
>>>> 
>>> _______________________________________________
>>> 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
>>> 
>Try this:
>
>Right before the line in your /etc/init.d/halt script (it may be named 
>different than that however, like shutdown or maybe even reboot):
>
>Before the line that remounts the root (/) partition read-only, put the 
>line:
>
>lsof >/lsof.output
>
>Then reboot. There should be a file in / called lsof.output. Read that 
>and it will let you know all files in use (which would be the reason 
>that it can't unmount the partition).
>
>Good luck!
>
>Glenn Shannon
>
>_______________________________________________
>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

-- 
Ben Lutgens		
Sistina Software Inc.	
MIS Geek
http://www.sistina.com/	<--- great software 
http://www.gentoo.org/  <--- great distro
Kernel panic: I have no root and I want to scream <--- perfect error message

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM [lastquestion]
  2001-05-24  6:41           ` Andreas Dilger
  2001-05-24 10:52             ` Rupert Heesom
@ 2001-05-24 14:22             ` AJ Lewis
  2001-05-24 19:48               ` Luca Berra
  1 sibling, 1 reply; 26+ messages in thread
From: AJ Lewis @ 2001-05-24 14:22 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

On Thu, May 24, 2001 at 12:41:18AM -0600, Andreas Dilger wrote:
> Actually, I posted a similar question to linux-kernel, but I think it was
> lost in the noise.  Basically, it _is_ possible to have a "finitrd" for
> just this situation (at least on 2.4).  You unmount all but root, set up
> a ramfs, and pivot_root into the ramfs.  You can then unmount root (not
> just a read-only remount), and properly shutdown LVM/RAID/etc.  Haven't
> tried it myself, but it should work.

I keep seeing this pivot_root thing.  Is it actually implemented in 2.4, and
if so, how does one go about doing it?

Thanks,
-- 
AJ Lewis
Sistina Software Inc.                  Voice:  612-638-0500
1313 5th St SE, Suite 111              Fax:    612-638-0500
Minneapolis, MN 55414                  E-Mail: lewis@sistina.com
http://www.sistina.com

Current GPG fingerprint = 3B5F 6011 5216 76A5 2F6B  52A0 941E 1261 0029 2648
Get my key at: http://www.sistina.com/~lewis/gpgkey
 (Unfortunately, the PKS-type keyservers do not work with multiple sub-keys)

-----Begin Obligatory Humorous Quote----------------------------------------
"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro help desk.
-----End Obligatory Humorous Quote------------------------------------------

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [linux-lvm] Converting my Root file system to LVM [lastquestion]
  2001-05-24 14:22             ` AJ Lewis
@ 2001-05-24 19:48               ` Luca Berra
  0 siblings, 0 replies; 26+ messages in thread
From: Luca Berra @ 2001-05-24 19:48 UTC (permalink / raw)
  To: linux-lvm

On Thu, May 24, 2001 at 09:22:25AM -0500, AJ Lewis wrote:
> On Thu, May 24, 2001 at 12:41:18AM -0600, Andreas Dilger wrote:
> > Actually, I posted a similar question to linux-kernel, but I think it was
> > lost in the noise.  Basically, it _is_ possible to have a "finitrd" for
> > just this situation (at least on 2.4).  You unmount all but root, set up
> > a ramfs, and pivot_root into the ramfs.  You can then unmount root (not
> > just a read-only remount), and properly shutdown LVM/RAID/etc.  Haven't
> > tried it myself, but it should work.
> 
> I keep seeing this pivot_root thing.  Is it actually implemented in 2.4, and
> if so, how does one go about doing it?
according to docs pivot_root syscall is implemented since 2.3.41
i believe pivot_root command is in util-linux 2.10

you use pivot_root command like
mount /dev/vgRoot/lvRoot /Root #mount real root fs
cd /Root 
mkdir -p old_root
pivot_root . old_root #this swaps root and old_root
exec chroot . /sbin/init

btw syscall is 
int pivot_root(const char *new_root, const char *put_old);

L.


-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [linux-lvm] Converting my Root file system to LVM [lastquestion]
  2001-05-24 10:52             ` Rupert Heesom
@ 2001-05-24 22:07               ` Steve Wray
  0 siblings, 0 replies; 26+ messages in thread
From: Steve Wray @ 2001-05-24 22:07 UTC (permalink / raw)
  To: linux-lvm

> From: linux-lvm-admin@sistina.com [mailto:linux-lvm-admin@sistina.com]On
> Behalf Of Rupert Heesom
> Sent: Thursday, May 24, 2001 10:53 PM
> To: linux-lvm@sistina.com
> Subject: Re: [linux-lvm] Converting my Root file system to LVM
> [lastquestion]
>
>
> On 24 May 2001 00:41:18 -0600, Andreas Dilger wrote:
> > Steve Wray writes:
> > Actually, I posted a similar question to linux-kernel, but I

This is a mis-quote. I didn't write this.
Just thought I'd make sure the record was straight since this is being
archived!



> > lost in the noise.  Basically, it _is_ possible to have a "finitrd" for
> > just this situation (at least on 2.4).  You unmount all but root, set up
> > a ramfs, and pivot_root into the ramfs.  You can then unmount root (not
> > just a read-only remount), and properly shutdown LVM/RAID/etc.  Haven't
> > tried it myself, but it should work.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2001-05-24 22:07 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-22 16:02 [linux-lvm] Converting my Root file system to LVM Rupert Heesom
2001-05-22 16:22 ` Rupert Heesom
2001-05-22 22:56 ` Steve Wray
2001-05-22 23:53   ` Rupert Heesom
2001-05-23  4:01     ` Steve Wray
2001-05-23  5:03       ` S. Michael Denton
2001-05-23 14:11         ` Rupert Heesom
2001-05-23 22:56           ` Andreas Dilger
2001-05-23 23:18             ` [linux-lvm] Is now: Resizing & LVM shutdown Rupert Heesom
2001-05-24  3:36               ` Austin Gonyou
2001-05-24  0:24                 ` Rupert Heesom
2001-05-23  6:11                   ` Glenn Shannon
2001-05-24 12:29                     ` Ben Lutgens
2001-05-23 12:35                       ` Glenn Shannon
2001-05-24  6:54               ` Andreas Dilger
2001-05-23 13:14       ` [linux-lvm] Converting my Root file system to LVM Rupert Heesom
2001-05-23 16:49     ` Andreas Dilger
2001-05-23 15:02       ` [linux-lvm] Converting my Root file system to LVM [last question] Rupert Heesom
2001-05-23 22:24         ` [linux-lvm] Converting my Root file system to LVM [lastquestion] Steve Wray
2001-05-24  6:41           ` Andreas Dilger
2001-05-24 10:52             ` Rupert Heesom
2001-05-24 22:07               ` Steve Wray
2001-05-24 14:22             ` AJ Lewis
2001-05-24 19:48               ` Luca Berra
2001-05-22 23:25 ` [linux-lvm] Converting my Root file system to LVM Andreas Dilger
2001-05-23 13:14   ` Michael Tokarev

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.