linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] create physical partition from logical partition
@ 2013-02-06 17:10 fakhreddine HABIB
  2013-02-07 11:01 ` [linux-lvm] Re : " georges.giralt
  2013-02-07 13:02 ` [linux-lvm] " Marian Csontos
  0 siblings, 2 replies; 3+ messages in thread
From: fakhreddine HABIB @ 2013-02-06 17:10 UTC (permalink / raw)
  To: linux-lvm


[-- Attachment #1.1: Type: text/plain, Size: 501 bytes --]

Hi,

   I nead please your help to create a physical partition from a logical
partition.

   I present my problem : I have the configuration (attached pic) of the
partitions.

   I use the centos system. The problem that my group volume "vg_rega" use
the whole of the physical disk. I want to install Ubuntu system with centos
(dual boot), but i need a physical partition to do that. How can'i convert
the " Unused Space " logical partition to physical partition to install
Ubuntu.

  Thank you.

F.H

[-- Attachment #1.2: Type: text/html, Size: 567 bytes --]

[-- Attachment #2: Screenshot.png --]
[-- Type: image/png, Size: 82029 bytes --]

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

* [linux-lvm] Re :  create physical partition from logical partition
  2013-02-06 17:10 [linux-lvm] create physical partition from logical partition fakhreddine HABIB
@ 2013-02-07 11:01 ` georges.giralt
  2013-02-07 13:02 ` [linux-lvm] " Marian Csontos
  1 sibling, 0 replies; 3+ messages in thread
From: georges.giralt @ 2013-02-07 11:01 UTC (permalink / raw)
  To: LVM general discussion and development

Hello !
I suppose you do not want to loose any data ?
If yes, I'll give only steps to follow and not detailed instructions in order for you to study and understand what you are doing and not break anything. 
Actually, given the picture shown, the volume group uses only the second partition of the physical disk (sda2) not the whole disk. But this is not relevant. 
At first, you have to calculate how many PE left free you have. Decide what number you will keep free for future Centos extension. 
Then, reduce the volume group size by the amount you can free (Number of PE x PE size)
If this is successful, Check that the now unallocated PE are at the end of sda2. 
Then reduce the size of the sda2 partition, freeing space for a new partition. 
Then create a new partition onto which you could install the new OS... 

Hope this helps. 
----- Mail d'origine -----
De: fakhreddine HABIB <fakhreddine2006@gmail.com>
À: linux-lvm@redhat.com
Envoyé: Wed, 06 Feb 2013 18:10:15 +0100 (CET)
Objet: [linux-lvm] create physical partition from logical partition

Hi,

   I nead please your help to create a physical partition from a logical
partition.

   I present my problem : I have the configuration (attached pic) of the
partitions.

   I use the centos system. The problem that my group volume "vg_rega" use
the whole of the physical disk. I want to install Ubuntu system with centos
(dual boot), but i need a physical partition to do that. How can'i convert
the " Unused Space " logical partition to physical partition to install
Ubuntu.

  Thank you.

F.H

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

* Re: [linux-lvm] create physical partition from logical partition
  2013-02-06 17:10 [linux-lvm] create physical partition from logical partition fakhreddine HABIB
  2013-02-07 11:01 ` [linux-lvm] Re : " georges.giralt
@ 2013-02-07 13:02 ` Marian Csontos
  1 sibling, 0 replies; 3+ messages in thread
From: Marian Csontos @ 2013-02-07 13:02 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: fakhreddine HABIB

On 02/06/2013 06:10 PM, fakhreddine HABIB wrote:
> Hi,
>
>     I nead please your help to create a physical partition from a logical
> partition.
>
>     I present my problem : I have the configuration (attached pic) of the
> partitions.
>
>     I use the centos system. The problem that my group volume "vg_rega" use
> the whole of the physical disk. I want to install Ubuntu system with centos
> (dual boot), but i need a physical partition to do that. How can'i convert
> the " Unused Space " logical partition to physical partition to install
> Ubuntu.

1st: backup your data! Though operations should be safe, there is always 
human factor and other risks.

Before creating a new partition you will need to resize (shrink) the PV:

     pvresize --pvresize --setphysicalvolumesize DESIRED_PV_SIZE /dev/sda2

pvresize should be safe: it will only shrink PV when there is free space 
at the end, but does not relocate LVs if the free space is in the 
middle. In that case you will need to move the extents first:

     pvmove --alloc anywhere /dev/sda2:OLDSTART-OLDEND /dev/sda2

This may not work correctly and allocate data in the region being moved 
from (which needs to verify with latest version and report)

Then you should be able to shrink the sda2 partition, using parted or 
fdisk. This may be the riskiest part.

However, Ubuntu is able to use Logical Volumes, so you should not need 
to add more physical partitions: for me "dualboot" of 2 linux systems 
with single /boot partition worked mostly fine - except when one is 
using old grub (CentOS) and another grub2 (ubuntu), but even that is not 
impossible...

-- Marian

>
>    Thank you.
>
> F.H
>
>
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

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

end of thread, other threads:[~2013-02-07 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-06 17:10 [linux-lvm] create physical partition from logical partition fakhreddine HABIB
2013-02-07 11:01 ` [linux-lvm] Re : " georges.giralt
2013-02-07 13:02 ` [linux-lvm] " Marian Csontos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).