Storage LVM on bare metal server

The process using the maas-cli it’s quite tedious.
Try this steps (sorry I can’t post the output now):

  1. Get block-device id of yout hard drives:
    maas $login block-devices read $system_id

  2. (OPTIONAL) Create partition to allocate lvm:
    maas $login partitions create $system_id $device_id size=$size

  3. Create Volume Group (VG):
    maas $login volume-groups create $system_id name=$name partitions=$id_partition
    or
    maas $login volume-groups create $system_id name=$name block_devices=$id_block-device

  4. Create Logical Volume (LV):
    maas $login volume-group create-logical-volume $system_id $vg_id name=$name size=$size

  5. Format the LV:
    maas $login block-device format $system_id $id_lv fstype=$fs

  6. Mount the LV:
    maas $login block-device mount $system_id $id_lv mount_point=$mp mount_options=$mo

Note: You can open the webui on the machine storage and see in realtime the changes of the commands.

1 Like