[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: partitioning tools for LVM



On Thursday 11 January 2007 13:35, hendrik@topoi.pooq.com wrote:
> Are there any partitioning tools that happily deal in LVM on RAID?
>
> parter, gparted, fdisk, cfdisk seem not to, as least fron what
> documentation I've managed to find for them.

The nature of your question suggests that you don't really understand how 
LVM works. Here is a quick primer and some links:

When using LVM, you first need Physical Volues (PVs). These are real 
partitions or drives. Some examples would be /dev/hda2 or /dev/sdb. To use 
a device as a physical volume, you typically just run pvcreate on it; in 
general, you also set it to an "LVM" type partition using fdisk and 
friends, but this isn't strictly necessary. Anyway, it will destroy any 
existing data on each partition or device you use for a PV. Setting up PVs 
is the ONLY time you'll ever use a program like fdisk or parted. For the 
rest, you use LVM tools.

After you've created PVs, you will not ever use them directly. Instead, you 
group them together into a Volume Group (VG). A VG has a symbolic name you 
give to a group of PVs. You create one with vgcreate, e.g. if I wanted to 
create a VG called "vgmain" using two PVs I'd created previously, I might 
run "vgcreate vgmain /dev/hda2 /dev/sdb". You can also add and remove PVs 
on-the-fly later.

*Finally*, you need to create Logic Volumes, which is the whole point of an 
LVM system (that's why it's *Logical Volume Management*). These are the 
actual volumes that you treat like you used to treat partitions, e.g. put 
file systems on them. You create LVs as part of a Volume Group that you've 
previously created, and give them symbolic names. You can add, remove, and 
resize them using lv* commands. For instance, if I wanted a 500M LV 
named "opt", I might run "lvcreate -n opt -L500M vgmain". Now I'd probably 
make a filesystem on it with "mkfs.ext3 /dev/vgmain/opt" and put a line in 
my fstab like "/dev/vgmain/opt /opt ext3 defaults 0 0". Later, I might add 
or remove more LVs, resize them, etc. I can do all of the online, although 
obviously the data itself on the LV (e.g. a filesystem) may need to be 
unmounted and/or resized first, although most filesystems can at least GROW 
online, while mounted.

Anyway, see <http://tldp.org/HOWTO/LVM-HOWTO/> for a more in depth 
discussion. You can pretty much ignore anything that talks about "LVM1" 
unless you're working with a legacy system. There are also other systems 
like EVMS, but LVM2 is pretty much the mainstream.

-- 
Wesley J. Landaker <wjl@icecavern.net> <xmpp:wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2

Attachment: pgpwgBoOYSEts.pgp
Description: PGP signature


Reply to: