[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LVM and install over existing installation

Tim Anstey wrote:

I've recently acquired a cheap dedicated server for testing purposes which was shipped was CentOS, not my preferred distro. To resolve this I intend to install Debian from within the existing install as documented in the Debian installation guide.

Now, this has always worked well in the past and this is aided by the fact that normally servers are provisioned with normal, boring filesystems like / being ext3. In this instance they've used LVM and frankly I've never used LVM before and I don't know how it will effect what I plan to do.

So what I'm asking is, can I turn the LVM partition back into ext3 or alternatively can I just treat the LVM partition as a normal one?
it probably has ext3 already (or another filesystem) but this would be on top of a "volume group"

makes sense? probably not, you might want to consider reading in to LVM, it could be very useful to you depending on your needs.

in this case /dev/hda2 is configured as "physical volume" in LVMspeak (you could also make a single partition or 2 disks 1 physical colume)

now, what does that do? on top of a physical volume you can put several "volume groups" a volume group is like a partition but you can resize them later on, this could be very useful.

on top of such a resizable volume group you can put a file system like ext3 and mount it as any other partition.

the command "pvdisplay" will show you some more details about you physical volumes.
(below is mine as an example)
 --- Physical volume ---
 PV Name               /dev/md3
 VG Name               vg
 PV Size               921.27 GB / not usable 3.00 MB
 Allocatable           yes
 PE Size (KByte)       4096
 Total PE              235844
 Free PE               10696
 Allocated PE          225148
 PV UUID               l0Jf1O-QD9C-8Ee4-6KG8-Nnv1-5ZL5-DzQeEo

as we said earlier, within each physical volume you can have several volume groups
"vgdisplay" will show you if you have any.
(below is mine as an example, you see i only have 1 large volume group here, i could resize this one and add others but i personally only use it form LVMsnapshots, another nice feature of LVM )

 --- Volume group ---
 VG Name               vg
System ID Format lvm2
 Metadata Areas        1
 Metadata Sequence No  34
 VG Access             read/write
 VG Status             resizable
 MAX LV                0
 Cur LV                2
 Open LV               1
 Max PV                0
 Cur PV                1
 Act PV                1
 VG Size               921.27 GB
 PE Size               4.00 MB
 Total PE              235844
 Alloc PE / Size       225148 / 879.48 GB
 Free  PE / Size       10696 / 41.78 GB
 VG UUID               0RCDf5-hk05-TIVR-ALxj-efUU-yMc3-tzixJS

[root@server ~]# fdisk -l;

Disk /dev/hda: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2482    19832242+  8e  Linux LVM

The biggest problem I foresee with the LVM configuration (apart from not understanding it) is that there is no proper swap partition, it's a logical volume and the only way I know of to do the remote change is to boot into the swap partition.
since i'm not familiar with the routine you describe i can not give you any useful advice, but you could put the swap on top of the lvm as a volume group i guess (would this work?) or you completely remove the LVM, but then i would advise to properly remove it with the LVM commands, i had disks "remembering" that they were LVM in the past even if they were overwritten.

Anyone got any useful thoughts?



Just another collection of nuts

Reply to: