LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   how do I add partitions to drives that have Logical Volume (LVM) partitions? (http://www.linuxquestions.org/questions/linux-software-2/how-do-i-add-partitions-to-drives-that-have-logical-volume-lvm-partitions-473840/)

The MJ 08-14-2006 04:34 PM

how do I add partitions to drives that have Logical Volume (LVM) partitions?
 
I sucessfuly resized a LVM partition to make room for a fat32 partition. here is the output of lvm lvscan:
Quote:

ACTIVE '/dev/VolGroup00/LogVol00' [137.84 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
Since I have a 200GB hard drive, this should leave about 60GB for my fat32 partition, but when I try to make a new partition in parted, fdisk, or cfdisk, I get:
Quote:

No free sectors available
They all show that the Linux LVM partition is 199.04 GB

Why am I getting 2 different numbers, how big is my lvm partition REALLY, and how do I get my 60GB fat32 partition on there?

syg00 08-14-2006 06:43 PM

Sounds like you're getting confused between logical and physical partition.
What does "fdisk -l" show now.

The MJ 08-14-2006 08:01 PM

fdisk -l shows that the LVM partition is 199.04GB:
Quote:

Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 24792 199037317+ 8e Linux LVM
If the partition really is 200gb, how do I shrink it? I did lvm lvresize already.

The MJ 08-15-2006 10:33 PM

Okay, I have narrowed it down some. The problem is that, while I did resize the Logical Volume, I did not resize the Logical Volume Group. The bigger problem is that there is a command to resize a Logical Volume Group, it has not been implemented yet.

My question is, how in hell are you supposed to resize a VolGroup?

WhatsHisName 08-16-2006 12:53 AM

Quote:

...there is a command to resize a Logical Volume Group, it has not been implemented yet.
What you need to do is to resize the physical volume using pvresize.

The command became available with the more recent lvm2 updates in FC5, CentOS4, Debian Etch and probably many other distros.

Quote:

My question is, how the micro$oft are you supposed to resize a VolGroup?
What distro are you using? Update the system and check whether pvresize is available. If not, then maybe itís time for a version upgrade.

Otherwise, you do it the olde fashioned way by backing up your installation, reformatting the drive and then restoring the installation.

The MJ 08-17-2006 07:15 PM

Well, I figured it out on my own. I had to
1 delete the swap partition in the volume group, then
2 back up the volume group's data, then
3 edit the backup so that the vg is smaller
4 restore the edited backup
5 recreate the swap file
6 calculate size of new vg and use that to update the partition table via fdisk

That was the hardes six steps I have ever done.
The ironic part is that when I created a partition for windows, and popped the windows disk in, The partitions were gone once again, and I was unable to restore the partitions with fdisk.

In short, it was all for nothing. Good thing I made a backup this time...


Thanks for all your help.


All times are GMT -5. The time now is 03:40 PM.