Ubuntu Server Lvm

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

LVM or Logical Volume Manager will allow you to combine hard drive partitions and stretch a mount point over multiple partitions. For instance your /var mount point is restricted by hard drive space on hda, but you have a second hard drive hdb.  So you will partition /var structure using the remainder of hard drive and then partition space from hard drive B, which will combine the space together. In this guide I will be using the follow mount points:

  • /boot – Boot Partition ext3
  • / – Root Partition xfs
  • swap – Swap Space
  • /var – Variable Data Partition xfs

I will be using Ubuntu Server distro to create the lvm partition structure. Start the install Ubuntu server and go though the setup the normal way. As soon as you come to the partition disk section, you will want to create some space for the /boot mount point. I usually use 100mb, and you need to set the boot flag to on. See the image below.

Boot Filesystem ext3

After you create the /boot partition, you will then need to convert the remaining free space into an lvm.

Logical Volume Manager

Once the free space has been changed to lvm file type; see image below. Scroll to the the top so you can now setup your logical volume group.

Configure Logical Volume Manager

Type a name for you logical volume group, I choose to use lvm.

Create Lvm Group

Then select the hard drives that will consist of your logical volume group.

Select Hard Drives

After you have created you logical volume group, the next thing that you have to do is section off the logical volume group into logical volume partitions. These partitions will consist of you /, swap space and the /var directory.

Create Logical Volume

Type a name for the logical volume partition, for instance root for /, swap for swap and var for /var.

Roof Xfs

Then specify the amount of space you want to use for your root partition.

Root

Then select the type of file system that you want to use for the partitions.

Set Filesystem

Once you are all set you should have something that resembles the picture below. If you want to add other partitions like /home, /opt, /tmp etc, simply create a name to identify the directory then section off the space, finally select the file system type and choose the mount point.

Finish Lvm Partition

6 Responses to Ubuntu Server Lvm

  • incubus says:

    Hi,

    I have added LVM partitions on my Ubuntu 9.10 box. I used the Ubuntu
    Alternate installation CD for the installation, as the main CD doesn’t
    offer option of partitioning using LVM.

    Everything went fine except in the next reboot of the box, the GRUB2 doesn’t
    load the kernel. I was told that the problem may be related to LVM. Details
    of my problems are here:
    http://ubuntuforums.org/showthread.php?t=1412834

    As suggested by many others, I have /boot partition of 200 MB ext4 outside
    the LVM partitions. But I don’t know why the GRUB2 doesn’t generate entries
    for the kernel listings.

    Any advice is welcome.

    Thanks,
    Incubus

  • Opal Morrill says:

    2 questions :
    I’ve got a server running with GoDaddy and want to make another server at home for backups and use it as a development server.
    The server at godaddy is linux and runs redhat fedora.

    2. I saw redhat has licensing fees but ubuntu doesn’t. But if i want to run a development server it has to be redhat so it matches my server correct? Can i run redhat fedora without the licensing? :D

    2nd question. I bought my server with raid harddrives so when I’m setting up the server it asks if i want to partition the drive in a guided manner, in whole, with LVM, and with LVM with encryption. My goal is to mirror what happens on harddrive 1 to harddrive 2. which option should I choose?

    Thank you!
    Just realized i numbered #1 as 2 haha. -__-. Thanks! I’ll ask there too!

  • Lizzie Galatioto says:

    I want to buy/build a 1Terabyte NAS with some kind of raid arrangement for storing audio & video. I have looked at some of the netgear products such as the storage central SC101T or ReadyNAS but they are expensive. I have seen 1T drives from CompUSA for $89 which I could use to build this.
    And of course I want to have some RAID arrangement so I will not loose my audio/video files.

    Any suggestions on what to buy and what RAID arrangement would you suggest?

    Thanks

  • Opal Morrill says:

    2 questions :
    I’ve got a server running with GoDaddy and want to make another server at home for backups and use it as a development server.
    The server at godaddy is linux and runs redhat fedora.

    2. I saw redhat has licensing fees but ubuntu doesn’t. But if i want to run a development server it has to be redhat so it matches my server correct? Can i run redhat fedora without the licensing? :D

    2nd question. I bought my server with raid harddrives so when I’m setting up the server it asks if i want to partition the drive in a guided manner, in whole, with LVM, and with LVM with encryption. My goal is to mirror what happens on harddrive 1 to harddrive 2. which option should I choose?

    Thank you!
    Just realized i numbered #1 as 2 haha. -__-. Thanks! I’ll ask there too!

  • Deborah Holliday says:

    Actually I can’t install another Linux OS for dual booting as we normally do for Win XP / Win server 2003 dual booting case. I have 500 GB HDD but while allocating another /boot, /home partition ‘not enough disk space is showing’. I haven’t done LVM partition. Plz help me how to load another Linux for dula booting.

  • Monique Spalding says:

    On my Ubuntu system, I recently updated my headers, kernel, all that jazz, and when I went to reboot, it brought me to a GRUB prompt instead. After searching a bit for how to work GRUB, I managed to figure out what commands to use, but I still can’t get it to boot.

    >ls
    (loop0) (hd0) (hd0,2) (hd0,1)
    >root (loop0)
    (loop0): Filesystem is ext2.
    >linux /boot/vmlinuz-2.6.31-15-generic root=
    [Linux-bzImage, setup=0x3400, size=0x3b2e00]
    >initrd /boot/initrd-2.6.31-15-generic
    >boot

    (loop0) has all my Linux stuff on it, (hd0) is of an unknown type, (hd0,2) is my Windows partition, and (hd0,1) appears to be a Windows boot partition, so (loop0) is the only one that I’m getting anywhere with.

    When I try any other version of vmlinuz, it says “invalid magic number”, so the 15 is the only one that has gotten me anywhere at all so far.

    The is the variable that I have isolated as probably being the problem. I’ve tried /dev/sda, /dev/sda1, /dev/sda2, /dev/loop0, /dev/loop1, root, /, and all possible permutations thereof.

    All of them take me to another screen with something like the following:
    Begin: Waiting for root file system… …
    Done.
    Gave up waiting for root device.
    Alert! does not exist. Dropping to a shell!
    (initramfs) _

    So basically, I need to know 1.) How to get my system back to where it was before I updated it so I can boot normally, or 2.) What do put for the “root=” to get it to work, or 3.) What to do when I get to the (initramfs) prompt to boot my system, if that’s even possible.

Leave a Reply

Login with your Social ID

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to Newsletter

Sign Up Today

Get a free copy of Develop Your Own Database Software.
database software, pdf

For A Limited Time