1

I'm trying to create a volume group for my docker lvm but get errors.

prem@prem-ubuntu:~/ba/docker-lvm-plugin$ sudo vgcreate volume_group_one /dev/hda
  Device /dev/hda not found (or ignored by filtering).

How do you create a device that is not available? Am I allowed to create a device?

2

1 Answer 1

3

The steps are:

   -- create partitions on disk drives (type 8e in fdsik)
   -- create physical volumes from the partitions                  --> $ sudo pvcreate /dev/sda1
   -- create the volumes group                                     --> $ sudo vgcreate -s 16m vg /dev/sda1
   -- allocate logical volumes from the volume group               --> $ sudo lvcreate -l 50g -n mylvm vg
   -- format the logical volumes                                   --> $ sudo mkfs -t ext4 /dev/vg/mylvm
   -- mount the logical volumes (also update /etc/fstab as needed) --> $ mkdir /mylvm, 
                                                              then --> $ sudo mount /dev/vg/mylvm /mylvm, 
                                                          then add --> /dev/vg/mylvm /mylvm ext4 defaults 0 0 ( to the /etc/fstab)

General Structure:

  |-----------------------------------------------------------------------------------------------------------|
  |                                                         LVM                                               |
  |                       ------------------------------------------------------------------------------|     |
  |         FILE SYSTEMS  |          /HOME(EXT3)              ||                /DATA(XFS)              |     |
  |                       |-----------------------------------------------------------------------------|     |
  |  LOGICAL VOLUMES(LV)  | /DEV/PRIMARY_VG/HOME_|V           ||      /DEV/PRIMARY_VG/DATA_|V           |     |
  |                       |-----------------------------------------------------------------------------|     |
  |   VOLUME GROUPS(VG)   |                           PRIMARY_VG                                        |     |
  |                       |-----------------------------------------------------------------------------|     |
  |   PHYSICAL VOLUMES    | /DEV/Sdb1   ||   /DEV/Sdb2        ||     /DEV/Sdc1     ||   /DEV/Sdc2       |     |
  |                       |-----------------------------------------------------------------------------|     |
  |-----------------------------------------------------------------------------------------------------------|

     PARTITIONS           |---------------||-------------|              |----------------||-------------------|
                          | /DEV/Sdb1     || /DEV/Sdb2   |              |  /DEV/Sdc1     ||   /DEV/Sdc2       |
                          |---------------||-------------|              |----------------||-------------------|
                          |------------------------------|              |-------------------------------------|
    PHYSICAL DRIVES       |             /Dev/Sdb         |              |                /Dev/Sdc             |
                          |------------------------------|              |-------------------------------------|
1
  • Your welcome, please accept the answer if it helped you. :) Jul 11, 2017 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.