Quantcast
Channel: Raspberry Pi – IT Solutions Technology Blog
Viewing all articles
Browse latest Browse all 1162

Logical Volume Manager (LVM2) – die Grundkonfiguration

$
0
0

Die grundlegende Konfiguration mit LVM2 – es wird dabei das Anlegen der Partitionen, der Physical Volumes (PVs), einer Volume Group (VG) und den darauf aufsetzenden Logical Volumes (LVs) an einem Beispiel erklärt

root@rpi-iot-jsho-lvm-01:~# apt-get install lvm2
root@rpi-iot-jsho-lvm-01:~# lvm version
root@rpi-iot-jsho-lvm-01:~# fdisk -lu
root@rpi-iot-jsho-lvm-01:~# pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 82. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 0. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 510. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
Physical volume „/dev/sda1“ successfully created
root@rpi-iot-jsho-lvm-01:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sda1 lvm2 — 3,72g 3,72g
root@rpi-iot-jsho-lvm-01:~# vgcreate vg01 /dev/sda1
Volume group „vg01“ successfully created
root@rpi-iot-jsho-lvm-01:~# pvdisplay
— Physical volume —
PV Name /dev/sda1
VG Name vg01
PV Size 3,72 GiB / not usable 4,00 MiB
Allocatable yes
PE Size 4,00 MiB
Total PE 952
Free PE 952
Allocated PE 0
PV UUID y16o2J-Pj1Y-VewP-QxaW-9vix-q3ta-uSmupg
root@rpi-iot-jsho-lvm-01:~# vgdisplay
— Volume group —
VG Name vg01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size <3,72 GiB
PE Size 4,00 MiB
Total PE 952
Alloc PE / Size 0 / 0
Free PE / Size 952 / <3,72 GiB
VG UUID S9QZe1-R2tz-Ho1l-8boe-imeO-npkY-fNga6I
root@rpi-iot-jsho-lvm-01:~# lvcreate -n data01 -l50%VG vg01
Logical volume „data01“ created
root@rpi-iot-jsho-lvm-01:~# lvcreate -n data02 -l100%FREE vg01
Logical volume „data02“ created
root@rpi-iot-jsho-lvm-01:~# mkfs.ext4 /dev/vg01/data01
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 487424 4k blocks and 121920 inodes
Filesystem UUID: 1b6f6bb9-b4f7-4188-8d6b-e4288cca55a0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
root@rpi-iot-jsho-lvm-01:~# mkdir /data01
root@rpi-iot-jsho-lvm-01:~# mount /dev/vg01/data01 /data01

Viewing all articles
Browse latest Browse all 1162

Trending Articles