[solved] lvm hdd and ssd on different partitions

Discussion in 'Technical' started by Tomislav Aurednik, Dec 20, 2016.

  1. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    I'm using a ssd disk in my server. On it I've got my virtualbox vms. I'm using lvm so I can add new disks and extend the partitions. Now I want to save my vm for mailserver on a hdd becouse of the high disk space consumption. I know that I can run virtualbox vm with it's vdi in a different dir/disk than the default vm locations.
    My question is can I add a hdd drive, have a separate lvm vg on it and if I missed something in the steps below?

    1. install hdd
    2. create an 8e partition on it with fdisk /dev/sdb
    3. create mount point mkdir /hdd
    4. in /etc/fstab add the line: /dev/sdb1 /hdd 8e defaults 0 0
    5. create phisical volume fo lvm: pvcreate /dev/sdb1
    6. create a new volume group: vgcreate vg-hdd-mail /dev/sdb1
    7. create a logical volume group: lvcreate -L 100%FREE -n lv-hdd-mail vg-hdd-mail
    8. create file system on the logical volume: mkfs -t ext4 /dev/vg-hdd-mail/lv-hdd-mail
    9. mount it to the mount point: mount -t ext4 /dev/vg-hdd-mail/lv-hdd-mail /hdd
    Will this work? Oh... I'm running a Ubuntu 14.04.1 LTS server.
  2. Tomislav Aurednik

    Tomislav Aurednik Member HowtoForge Supporter

    Worked... but added a record in /etc/fstab to mount it on boot.

Share This Page