Hi all I have a remote server (i.e SSH access only) which was incorrectly partitioned and I urgently need to get it up and running. It's got a 500GB HDD, but the PV is only 10GB big, so I can't add more LV's to to. P.S. This is on LVM, btw.
[root@nd11176 ~]# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 33 265041 83 Linux /dev/sda2 34 1338 10482412+ 8e Linux LVM /dev/sda3 1339 1860 4192965 82 Linux swap / Solaris
[root@nd11176 ~]# pvscan PV /dev/sda2 VG VolGroup00 lvm2 [9.97 GB / 0 free] Total: 1 [9.97 GB] / in use: 1 [9.97 GB] / in no VG: 0 [0 ]
[root@nd11176 ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2
[root@nd11176 ~]# lvscan ACTIVE '/dev/VolGroup00/LogVol00' [9.97 GB] inherit
So, my question is, if I extend the Physical Volume, what else do I need todo in order to add more Logical Volume's?
On Monday 11 May 2009, Rudi Ahlers wrote:
Hi all I have a remote server (i.e SSH access only) which was incorrectly partitioned and I urgently need to get it up and running. It's got a 500GB HDD, but the PV is only 10GB big, so I can't add more LV's to to. P.S. This is on LVM, btw.
Resizing the PV _can_ be done, but, adding another PV is easier.
Once your VG contains a bigger PV or two PVs then you can create any new LVs you want.
/Peter
Rudi Ahlers wrote:
Hi all
I have a remote server (i.e SSH access only) which was incorrectly partitioned and I urgently need to get it up and running. It's got a 500GB HDD, but the PV is only 10GB big, so I can't add more LV's to to. P.S. This is on LVM, btw.
[root@nd11176 ~]# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 33 265041 83 Linux /dev/sda2 34 1338 10482412+ 8e Linux LVM /dev/sda3 1339 1860 4192965 82 Linux swap / Solaris
[root@nd11176 ~]# pvscan PV /dev/sda2 VG VolGroup00 lvm2 [9.97 GB / 0 free] Total: 1 [9.97 GB] / in use: 1 [9.97 GB] / in no VG: 0 [0 ]
[root@nd11176 ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2
[root@nd11176 ~]# lvscan ACTIVE '/dev/VolGroup00/LogVol00' [9.97 GB] inherit
So, my question is, if I extend the Physical Volume, what else do I need todo in order to add more Logical Volume's?
where's the rest of this disk? unpartitioned? create another LVM partition as sda4, and add it to the VolGroup00, then grow LogVol00, and use resize2fs to grow the file system to fill the new LogVol00 size.
On Mon, May 11, 2009 at 11:36 AM, John R Pierce pierce@hogranch.com wrote:
Rudi Ahlers wrote:
Hi all
I have a remote server (i.e SSH access only) which was incorrectly partitioned and I urgently need to get it up and running. It's got a 500GB HDD, but the PV is only 10GB big, so I can't add more LV's to to. P.S. This is on LVM, btw.
[root@nd11176 ~]# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 33 265041 83 Linux /dev/sda2 34 1338 10482412+ 8e Linux LVM /dev/sda3 1339 1860 4192965 82 Linux swap / Solaris
[root@nd11176 ~]# pvscan PV /dev/sda2 VG VolGroup00 lvm2 [9.97 GB / 0 free] Total: 1 [9.97 GB] / in use: 1 [9.97 GB] / in no VG: 0 [0 ]
[root@nd11176 ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2
[root@nd11176 ~]# lvscan ACTIVE '/dev/VolGroup00/LogVol00' [9.97 GB] inherit
So, my question is, if I extend the Physical Volume, what else do I need todo in order to add more Logical Volume's?
where's the rest of this disk? unpartitioned? create another LVM partition as sda4, and add it to the VolGroup00, then grow LogVol00, and use resize2fs to grow the file system to fill the new LogVol00 size. _______________________________________________
Hi John,
It seems like the tech @ the data centre has only created a 10GB partition, and since I only have SSH access to the server, I've decided to send the server back to have it properly repartitioned.
Rudi is right, the easiest/fastest thing to do is to just add the new partition to the pv and expand your lvs as you see fit. But if someone ever wants to resize a pv I have done it on some vm hosts. It a touch scary but straight forward (make backups!). It really can only be done on drives where the lvm is the last partition, or partitions after the lvm partition is perishable data (swap).
The steps (from memory lacking arguments) * fdisk -l /dev/sda (whatever the physical drive is) and write down all the partition information (make sure you get block alignment if you've changed that). * remove the exisiting lvm partiton and whatever partitions are after it. * recreate the lvm partition with whatever extra size you want and set it's type. The os won't recognize the extra space. * reboot, the os recognises the space * run pvresize * run pvscan * use vgdisplay to find out how many extents available. if you want to extend a logical volume to the entire pvolume size. * use resize2fs to extend the filesystem on the volume online. * use tune2fs to reduce the number of blocks reserved for root to 1%
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Rudi Ahlers Sent: Monday, May 11, 2009 1:35 AM To: CentOS mailing list Subject: [CentOS] is it possible to resive a PV in LVM and add more LV's ?
Hi all
I have a remote server (i.e SSH access only) which was incorrectly partitioned and I urgently need to get it up and running. It's got a 500GB HDD, but the PV is only 10GB big, so I can't add more LV's to to. P.S. This is on LVM, btw.
[root@nd11176 ~]# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 33 265041 83 Linux /dev/sda2 34 1338 10482412+ 8e Linux LVM /dev/sda3 1339 1860 4192965 82 Linux swap / Solaris
[root@nd11176 ~]# pvscan PV /dev/sda2 VG VolGroup00 lvm2 [9.97 GB / 0 free] Total: 1 [9.97 GB] / in use: 1 [9.97 GB] / in no VG: 0 [0 ]
[root@nd11176 ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup00" using metadata type lvm2
[root@nd11176 ~]# lvscan ACTIVE '/dev/VolGroup00/LogVol00' [9.97 GB] inherit
So, my question is, if I extend the Physical Volume, what else do I need todo in order to add more Logical Volume's?
-- Kind Regards Rudi Ahlers CEO, SoftDux Hosting Web: http://www.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532
On Mon, May 11, 2009 at 7:55 PM, Flaherty, Patrick pflaherty@wsi.comwrote:
Rudi is right, the easiest/fastest thing to do is to just add the new partition to the pv and expand your lvs as you see fit. But if someone ever wants to resize a pv I have done it on some vm hosts. It a touch scary but straight forward (make backups!). It really can only be done on drives where the lvm is the last partition, or partitions after the lvm partition is perishable data (swap).
The steps (from memory lacking arguments)
- fdisk -l /dev/sda (whatever the physical drive is) and write down all
the partition information (make sure you get block alignment if you've changed that).
- remove the exisiting lvm partiton and whatever partitions are after
it.
- recreate the lvm partition with whatever extra size you want and set
it's type. The os won't recognize the extra space.
- reboot, the os recognises the space
- run pvresize
- run pvscan
- use vgdisplay to find out how many extents available. if you want to
extend a logical volume to the entire pvolume size.
- use resize2fs to extend the filesystem on the volume online.
- use tune2fs to reduce the number of blocks reserved for root to 1%
thanx guys :) I ended up sending the server back to the IDC to have it repartitioned by the techs, since they have direct access to the server and the installation DVD's.