LVM Verändern: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 38: | Zeile 38: | ||
Do you really want to remove active logical volume daten/misc? [y/n]: y | Do you really want to remove active logical volume daten/misc? [y/n]: y | ||
Logical volume "misc" successfully removed | Logical volume "misc" successfully removed | ||
| − | + | =Verkleinern= | |
| − | + | ==Dateisystem verkleinern== | |
| − | + | *umount /mnt/video | |
| − | + | *e2fsck -f /dev/daten/video | |
| − | resize2fs 1. | + | e2fsck 1.46.2 (28-Feb-2021) |
| − | Resizing the filesystem on /dev/daten/ | + | Pass 1: Checking inodes, blocks, and sizes |
| − | + | Pass 2: Checking directory structure | |
| − | + | Pass 3: Checking directory connectivity | |
| − | + | Pass 4: Checking reference counts | |
| − | + | Pass 5: Checking group summary information | |
| − | + | /dev/daten/video: 11/1179648 files (0.0% non-contiguous), 101703/4718592 blocks | |
| − | + | *resize2fs /dev/daten/video 14G | |
| − | Do you really want to reduce | + | resize2fs 1.46.2 (28-Feb-2021) |
| − | + | Resizing the filesystem on /dev/daten/video to 3670016 (4k) blocks. | |
| − | + | The filesystem on /dev/daten/video is now 3670016 (4k) blocks long. | |
| − | + | ==Logisches Volume verkleinern== | |
| − | + | *lvreduce -L 14G /dev/daten/video | |
| + | WARNING: Reducing active logical volume to 14,00 GiB. | ||
| + | THIS MAY DESTROY YOUR DATA (filesystem etc.) | ||
| + | Do you really want to reduce daten/video? [y/n]: y | ||
| + | Size of logical volume daten/video changed from 18,00 GiB (4608 extents) to 14,00 GiB (3584 extents). | ||
| + | Logical volume daten/video successfully resized. | ||
| + | *lvs | ||
LV VG Attr LSize Origin Snap% Move Log Copy% Convert | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
Speicher daten -wi-ao 1,50G | Speicher daten -wi-ao 1,50G | ||
Version vom 3. März 2022, 10:34 Uhr
Erweitern einer Volume Group
- pvcreate /dev/vda21 /dev/vda22
- vgextend daten /dev/vda21 /dev/vda22
Volume group "daten" successfully extended
Anzeigen der vergößerten Volume Group
- vgs
VG #PV #LV #SN Attr VSize VFree daten 3 1 0 wz--n- 2,99G 1,52G
Vergrößern des Logical Volumes
- lvextend -L 18G /dev/daten/video
Size of logical volume daten/video changed from 10,00 GiB (2560 extents) to 18,00 GiB (4608 extents). Logical volume daten/video successfully resized.
Vergrößern des Logical Volumes online
Anzeigen des momentanen Status
- df -h /mnt/video
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf /dev/mapper/daten-video 9,8G 24K 9,3G 1% /mnt/video
Vergrössern
- resize2fs /dev/daten/video
resize2fs 1.46.2 (28-Feb-2021) Filesystem at /dev/daten/video is mounted on /mnt/video; on-line resizing required old_desc_blocks = 2, new_desc_blocks = 3 The filesystem on /dev/daten/video is now 4718592 (4k) blocks long.
Anzeigen des momentanen Status
- df -h /mnt/video
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf /dev/mapper/daten-video 18G 44M 17G 1% /mnt/video
Vergrößern des Logical Volumes auf Maximalwert
- lvextend -l +100%FREE /dev/daten/audio
- resize2fs /dev/daten/audio
Löschen eines Logical Volumes
- umount /dev/daten/misc
- lvremove /dev/daten/misc
Do you really want to remove active logical volume daten/misc? [y/n]: y Logical volume "misc" successfully removed
Verkleinern
Dateisystem verkleinern
- umount /mnt/video
- e2fsck -f /dev/daten/video
e2fsck 1.46.2 (28-Feb-2021) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/daten/video: 11/1179648 files (0.0% non-contiguous), 101703/4718592 blocks
- resize2fs /dev/daten/video 14G
resize2fs 1.46.2 (28-Feb-2021) Resizing the filesystem on /dev/daten/video to 3670016 (4k) blocks. The filesystem on /dev/daten/video is now 3670016 (4k) blocks long.
Logisches Volume verkleinern
- lvreduce -L 14G /dev/daten/video
WARNING: Reducing active logical volume to 14,00 GiB. THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce daten/video? [y/n]: y Size of logical volume daten/video changed from 18,00 GiB (4608 extents) to 14,00 GiB (3584 extents). Logical volume daten/video successfully resized.
- lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Speicher daten -wi-ao 1,50G
Physical Volume leeren oder verschieben
root@zero:~# pvmove /dev/sdd No extents available for allocation
Um ein Physical Volume mit pvmove zu leeren, muss genügend Platz auf den restlichen Physical Volumes vorhanden sein!
LV auflösen
root@zero:~# lvchange -a n /dev/vg-data/data root@zero:~# lvremove /dev/vg-data/data Logical volume "data" successfully removed
VG auflösen
root@zero:~# vgchange -a n /dev/vg-data 0 logical volume(s) in volume group "vg-data" now active root@zero:~# vgremove /dev/vg-data Volume group "vg-data" successfully removed
PV auflösen
root@zero:~# pvremove /dev/sda5 Labels on physical volume "/dev/sda5" successfully wiped
Physical Volume aus Volume Group entfernen/VG verkleinern
root@zero:~# vgreduce daten /dev/sdd Removed "/dev/sdd" from volume group "daten"