Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
content:serverbasics [2023/03/05 16:21] Danielcontent:serverbasics [2023/12/17 23:00] – [Moving logical Volumes to physical Devices] Daniel
Zeile 6: Zeile 6:
  
 By default openSuSE will set some conservative mountoptions, that are save, but not best choice for homeoffice use and maybe could also improve company servers. Here are some proposals to think about. By default openSuSE will set some conservative mountoptions, that are save, but not best choice for homeoffice use and maybe could also improve company servers. Here are some proposals to think about.
 +
 +==== Raided EFIBOOT ====
 +
 +There are some problems when raiding the efi-boot. I would suggest to use:
 +
 +<code>
 +~ # mdadm --create --verbose /dev/md/efiboot --level=1 --raid-devices=2 --metadata=1.0 --name=efiboot --homehost=system /dev/sda1 /dev/sdb1
 +
 +</code>
 +
 +The important part is metadata=1.0 - this format has especially designed to fit the needs of raid1 of fat/efi- systems.
 +
  
 ==== LVM ==== ==== LVM ====
  
 LVM is a powerful partition-management-layer and should always be used, when there is some none low-end hardware present. If you can use the **KDE Partitioning- Tool** (which means having Plasma=KDE Desktop compatible support), the support is very inuitive and opens a lot of flexibility whne handling partitions, like adding more disk space or moving partitions, but also on console this offers good functionality. OpenSuSE offer to create LVM- Styled system setup in installation optionally (not by default). If you can: use it. LVM is a powerful partition-management-layer and should always be used, when there is some none low-end hardware present. If you can use the **KDE Partitioning- Tool** (which means having Plasma=KDE Desktop compatible support), the support is very inuitive and opens a lot of flexibility whne handling partitions, like adding more disk space or moving partitions, but also on console this offers good functionality. OpenSuSE offer to create LVM- Styled system setup in installation optionally (not by default). If you can: use it.
 +=== Raided LVM- Volumes ===
 +
 +Noadays, raid1 or raid5 for system without LVM is outdated. Those things are integrated in LVM - so use it!
 +
 +First, creat a volume group with two same size partitions on two discs, than create a raid1 on it (for example):
 +
 +<code>
 +vgcreate vgsystem /dev/sdX1 /dev/sdY1
 +lvcreate -m1 --type raid1 -l 100%FREE -n lvroot vgsystem
 +
 +</code>
 +
 +where 100%FREE means 100% of Free Space used…
 +
 +To check if raid1 works, use:
 +
 +<code>
 +lvs -a -o name,copy_percent,devices vg_xxx
 +
 +</code>
 +
 +If this has not worked, use:
 +
 +<code>
 +lvconvert --type raid1 -m1 vg_xxx/lvol1
 +
 +</code>
 +
 +Or - you can do raid5 with:
 +
 +<code>
 +lvcreate -n lvdata --type raid5 -l 100%FREE -i 2 vgdata
 +
 +</code>
 +
 +where i equals the number of devices with Data (not including parity- storage)
 +
 +
 +=== Useful Commands ===
 +
 +The KDE- Partitionmanager is still not perfect. LVM is mor powerful in these things:
 +
 +== Moving logical Volumes to physical Devices ==
 +
 +Usually Partitions or Devices are only assigned to Volume-Groups (VG) and Logical Volumes (LV) are using them dynamically as needed. This makes it sometimes hard to understand, where the Data really is located right now. Especially when you are having different physical Devices, you may want one LV to use one Device.
 +
 +For an overview how the Data is split, you can use:
 +
 +<code>
 +# lvs -o+devices
 +LV     VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
 +  home   system -wi-ao----  78.63g                                                     /dev/sdb2(8013)
 +  root   system -wi-ao----  97.89g                                                     /dev/sda4(0)
 +  shared system -wi-ao---- 786.64g                                                     /dev/sdb2(130893)
 +
 +</code>
 +
 +You can also move them to single Devices if needed. Here i wanted my home to also be on the faster Device sda. As sda4 had enough free space, i could do:
 +
 +<code>
 +# pvmove -n system/home /dev/sdb2 /dev/sda4
 +
 +</code>
 +== Resizing logical Volumes with mounted Filesystem ==
 +
 +can be done by e.g.
 +
 +<code>
 +lvresize --size 20G /dev/vgfast/lvfast --resizefs
 +
 +</code>
 +
 +
 ==== Filesystem ==== ==== Filesystem ====
  
Zeile 18: Zeile 103:
 BTRFs has a lot of Mountoptions and some here are really odd ones for every linux. I would suggest at least those: BTRFs has a lot of Mountoptions and some here are really odd ones for every linux. I would suggest at least those:
  
-For **Desktopusage**: compress=zstd:1,noatime,nodiratime,autodefrag+For **Desktopusage**: compress=zstd:3,noatime,nodiratime,autodefrag
  
 While autodefrag should not be necessary on ssd- harddiscs. While autodefrag should not be necessary on ssd- harddiscs.
  
 For **Databases** or files that need speed and __**are well backed up otherwise**__  : nodatacow,nodatasum,noatime,nodiratime For **Databases** or files that need speed and __**are well backed up otherwise**__  : nodatacow,nodatasum,noatime,nodiratime
 +
 +
 === Sources: === === Sources: ===
  
  • content/serverbasics.txt
  • Zuletzt geändert: 2024/04/20 13:02
  • von Daniel