Results 1 to 2 of 2

Thread: How to convert existing system to LVM

  1. #1
    Join Date
    Sep 2008
    Location
    England
    Beans
    Hidden!
    Distro
    Ubuntu

    How to convert existing system to LVM

    I have 5 disks in my current server which are just mounted separately in fstab.

    ubuntu server install is on sda, ext4

    And then I have four xfs drives that are used as NFS and samba storage on my network;

    sdb mounted on /mnt/afs
    sdc mounted on /mnt/bfs
    sdd mounted on /mnt/cfs
    sde mounted on /mnt/dfs

    A single partition on each, I have enough space to copy all data onto 3 drives giving me a completely spare drive if necessary.

    What I would like to do is convert sdb - sde to LVM and bring them all into one logical drive. Primarily to make file sharing easier.

    So I'm thinking I need to run the following, to bring each drive under LVM control, -Zn will preserve all my existing data;

    Code:
    pvcreate --metadatacopies 0 -Zn /dev/sdb1
    pvcreate --metadatacopies 0 -Zn /dev/sdc1
    pvcreate --metadatacopies 0 -Zn /dev/sdd1
    pvcreate --metadatacopies 0 -Zn /dev/sde1

    Create a new volume group using the newly created pvs

    Code:
    vgcreate vg0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1/
    Create the logical volume;

    Code:
    lvcreate -Zn vg0 /dev/sdb1
    I would then mount sdb1 in fstab

    Do I need to change my physical extents?

    I would also prefer not to strip my data, is it necessary for me to force this option?

    To add a new drive in the future;
    Code:
    vgextend vg0 /dec/sdf
    Have I understood google correctly? This is something I don't want to use trial and error on.
    Thanks

  2. #2
    Join Date
    Mar 2010
    Location
    Metro-ATL; PM free zone.
    Beans
    9,309
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: How to convert existing system to LVM

    Don't know how, but you might want to read up on what happens if 1 drive in the LVM set fails. What happens to the data on all the other drives? Can it still be accessed? https://serverfault.com/questions/24...i-hard-disk-lv

    As another option - you migh t or might not like - perhaps just merging the existing storage into a single "view" would meet your requirements? People with lots of media use these all the time.
    * aufs
    * UnionFS
    * mhddfs
    Anyway, thought you might like these options to consider. Sorry, don't have a good answer to the real question - which is still an option.
    Last edited by TheFu; January 31st, 2014 at 01:59 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
  •