Home > Linux > Installing a server based on LVM on Centos 5.4

Installing a server based on LVM on Centos 5.4

Hello everybody, are you ok?

This new generation gets over all what I’ve expected. When I was gonna resize a partition I used to do this task either partition magic for Windows or resize2fs for Linux ext3 file systems and sometimes it was resized for breakfast, don’t misunderstood me, but it’s not definitely the most safe way to resize partitions. I know there are many ways to implement it, but for now I’m running for LVM :P

Today there are many tools available to resize a partition, however when we’re talking about a critical server in output which it has incorporated raid and unstoppable services, we need to design better how the information will be stored as well as implementing a file system more dynamic.

Here are the steps for installing a server based on LVM.

Let’s get started.

Throughout this installation  process I suppose that you know installing a Linux from scratch.

1- As you can see at this picture,  we’ve got a scene where shows 2 disks. the first one 30 GB and de second one 20GB.

2 disks: the first one 30 GB and the second one 20GB

2- First of all we should create a bootable partition out of the LVM group. Let’s do it now. the partition /boot must be created on the disk one.

Create /boot on hda(disk one)

3- Now, select the partition FREE at the  disk one and let’s set a physical volume LVM. Do that typing “New”.  The proprieties “Allowables Drivers” must be changed to what appears on the picture. The “disk two” has to be unselected leaving just the disk one selected.  Fill to maximun allowable size has to be selected as well as Force to be a primary partition must be checked.

Creating a physical volume LVM

4- After that,  select the partition FREE at the  disk two and let’s set a physical volume LVM. Do that typing “New”.  The proprieties “Allowables Drivers” must be changed to what appears on the picture. The “disk one” has to be unselected leaving just the disk two selected.  Fill to maximun allowable size has to be selected as well as Force to be a primary partition must be checked.

5- Once the partitions are created as physical volume LVM, it’s time to create the Volume Group where the partitions created into this group will act over LVM.  Select the first physical volume LVM created and click on LVM Button (It’s is located on the right side).
A new screen will open and you have to select on “Physical Volume to use” all physical volumes were created. On this example have been created 2 physical volumes LVM, so select these two ones.  Notice that TOTAL SPACE will be increased by 2 disks.

Creating a Volume Group

6- There must be something missing  here…. Whoa!! Of course. Let’s create the partitions.  here you are a schema:  swap , / , /home, /db: both of these with ((RAM Memory amount * 2) below 2GB or (RAM Memory amount + 2 GB) above 2GBs) must be set for swap, 15 GB for / , 10 GB for /home and 2,5 GB for /db. That’s just illustration, you can create whatever you want.

Creating partitions into the Volume Group

8- Next picture’s gonna illustrate how the partition’s schema is like.

Partition's schema

9- So, I disabled firewall and SELinux and on top of all that I also installed (Administration Tools – System Tools – X Window System)

Some idea what to install

once installed(Firewall)

once installed (SELinux)

once installed(SELinux)

10 – Open a xterm and type: system-config-lvm. it will appear something like this: As you can see, We find the volume group in two views – Logical and physical. There’s another session called  Unitialized Entities with is useful to store the partitions which aren’t LVM.

system-config-lvm

11 – If we expland VolGroup00 Logical View, we can be able to see partitions created by us at the installation time. As you can see, it’s a / partition and you can find out more details on the right frame.

Partition / view

12 -Here is a main logical volume view. Actually you can see that available space free is zero, until we shrinking some partition and you get this such available space destinated to resize other partitions.

Main logical volume view.

13 -Okay, now I’m gonna add another hard disk at the server. It’s about time C’mon. I put a hard disk of 40 GB. Let’s expand the session Uninitialized Entities. We can see hdd included without entity. Be gentle and click on Initialize Entity. Hold on a couple of seconds and …. here you are! go to 14th step.

/boot - is out of the LVM grou`

/boot out of LVM Volume

14 – Once Initialized, the disk needs to be integrated to VolGroup00 LVM. Click on Add to existing Volume Group. Then select  VolGroup00 and click on Add.

15 – Then, look for the logical partition for / and click on Edit Properties.  Before had 14.62 GB and now we are resizing the partition for 41.84 GB. It’s 27.22 more added at the partition. If we added a hard disk of 40 GB, it still has 12.78 GB left. Once it is changed, confirm OK.

Resizing / partition

16 – Now, there are 12.78 remainding. Let’s fill this gap and put all this rest to /home

Resizing the remainder part to /home

Resizing the remainder part.

17- Checking out what turned out about this experience.

scored: winner.

Bye bye folks.. see ya! :O

Categories: Linux
  1. Ivan
    April 21, 2010 at 8:40 am

    eeeeee gran tutorial las fotos me suenan jajjajajaja!!!

  1. No trackbacks yet.

Leave a comment