LVM and MythTV

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Fri Jan 19 19:46:08 UTC 2007


On Tue, Jan 16, 2007 at 05:48:36PM -0500, Merv Curley wrote:
> In my other reply, I gave some of this info.  Since it comes from another 
> computer I had to type it and didn't give all the info like you did above

You won't get info on the other lvm since it isn't 'active' on the
current system (and hence not in the config for lvm on the current
system).  You could potentially find it by doing pvscan or vgscan to
search for it.  vgchange I believe can be used to enable a vg when you
find it.

> But I won't have a filesystem on this new linux partition on a new drive. 
> The stuff relative to this is down a bit.

Filesystems go on top of the logical volumes.  The partition/drive is
just block storage.

For example:

+-------------------------+-----------------------+
| mount as /data (400GB)  | mount as /home (70GB) | Mount points
+-------------------------+-----------------------+
| ext3 filesystem (400GB) | ext3 filesystem (70GB)| Filesystems
+-------------------------+-----------------------+
| LV_data(400GB)          | LV_home (70GB)        | Logical Volumes
+-------------------------+-----------------------+
| VG_Main(470GB)                                  | Volume Group
+---------------+---------------------------------+
| PV_hda2(50GB) | PV_hdb1(320GB) | PV_sda1(100GB) | Physical Volumes
+---------------+---------------------------------+

You can add more physical volumes to a volume group.  You can add
logical volumes to a volume group if there is unused extents in it (the
example above doesn't have any free space left).  You can even pvmove
logical volumes away from specific physical volumes (if there is other
free space in the volume group), and then vgremove that physical volume
from the volume group if there is no logical volume using any part of
the physical volume any more (great when getting rid of an old smaller
drive for example, or transitioning from one raid to another).

To increate a logical volume you:
lvextend the logical volume by the amount of space you want to expand it
by.
resize the filesystem on the logical volume to the new size.

To decrease a logical volume you:
resize the filesystem down to less than the new size (to be safe)
reduce the lvreduce the logical volume to your new size
resize the filesystem up to match the exact new size.

You can avoid the second resize if you are absolutely sure about the
size you are resizing to (there are management tools for lvm that can do
that for you I believe).

> No I expect to delete all the existing partitions and create one linux type 
> partition.  Then create a Logical Volume add it to the videovg  VolumeGroup 
> on hda.  Maybe I create a new VolumeGroup on hdb?

No use one volume group.  If you don't want to keep any data from the
new drive, you simply delete all the partitions (using cfdisk), create
one new partition, set to type to LVM, then use pvcreate on the new
partition, vgextend to add the new partition to your existing volume
group, and now vgdisplay should show the new drive's size as free space.

>  It would be nice if it were a part of videolv01, but I don't think that is 
> possible. I think I can change the configuration of the backend, so the 
> recordings sub-directory of /video would be this new mount in fstab. I have 
> seen three mount points suggested for Mythv 
> data,  /var/lib/xxxx,  /mnt/store and MythDora set it up as /video

It is posible.  That is the main point of LVM.

> This will be confusing to you I am sure since these 2 messages are a part of 
> the same thread. They are tied together in my grey cells, maybe I need to 
> start over with this info?

--
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list