Archive for Januar 2nd, 2021

Logical Volume Manager (LVM2) – die Grundkonfiguration

Samstag, Januar 2nd, 2021

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
LVM version: 2.03.02(2) (2018-12-18)
Library version: 1.02.155 (2018-12-18)
Driver version: 4.41.0
Configuration: ./configure –build=arm-linux-gnueabihf –prefix=/usr –includedir=${prefix}/include –mandir=${prefix}/share/man –infodir=${prefix}/share/info –sysconfdir=/etc –localstatedir=/var –disable-silent-rules –libdir=${prefix}/lib/arm-linux-gnueabihf –libexecdir=${prefix}/lib/arm-linux-gnueabihf –runstatedir=/run –disable-maintainer-mode –disable-dependency-tracking –exec-prefix= –bindir=/bin –libdir=/lib/arm-linux-gnueabihf –sbindir=/sbin –with-usrlibdir=/usr/lib/arm-linux-gnueabihf –with-optimisation=-O2 –with-cache=internal –with-device-uid=0 –with-device-gid=6 –with-device-mode=0660 –with-default-pid-dir=/run –with-default-run-dir=/run/lvm –with-default-locking-dir=/run/lock/lvm –with-thin=internal –with-thin-check=/usr/sbin/thin_check –with-thin-dump=/usr/sbin/thin_dump –with-thin-repair=/usr/sbin/thin_repair –enable-applib –enable-blkid_wiping –enable-cmdlib –enable-dmeventd –enable-dbus-service –enable-lvmlockd-dlm –enable-lvmlockd-sanlock –enable-lvmpolld –enable-notify-dbus –enable-pkgconfig –enable-readline –enable-udev_rules –enable-udev_sync
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
root@rpi-iot-jsho-lvm-01:~# lvremove data02 vg01
Volume group „data02“ not found
Cannot process volume group data02
Logical volume vg01/data01 contains a filesystem in use.
Do you really want to remove active logical volume vg01/data02? [y/n]: y
Logical volume „data02“ successfully removed
root@rpi-iot-jsho-lvm-01:~# lvcreate -s /dev/vg01/data01 -n data01snap -l100%FREE
Logical volume „data01snap“ created
root@rpi-iot-jsho-lvm-01:~# lvdisplay
— Logical volume —
LV Path /dev/vg01/data01
LV Name data01
VG Name vg01
LV UUID iR1U13-PaLF-XT74-JxNb-51Dr-HqQe-lzSLLn
LV Write Access read/write
LV Creation host, time rpi-iot-jsho-lvm-01, 2021-01-02 20:38:17 +0100
LV snapshot status source of
data01snap [active]
LV Status available
# open 1
LV Size <1,86 GiB
Current LE 476
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 254:0
— Logical volume —
LV Path /dev/vg01/data01snap
LV Name data01snap
VG Name vg01
LV UUID se4wAl-jbJM-XWqf-e0wA-HPQC-L4zI-Y48I72
LV Write Access read/write
LV Creation host, time rpi-iot-jsho-lvm-01, 2021-01-03 15:27:34 +0100
LV snapshot status active destination for data01
LV Status available
# open 0
LV Size <1,86 GiB
Current LE 476
COW-table size <1,86 GiB
COW-table LE 476
Allocated to snapshot 0,01%
Snapshot chunk size 4,00 KiB
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 254:3

Werden nun im laufenden Betrieb Daten im Filesystem verändert so wird dessen ursprünglicher Inhalt zuerst in den Snapshot kopiert. Dieser Block wird auch als „kopiert“ in der Exception Table markiert. Seit dem lvm2-Format werden standardmäßig read/write Snapshots erstellt. Greift man nun auf einen Snapshot zu werden die geänderten Blöcke als „used“ in der Exception Table markiert und von nun an niemals kopiert

root@rpi-iot-jsho-lvm-01:/data01# mount /dev/vg01/data01snap /mnt/data01snap


root@rpi-iot-jsho-lvm-01:/data01# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 3,7G 0 disk
└─sda1 8:1 1 3,7G 0 part
├─vg01-data01-real 254:1 0 1,9G 0 lvm
│ ├─vg01-data01 254:0 0 1,9G 0 lvm /data01
│ └─vg01-data01snap 254:3 0 1,9G 0 lvm /mnt/data01snap
└─vg01-data01snap-cow 254:2 0 1,9G 0 lvm
└─vg01-data01snap 254:3 0 1,9G 0 lvm /mnt/data01snap
sdb 8:16 1 1,4M 0 disk /media/pi/6C96-E1A0
mmcblk0 179:0 0 59,5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 59,2G 0 part /

root@rpi-iot-jsho-lvm-01:/data01# umount /mnt/data01snap
root@rpi-iot-jsho-lvm-01:/data01# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 3,7G 0 disk
└─sda1 8:1 1 3,7G 0 part
├─vg01-data01-real 254:1 0 1,9G 0 lvm
│ ├─vg01-data01 254:0 0 1,9G 0 lvm /data01
│ └─vg01-data01snap 254:3 0 1,9G 0 lvm
└─vg01-data01snap-cow 254:2 0 1,9G 0 lvm
└─vg01-data01snap 254:3 0 1,9G 0 lvm
sdb 8:16 1 1,4M 0 disk /media/pi/6C96-E1A0
mmcblk0 179:0 0 59,5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 59,2G 0 part /
root@rpi-iot-jsho-lvm-01:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data01 vg01 owi-aos— <1,86g
data01snap vg01 swi-a-s— <1,86g data01 0,02

The EU-UK Trade and Cooperation Agreement – Protecting the European Union’s interests ensuring fair competition and continued cooperation in areas of mutual interest

Samstag, Januar 2nd, 2021

The EU-UK Trade and Cooperation Agreement – Protecting the European Union’s interests ensuring fair competition and continued cooperation in areas of mutual interest

Samstag, Januar 2nd, 2021

Robert Koch-Institut (RKI) – Tabelle mit den gemeldeten Impfungen bundesweit und nach Bundesland

Samstag, Januar 2nd, 2021

Robert Koch-Institut (RKI) – Tabelle mit den gemeldeten Impfungen bundesweit und nach Bundesland

Datenstand 02.01.2021 08:00 Uhr

Raspberry Pi – an introduction to digital signage with Screenly Open Source Edition (OSE) Sprint 10.1 Release

Samstag, Januar 2nd, 2021

  Screenly Open Source Edition (OSE) Sprint 10.1 Release – this is not a new release but rather a rebuild it does however include a few minor fixes perhaps more importantly  it adds support for Raspberry Pi 4 Model B

Raspberry Pi – verwandelt in einen Wifi HotSpot mit OpenWrt

Samstag, Januar 2nd, 2021

Anstrengender Alltag als selbstständiger Bezirksschornsteinfegermeister – was bekommt man dafür € 3.640,- netto

Samstag, Januar 2nd, 2021