0

I have rented a dedicated server with two 500gb hardisks running centos 6.

On this server there are 3 partitions.

  1. boot
  2. root 50gb
  3. swap 50gb
  4. empty 400gb

Now I want to create a logical volume group spanning the empty 400gb on the first disk and merginging it with the empty 400gb on the second disk.

I've read tutorial after tutorial but I cannot understand how to accomplish this task. I just want to merge the empty partition with the empty disk.

Can someone please suggest how may I accomplish this, or if it is at all possible?

2

1 Answer 1

0

It is possible to do this. There are 3 parts to LVM -

  • The Physical Volume
  • The Volume Group
  • Logical Volumes

So the way I would do this is to create a partition on the second disk (you don't need to do this, but its the "correct" way to do it)

First instruct the Operating system that you have 2 Physical Volumes you wish to assign to LVM - you do this by running the following command for each of the 2 partitions

pvcreate /dev/sdXX     

The second step is to assign both physical volumes into 1 volume group -

vgcreate vgname /dev/sdXX /dev/sdXX

The third step is to create a logical volume

lvcreate -n NewPartitionName vg -L 899G

In this example I've created an 899 gig block device which will be called /dev/vgname/NewPartitionName. Depending on your needs, seriously consider starting off only using, say 800 Gigs of space, leaving the last 99 gigs free - this will give you freedom to create additional volumes - including snapshots, which can be useful. You can always expand the current volume later (even when the filesystem is in use). Its is easier to make a volume bigger then smaller.

At this stage you are ready to add your filesystem. Not sure if you need help here, but you could use a command mkfs.ext4 /dev/vgname/NewPartitionName to format the partition. You can then add it to your fstab file if you want it to be automatically mounted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .