Linux (Ubuntu Server 20.04.2 LTS): Partitionen zusammenführen

canju

Erfahrenes Mitglied
Hallo ihr Lieben,

ich habe ein Problem und hoffe ihr könnt mir helfen. Ich habe einen Strato Rootserver laufen, der dummerweise "komisch" vorpartitioniert wurde (Das neue Server Cloud Panel...). Auf der Kiste läuft Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64). Jetzt ist die /var Partition vollgelaufen und meine Services laufen nicht mehr.

Die Ausgabe von lsblk:
Bash:
NAME          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0           7:0    0  99.4M  1 loop /snap/core/11316
loop1           7:1    0  61.7M  1 loop /snap/core20/1026
loop2           7:2    0  68.2M  1 loop /snap/lxd/21039
loop3           7:3    0  89.1M  1 loop /snap/core/8268
loop4           7:4    0  68.2M  1 loop /snap/lxd/21023
loop5           7:5    0  61.8M  1 loop /snap/core20/1081
sda             8:0    0   931G  0 disk
├─sda1          8:1    0     2M  0 part
├─sda2          8:2    0    28G  0 part /
├─sda3          8:3    0   9.3G  0 part [SWAP]
└─sda4          8:4    0 893.8G  0 part
  ├─vg00-usr  253:0    0    10G  0 lvm  /usr
  ├─vg00-var  253:1    0    10G  0 lvm  /var
  └─vg00-home 253:2    0    10G  0 lvm  /home

Im alten Strato Server-Installationsprozess konnte ich auswählen welche Partitionierung ich verwenden möchte, das ist in dem neuen Server Panel nicht mehr möglich.
Ich habe sonst immer die Standard-Partitionierung verwendet /.
Gibt es eine Möglichkeit diesen Part hier:
Bash:
└─sda4          8:4    0 893.8G  0 part
  ├─vg00-usr  253:0    0    10G  0 lvm  /usr
  ├─vg00-var  253:1    0    10G  0 lvm  /var
  └─vg00-home 253:2    0    10G  0 lvm  /home

zusammenzuführen, sodass sich die Verzeichnisse /usr, /var und /home die volle Größe von sda4 (893.8G) teilen anstatt jeweils auf 10GB begrenzt zu sein, ohne dass ich den Server neuinstallieren muss und die Verzeichnisse trotzdem erhalten bleiben?

Hier noch ein paar Zusatzinfos:
Die Ausgabe von df:
Bash:
Filesystem            1K-blocks     Used Available Use% Mounted on
udev                   32790920        0  32790920   0% /dev
tmpfs                   6567224   189848   6377376   3% /run
/dev/sda2              28702716  9278088  19424628  33% /
/dev/mapper/vg00-usr   10255636  3835320   5879644  40% /usr
tmpfs                  32836116        4  32836112   1% /dev/shm
tmpfs                      5120        0      5120   0% /run/lock
tmpfs                  32836116        0  32836116   0% /sys/fs/cgroup
/dev/mapper/vg00-home  10255636    36888   9678076   1% /home
/dev/mapper/vg00-var   10255636 10239252         0 100% /var
/dev/loop0               101760   101760         0 100% /snap/core/11316
/dev/loop1                63232    63232         0 100% /snap/core20/1026
/dev/loop2                69888    69888         0 100% /snap/lxd/21039
/dev/loop3                91264    91264         0 100% /snap/core/8268
/dev/loop4                69888    69888         0 100% /snap/lxd/21023
/dev/loop5                63360    63360         0 100% /snap/core20/1081
tmpfs                   6567220        0   6567220   0% /run/user/0
tmpfs                   6567220        0   6567220   0% /run/user/1000

Die Ausgabe von fdisk -l:
Bash:
Disk /dev/loop0: 99.38 MiB, 104202240 bytes, 203520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 61.75 MiB, 64729088 bytes, 126424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 68.17 MiB, 71475200 bytes, 139600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 89.9 MiB, 93417472 bytes, 182456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 68.17 MiB, 71475200 bytes, 139600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 61.79 MiB, 64770048 bytes, 126504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 931 GiB, 999653638144 bytes, 1952448512 sectors
Disk model: MR9440-8i     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: gpt
Disk identifier: E86C3264-9A03-43DE-862A-00F27310B0F8

Device        Start        End    Sectors   Size Type
/dev/sda1      2048       6143       4096     2M BIOS boot
/dev/sda2      6144   58593279   58587136    28G Linux filesystem
/dev/sda3  58593280   78125055   19531776   9.3G Linux swap
/dev/sda4  78125056 1952446463 1874321408 893.8G Linux LVM


Disk /dev/mapper/vg00-usr: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/vg00-var: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/vg00-home: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes

Ich habe davon leider nicht wirklich Ahnung und frage vorher lieber bevor ich irgednwas schrotte.

Grüße,
canju
 
Lass den Schmarrn mit LVM, und benutze echte Partitionen...

Ansonsten: Schau mal hier: LVM vergrößern – Thomas-Krenn-Wiki

EDIT: Ne weitere Möglichkeit wäre ein Bind-Mount
What is a bind mount?
Auf sda2 erzeugst du ganz normal die 3 Ordner /var, /usr und /home.
Auch erzeugst du einen Ordner, Bsp. "/extern" und nimmst den als Mountpoint für sda4 (ganze Platte/Partition).
Dann unterhalb von "extern" erzeugst du wieder die 3 Ordner /extern/usr, /extern/var und /extern/home
dann kannst du wie in dem SO-Link einen Bind-Mount einrichten (am besten per fstab und die rbind-option nicht vergessen).
Das Ergebnis wäre im Prinzip so eine Art Re-Direct von /usr nach /extern/usr usw.
Du kannst dann ganz normal /home/canju/Videos benutzen als lesen/schreiben etc., die physischen Dateien wären aber auf sda4
 
Zuletzt bearbeitet:
Zurück