Results 1 to 5 of 5

Thread: 12.04 install w/LVM - how do I resize 'available' space

  1. #1
    Join Date
    Jul 2013
    Beans
    2

    12.04 install w/LVM - how do I resize 'available' space

    Hi, I'm new here, and unashamed to say I'm a Linux/Ubuntu noob!

    Ok, so first post and here we go...The boss picked up an HP Proliant DL380 G5, and I've managed to install Ubuntu Server 12.04LTS (AMD64)! Wooo

    The hardware has two SAS drives (each 36GB, I assume setup as a RAID?!); during the install I selected "Partioning Method: Guided - use entire disk and set up LVM".

    So after I had Webmin & PHPMyAdmin installed & running, I added a database and uploaded one of our sites (a whole 37Mb). Upon trying to load the next site, I've been greeted with "disk out of space", thinking how can this be...?

    Google for solutions, and these are the results:

    Code:
    kikgroup@dev-server:~$ df -h
    Filesystem                    Size  Used Avail Use% Mounted on
    /dev/mapper/dev--server-root  1.6G  1.5G   41M  98% /
    udev                           16G  4.0K   16G   1% /dev
    tmpfs                         6.3G  284K  6.3G   1% /run
    none                          5.0M     0  5.0M   0% /run/lock
    none                           16G     0   16G   0% /run/shm
    /dev/cciss/c0d0p1             228M   48M  169M  22% /boot
    
    kikgroup@dev-server:~$ sudo fdisk -l
    [sudo] password for kikgroup: 
     
    Disk /dev/cciss/c0d0: 36.4 GB, 36385505280 bytes
    255 heads, 32 sectors/track, 8709 cylinders, total 71065440 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002076a
     
               Device Boot      Start         End      Blocks   Id  System
    /dev/cciss/c0d0p1   *        2048      499711      248832   83  Linux
    /dev/cciss/c0d0p2          501758    71063551    35280897    5  Extended
    /dev/cciss/c0d0p5          501760    71063551    35280896   8e  Linux LVM
     
    Disk /dev/mapper/dev--server-root: 1740 MB, 1740636160 bytes
    255 heads, 63 sectors/track, 211 cylinders, total 3399680 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
     
    Disk /dev/mapper/dev--server-root doesn't contain a valid partition table
     
    Disk /dev/mapper/dev--server-swap_1: 34.4 GB, 34355544064 bytes
    255 heads, 63 sectors/track, 4176 cylinders, total 67100672 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
     
    Disk /dev/mapper/dev--server-swap_1 doesn't contain a valid partition table
    Now (please go easy on me), I can see that somehow I'm only operating within this area "/dev/mapper/dev--server-root 1.6G 1.5G 41M 98% /" and I have no idea why or what to do next, apart from I'd like some more room to do awesome stuff in,

    Any assistance please as to how I can expand the amount of available space? Any descriptions as to why and how this situation arose in the beginning would also be greatly appreciated!!

    Many thanks in advance.
    eLBee

  2. #2
    Join Date
    Mar 2013
    Beans
    13

    Re: 12.04 install w/LVM - how do I resize 'available' space

    Quote Originally Posted by gokartracer101 View Post
    I assume setup as a RAID?!
    Yes, these servers have hardware RAID controllers. If you watch the screen at boot, there is an option to enter a menu to configure the RAID settings.

  3. #3
    Join Date
    Apr 2012
    Beans
    7,256

    Re: 12.04 install w/LVM - how do I resize 'available' space

    The installer appears to have allocated almost all of your physical volume to swap... not sure if that's what you expected

    If you can live without that much swap, there probably is a way to reconfigure it using lvreduce on the swap LV and then lvextend on the root LV (temporarily turning your swap off for the duration then remaking it) - but I'm not qualified to guide you through that

  4. #4
    Join Date
    Jul 2013
    Beans
    2

    Re: 12.04 install w/LVM - how do I resize 'available' space

    Thanks for the advice, I managed to resize the root & swap drives with the following commands:

    Code:
    sudo swapoff -a
    
    sudo lvscan
        //root 1.62Gb
        //swap 32.00Gb
    
    sudo lvreduce --size 8G /dev/dev-server/swap_1
    
    sudo lvextend --size 24G /dev/dev-server/root
    
    df -h
       //revealing root still is 1.6G?!@# some Google later;
    
    sudo resize2fs -p /dev/dev-server/root
    
    df -h
        //revealing root is now 24G!! HOORAY!

    After doing this, I then went to upload another zip file and found the upload running much slower than it usually does?! Some further reading suggests that the SWAP drive should be at least as big as the amount of system RAM...which is 32Gb, lol! Hence my dilemma in the first place...
    Time to go and buy some new SAS drives with some serious storage!

  5. #5
    Join Date
    Apr 2012
    Beans
    7,256

    Re: 12.04 install w/LVM - how do I resize 'available' space

    Well done! looks like you did all the right things

    I'd not be so hasty about buying drives (although obviously 36GB is small in today's money - I remember the excitement when our sysadmin got his first 100MB disk!) - afaik you don't need *any* swap unless you're doing something that uses all your physical RAM (which would have to be something pretty big, given that you have 32GB) and you only need as much swap as RAM if you plan on hibernating the system. So if you are getting poor performance likely there is something else amiss with your setup.

    EDIT: wait, you probably should have done a mkswap on /dev/dev-server/swap_1 volume after shrinking it, I think? And if it's mounted by UUID you may need to update your /etc/fstab as well, I think mkswap generates a new UUID by default
    Last edited by steeldriver; July 12th, 2013 at 02:49 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •