All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dieter Stüken" <stueken@conterra.de>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Setting up LVM with existing RAID 1 (Mirror)
Date: Tue, 27 Jun 2006 11:04:22 +0200	[thread overview]
Message-ID: <44A0F496.3060008@conterra.de> (raw)
In-Reply-To: <20060626164657.79277.qmail@web33408.mail.mud.yahoo.com>

Hi Rehan,

If I have a look at your partition table

> Disk /dev/sda: 73.2 GB, 73274490880 bytes
> 255 heads, 63 sectors/track, 8908 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>    Device Boot Start    End      Blocks   Id System
> /dev/sda1   *      1    784     6297448+  83 Linux
> /dev/sda2        785   8907    65247997+   f W95 Ext'd (LBA)
> /dev/sda5        785   1176     3148708+  82 Linux swap
> /dev/sda6       1177   1960     6297448+  83 Linux
> /dev/sda7       1961   2744     6297448+  83 Linux
> /dev/sda8       2745   3528     6297448+  83 Linux
> /dev/sda9       3529   3790     2104483+  83 Linux
> /dev/sda10      3791   4052     2104483+  83 Linux

it seems /dev/sda2 is a container holding sda5-10 as logical 
partitions. This concept is similar to a LVM layout, where sda2
would be a physical volume (PV) containing several logical volumes
(LV) like /opt /home swap etc. 

But even if you have a lot of free space within sda2, it does
not help you, as long as the whole disk is occupied by sda2.
You have to get rid of all the logical partitions :-(

But you may keep your root partition :-)

step 1: erase sda5-10

You may copy /usr /var and /home into your root partition
(use: cp -a). Swap can be disabled for a while. But you
have to save /opt (may be /tmp) to an additional disk.
Then you are able delete sda5-10.

step 2: initialize LVM / create a logical volume

Turn sda2 into a PV with "pvcreate /dev/sda2".
Create a logical volume: "vgcreate volume1 /dev/sda2".
You may choose any other name instead of "volume1".
Now you create your LVs as needed:

lvcreate volume1 -n swap -l 2G
lvcreate volume1 -n usr -l 6G
lvcreate volume1 -n opt -l 12G
....

mkswap /dev/volume1/swap
mke2fs /dev/volume1/usr
mke2fs /dev/volume1/opt
...

step 3: copy back the data to your newly created LVs.

conclusion:

Your new LVs have real names instead of just /dev/sda8.
Any free space you have may be assigned to any of your
LVs, as they don't have to be continuous any more.
Anyway, dealing with additional disk space is MUCH
easier once after you started using LVM. 

Dieter.

      reply	other threads:[~2006-06-27  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 16:46 [linux-lvm] Setting up LVM with existing RAID 1 (Mirror) Rehan
2006-06-27  9:04 ` Dieter Stüken [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44A0F496.3060008@conterra.de \
    --to=stueken@conterra.de \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.