Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
shell [22/09/2022 - 10:44] – thommie4 | shell [05/03/2024 - 10:52] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== Shell und Dateisysteme | + | ====== Shell allgemein |
- | http:// | + | [[http:// |
[[https:// | [[https:// | ||
[[http:// | [[http:// | ||
+ | |||
+ | ===== GB keyboard ===== | ||
+ | |||
+ | {{ : | ||
===== Screen ===== | ===== Screen ===== | ||
Zeile 46: | Zeile 50: | ||
Einfügen eines Passwort hashes | Einfügen eines Passwort hashes | ||
- | |||
< | < | ||
- | thommie@odysseus3: | ||
- | > print crypt.crypt(' | ||
- | $6$SALTsalt$0[hashwert] | ||
- | </ | ||
- | ===== Platte voll - grösste Dateien/ | + | thommie@odysseus3: |
- | { find ocdata/ -type f -name " | + | $6$SALTsalt$0[hashwert] |
- | |||
- | < | ||
- | du -hsx -- * | sort -rh | head -10 | ||
</ | </ | ||
- | Danach die Dateien in eine Datei kopieren und gezielt löschen | + | ===== update-alternatives ===== |
- | < | + | [[https:// |
- | xargs rm -r < delete.txt | + | |
- | </code> | + | |
+ | ===== Diverses ===== | ||
- | ==== Out of inodes ==== | + | Random string erzeugen |
- | + | ||
- | Eine Platte kann auch wegen wegen ausgegangener inodes voll sein "no space left on device" | + | |
- | Dann zuerst inode Status prüfen mit df -i. Danach auflisten, welches Verzeichnis die meisten Inodes belegt: | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Siehe [[https:// | + | |
- | + | ||
- | Wenn es zu viele Einzel-Dateien sind, kommt bei rm -rf eventuell dieser Fehler | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | In diesem Fall diee Dateien einzeln finden und übergeben: | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Danach müsste alles wieder OK sein: | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | ===== Access Control Lists ACL ===== | + | |
- | + | ||
- | siehe [[https:// | + | |
- | + | ||
- | setzen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Settings lesen | + | |
- | + | ||
- | '' | + | |
- | '' | + | |
- | ===== BTRFS ===== | + | |
- | + | ||
- | Standard-Datei-System bei OpenSUSE und SLES | + | |
- | + | ||
- | ==== Platte läuft mit Snapshots voll ==== | + | |
- | + | ||
- | Die Grundeinstellungen stehen in / | + | |
- | + | ||
- | Im akuten Fall: | + | |
- | + | ||
- | ''/ | + | |
- | + | ||
- | und | + | |
- | + | ||
- | ''/ | + | |
- | + | ||
- | ==== btrfs Maintenance ==== | + | |
- | + | ||
- | There is btrfsmaintenance package that should be installed by default that provides cron script. Somewhat interesting implementation is, these cron scripts are not installed directly but there is a service that does it. And *this* service is disabled by default | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | and check / | + | |
- | + | ||
- | It is configurable in / | + | |
- | + | ||
- | I enabled it now (with the default config), which created cron.weekly/ | + | |
- | + | ||
- | Alte Snapshots auf einen Satz löschen: | + | |
< | < | ||
- | for i in `seq 2309 2605`; do snapper delete $i; done | ||
- | </ | ||
- | ==== Weitere BTRFS Kommandos ==== | + | tr -dc A-Za-z0-9 </dev/urandom |
- | + | ||
- | Füllgrad feststellen: | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Snapshots auflisten | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Snapshot Diffs anzeigen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Bestimmten Snapshot löschen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Älteren Snapshot aktivieren | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | ==== BTRFS Dateisystem reparieren ==== | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | ==== Hohe Last durch BTRFS quota ==== | + | |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | ===== Software RAID Reparatur ===== | + | |
- | + | ||
- | Ablauf bei Plattentausch | + | |
- | + | ||
- | RAID Array anzeigen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | und | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Platte aus Array entfernen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Ganzes Array stoppen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | ===== XFS ===== | + | |
- | + | ||
- | XFS Fehler können unter OpenSuse zum emergency mode führen. Fix: | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Wenn das xfs Log überschrieben werden kann | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Doku: [[http:// | + | |
- | + | ||
- | ===== LUKS ===== | + | |
- | + | ||
- | Basisinfo: [[https:// | + | |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | **Vor LEAP: Image *.img reparieren** | + | |
- | + | ||
- | Die *.key Datei ist auch verschlüsselt, | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | Danach fsck auf / | + | |
- | + | ||
- | Mit luksclose wird das Image geschlossen | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | **Ab Leap werden normale LUKS Partitionen benutzt.** | + | |
- | + | ||
- | ==== LUKS Partitionen ab OpenSUSE Leap ==== | + | |
- | + | ||
- | Die Partition wird über ein Loop Setup ins Dateisystem gemountet: | + | |
- | < | + | |
- | + | ||
- | dev/ | + | |
- | / | + | |
- | tmpfs 3.2G | + | |
</ | </ | ||
- | Die Zuordnung des gemappten Partition zur Partition auf der Platte steht in in / | + | ===== Links ===== |
- | < | + | '' |
- | cr-auto-1 | + | |
- | </ | + | ===== Code snippets |
- | Die Befehle für cryptsetup funktionieren nur an der Originalpartition: | + | ==== sed ==== |
+ | replace " | ||
< | < | ||
- | odysseus3:~ # cryptsetup luksDump / | ||
- | LUKS header information for / | ||
- | |||
- | Version: | ||
- | Cipher name: aes | ||
- | Cipher mode: xts-plain64 | ||
- | Hash spec: sha256 | ||
- | Payload offset: 4096 | ||
- | MK bits: 256 | ||
- | MK digest: | ||
- | MK salt: e2 b4 a9 e0 c3 89 84 e6 cc 6f cb d0 fc da 3a 92 | ||
- | ce 52 95 ce c4 ca fa 65 7b bf 06 a8 ea 8a 03 3e | ||
- | MK iterations: | ||
- | UUID: | ||
- | |||
- | Key Slot 0: ENABLED | ||
- | Iterations: | ||
- | Salt: f1 de c8 30 e1 80 5e eb 66 93 0d 03 b6 9a ee 90 | ||
- | 75 5b a5 29 1c 50 17 79 18 b9 4d 5f c2 82 61 38 | ||
- | Key material offset: | ||
- | AF stripes: | ||
- | Key Slot 1: ENABLED | ||
- | Iterations: | ||
- | Salt: 89 fc dd 4c 1c f9 6f ff b2 4e 2e 40 03 a7 a4 5f | ||
- | de 7a 7a 08 3e 72 16 58 b2 5f 24 c8 b6 87 86 c0 | ||
- | Key material offset: | ||
- | AF stripes: | ||
- | Key Slot 2: DISABLED | ||
- | Key Slot 3: DISABLED | ||
- | Key Slot 4: DISABLED | ||
- | Key Slot 5: DISABLED | ||
- | Key Slot 6: DISABLED | ||
- | Key Slot 7: DISABLED | ||
+ | < | ||
</ | </ | ||
- | Passphrase hinzufügen: | + | trim string and remove newlines |
< | < | ||
- | cryptsetup luksAddKey | + | < |
</ | </ | ||
- | Passphrase in Slot gezielt ändern: | ||
- | |||
- | < | ||
- | cryptsetup luksChangeKey / | ||
- | |||
- | </ | ||
- | |||
- | Passphrase entfernen | ||
- | |||
- | < | ||
- | cryptsetup luksKillSlot / | ||
- | |||
- | </ | ||