All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Changing from standard partition to LVM partition without reinstalling
@ 2017-03-03  9:51 Amjad Syed
  2017-03-03 17:49 ` James Hawtin
  0 siblings, 1 reply; 3+ messages in thread
From: Amjad Syed @ 2017-03-03  9:51 UTC (permalink / raw)
  To: linux-lvm

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

Hello,

We are using  RHEL  7.2 servers to create two node  Active/Passive  High
available system with shared storage (SAN). We are using pacemaker.

The existing  Partition on HDD of  Server is of standard type and  we would
like to move it to LVM type as we have just two nodes and we are not going
to use clvm.

The current partition on HDD is as follows
/   ->  50 GB
swap -> 25 GB
/u01 -> 200GB

What is the best way to change the partition type to LVM without
reinstallation?

[-- Attachment #2: Type: text/html, Size: 693 bytes --]

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

* Re: [linux-lvm] Changing from standard partition to LVM partition without reinstalling
  2017-03-03  9:51 [linux-lvm] Changing from standard partition to LVM partition without reinstalling Amjad Syed
@ 2017-03-03 17:49 ` James Hawtin
  2017-03-03 18:46   ` Brian J. Murrell
  0 siblings, 1 reply; 3+ messages in thread
From: James Hawtin @ 2017-03-03 17:49 UTC (permalink / raw)
  To: LVM general discussion and development

On 03/03/17 09:51, Amjad Syed wrote:
> Hello,
>
> We are using  RHEL  7.2 servers to create two node  Active/Passive 
>  High available system with shared storage (SAN). We are using pacemaker.
>
> The existing  Partition on HDD of  Server is of standard type and  we 
> would like to move it to LVM type as we have just two nodes and we are 
> not going to use clvm.
>
> The current partition on HDD is as follows
> /   ->  50 GB
> swap -> 25 GB
> /u01 -> 200GB
>
> What is the best way to change the partition type to LVM without 
> reinstallation?
>
Its possible but its quite difficult to do as you don't have a seperate 
/boot partion. I don't know if RHEL 7.2 has an LVM aware grub. Moving it 
to LVM would require a new initrd which can cause lots of problems. If I 
was doing it I would use tar or dump to copy the information off the 
disk. Repartition it with LVM with a physical partiton for /boot, do 
some fiddling with a boot disk to sort the boot out then it done. That 
is alot of work for very little gain IMHO, so I would question why you 
want to convert this to LVM are you looking to reclaim space from / to 
use elseware? Is you swap space far to big and you with to use that space?

Personally I would add a temporary new disk to the system create an LVM 
PV on that create a VG/LV for /u01 and format it and copy the data from 
/u01. The I would delete the existing swap and /u01 partitions. Create a 
new partition using all the free space on the old disk as and LVM PV, 
add it to the VG, the use pvmove to move the data back from the tempory 
disk back to the main one. If I wished to steal some space from / I 
would create a filesystem based swap file on / or just create a smaller 
swap from the lvm. This all has the advantage that you don't have to fix 
the boot, saving a lot of effort, and redoing an initrd from a boot disc 
is not something to be done by the inexperienced. However this would 
just require making new filesystems and copying data.

James

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

* Re: [linux-lvm] Changing from standard partition to LVM partition without reinstalling
  2017-03-03 17:49 ` James Hawtin
@ 2017-03-03 18:46   ` Brian J. Murrell
  0 siblings, 0 replies; 3+ messages in thread
From: Brian J. Murrell @ 2017-03-03 18:46 UTC (permalink / raw)
  To: linux-lvm

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

On Fri, 2017-03-03 at 17:49 +0000, James Hawtin wrote:
> On 03/03/17 09:51, Amjad Syed wrote:
> > Hello,
> > 
> > We are using  RHEL  7.2 servers to create two node  Active/Passive 
> >  High available system with shared storage (SAN). We are using
> > pacemaker.
> > 
> > The existing  Partition on HDD of  Server is of standard type
> > and  we 
> > would like to move it to LVM type as we have just two nodes and we
> > are 
> > not going to use clvm.
> > 
> > The current partition on HDD is as follows
> > /   ->  50 GB
> > swap -> 25 GB
> > /u01 -> 200GB
> > 
> > What is the best way to change the partition type to LVM without 
> > reinstallation?
> > 
> 
> Its possible but its quite difficult

It's not really that difficult, if he understands the mechanics of
partitioning and resizing filesystems.  He does need to have 200GB of
free, unpartitioned space on his HDD to create a new partition to be
his new PV.

Or rather he needs as least as much free space in /u01 as he has
consumed space in which case he can shrink the /u01 filesystem and
partition and create a new partition to be his PV.

> to do as you don't have a seperate 
> /boot partion.

The / partition can become his /boot once he has evacuated it and
shrunk it.

As long as there is some usable amount of free space on the disk (in
existing partitions or otherwise) this is all just a shell game of
partitions and data, creating new partitions, resizing or deleting old,
moving data around, etc.

It all has to be done from some kind of live boot media though as you
don't really want to be moving live data around.

And really, I will refrain from describing the exact steps in this
partition partition shell game as (a) I don't want to miss any and mess
up his system and (b) if he cannot really come up with the procedure
himself, he really shouldn't be carrying it out.


> If I 
> was doing it I would use tar or dump to copy the information off the 
> disk.

And yes, if he can't really come up with the recipe to do the partition
shell-game, this is what he should do.

Cheers,
b.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2017-03-03 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03  9:51 [linux-lvm] Changing from standard partition to LVM partition without reinstalling Amjad Syed
2017-03-03 17:49 ` James Hawtin
2017-03-03 18:46   ` Brian J. Murrell

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.