expanding a lvm disk and moving data around

Discussion in 'Installation/Configuration' started by ac15, Dec 12, 2015.

  1. ac15

    ac15 Member

    hi,
    i'm aware that there are several guides out there that describe in detail how to solve my problem, but somehow i just don't get it. i hope you can help me.

    here is my problem: i've got a server running ispconfig, with several client sites already on them. nothing too fancy, but still data i cannot lose. disk space is starting to run low, so i'd like to expand the volume where clients store their data. i realized that i made a mistake during installation, the bigger partition is pretty much unsed, and all the ftp data are stored in the smaller partition. i'd like to correct that mistake and also expand the bigger partition.

    i made a copy of the machine so i can experiment without risking data loss. i followed the lvm tutorials i found, but with no success so far.
    the server is running in a vmware infrastructure, debian 7 x64, 30gb hdd, 2gb ram, with ispconfig 3.0.5.4p8.

    here are some outputs from the server:
    Disk /dev/sda: 34.4 GB, 34359738368 bytes
    64 heads, 32 sectors/track, 32768 cylinders, total 67108864 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: 0x00074127

    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 499711 248832 83 Linux
    /dev/sda2 501758 67106815 33302529 5 Extended
    /dev/sda5 501760 67106815 33302528 8e Linux LVM

    Disk /dev/mapper/yWeb-root: 8564 MB, 8564768768 bytes
    255 heads, 63 sectors/track, 1041 cylinders, total 16728064 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/yWeb-root doesn't contain a valid partition table

    Disk /dev/mapper/yWeb-swap_1: 1094 MB, 1094713344 bytes
    255 heads, 63 sectors/track, 133 cylinders, total 2138112 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/yWeb-swap_1 doesn't contain a valid partition table

    Disk /dev/mapper/yWeb-home: 24.4 GB, 24440209408 bytes
    255 heads, 63 sectors/track, 2971 cylinders, total 47734784 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/yWeb-home doesn't contain a valid partition table

    Filesystem Size Used Avail Use% Mounted on
    rootfs 7.9G 3.7G 3.9G 49% /
    udev 10M 0 10M 0% /dev
    tmpfs 202M 252K 202M 1% /run
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /
    tmpfs 5.0M 4.0K 5.0M 1% /run/lock
    tmpfs 403M 0 403M 0% /run/shm
    /dev/sda1 228M 18M 199M 9% /boot
    /dev/mapper/yWeb-home 23G 172M 22G 1% /home
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client1/web1/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client3/web4/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client4/web5/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client6/web6/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client6/web7/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client3/web10/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client7/web11/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client8/web12/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client9/web13/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client10/web14/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client11/web15/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client12/web16/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client13/web17/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client14/web18/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client15/web19/log
    /dev/mapper/yWeb-root 7.9G 3.7G 3.9G 49% /var/www/clients/client15/web20/log

    as you can see, the client data resides on the /dev/mapper/yWeb-root filesystem, while the bigger /dev/mapper/yWeb-home is pretty much empty. i'd like achieve two things:
    1) move /var/www/ over to /dev/mapper/yWeb-home and
    2) be able to expand /dev/mapper/yWeb-home whenever i need to.

    i'd be very happy if someone could provide me with some input on how to solve my problems..

    thanks & kind regards,
    al.

    edit. correct me if i'm wrong, but an easy way out of this would be to just add another virtual hdd and move the mount point /var/www over to the new disk. whenever space runs out, i simply add a bigger hdd, unmount /var/www, remount on the new drive and remove the old disk afterwards. no?

    edit2. ha, i finally figured it out, this and this article helped..
     
    Last edited: Dec 13, 2015

Share This Page