Operating System - Linux
1829585 Members
1911 Online
109992 Solutions
New Discussion

Creating extended partitions on Linux

 
SOLVED
Go to solution
JBR
Frequent Advisor

Creating extended partitions on Linux

Hi all, I have the following partition table in my disk.
Disk /dev/cciss/c0d0: 36.4 GB, 36413314560 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 10 80293+ 83 Linux
/dev/cciss/c0d0p2 11 1054 8385930 83 Linux
/dev/cciss/c0d0p3 1055 2760 13703445 8e Linux LVM
/dev/cciss/c0d0p4 2761 4427 13390177+ 8e Linux LVM

I want to create new one extended partition /dev/cciss/c0d0p4 and the old partition /dev/cciss/c0d0p4 to change to /dev/cciss/c0d0p5 (in LVM of course)

The configuration of LVM is:

--- Volume group ---
VG Name vg00
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 14
Open LV 14
MAX LV Size 2 TB
Max PV 256
Cur PV 2
Act PV 2
VG Size 25.75 GB
PE Size 32 MB
Total PE 824
Alloc PE / Size 822 / 25.69 GB
Free PE / Size 2 / 64 MB
VG UUID nbXkqk-Ho2o-IO1k-6Fq8-4TlK-Ldr6-igLZOj



--- Physical volumes ---
PV Name (#) /dev/cciss/c0d0p3 (2)
PV Status available / allocatable
Total PE / Free PE 417 / 2

PV Name (#) /dev/cciss/c0d0p4 (1)
PV Status available / allocatable
Total PE / Free PE 407 / 0
3 REPLIES 3
Ajay Agarwal
Frequent Advisor

Re: Creating extended partitions on Linux

To extend a logical volume you simply tell the lvextend command how much you want to increase the size. You can specify how much to grow the volume, or how large you want it to grow to.

Check out LVM HowTo:
http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html

Ivan Ferreira
Honored Contributor

Re: Creating extended partitions on Linux

This will be a problem because c0d0p4 is part of your current volume group, in that case, you should remove that partition from your volume group. What is the purpose of deleting the partition and creating an extended one? With LVM you don't have to think about partitions, but logical volumes.

You should consider resizing (growing/shrinking) your logical volumes instead of deleting the partitions. You can grow your logical volumes but you cannot shrink it wihout deleting it.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Siljumon Sebastian
New Member
Solution

Re: Creating extended partitions on Linux

Hi Macero,

This task involves risk of loosing data. If your data is critical it is recomented to take a backup. Then you can use the vgreduce command to realease the partition
/dev/cciss/c0d0p4 2761 4427 13390177+ 8e Linux LVM
see man vgreduce for more details

then delete this partition, create the extended partition and logical drivesas you require. You can add the newly created partitions to the vg using pvcreate & vgextend. Note that which ever partitions you want add to the vg should be of type 8e (Linux LVM). Check for any data lose. If any restore it from your backup

Regards
SMS