我正在尝试为我的 docker lvm 创建一个卷组但出现错误。
prem@prem-ubuntu:~/ba/docker-lvm-plugin$ sudo vgcreate volume_group_one /dev/hda
Device /dev/hda not found (or ignored by filtering).
如何创建不可用的设备?我可以创建设备吗?
答案1
步骤如下:
-- 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)
总体结构:
|-----------------------------------------------------------------------------------------------------------|
| 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 |
|------------------------------| |-------------------------------------|