ZFS – Befehle

Erstmal die Pool Befehle:

 – Anlegen eines RAID-Z pools

   zpool create NAME raidz DEVICE DEVICE DEVICE

 – Anlegen eines MIRROR pools

   zpool create NAME mirror DEVICE DEVICE

 – Anzeigen der angelegten Pools:

   zpool list

 – I/O für die Pools anzeigen

   zpool iostat 1

 – Eigenschaften der Pool Geräte anzeigen

   zpool vdevs

 – Platte/Device zum Pool hinzufügen

   zpool add NAME DEVICE

 – Pool löschen

   zpool destroy NAME

  • Und die ZFS Befehle:

 – Anlegen eines ZFS Dateisystem mit gleichzeitigem Einhängen

   zfs create POOL/NAME

 – Anzeigen der aktuellen ZFS Dateisysteme

   zfs list

 – Anlegen eines ZFS Dateisystem und einhängen unter einem nicht-default Pfad

   zfs create POOL/NAME /MOUNTPOINT

 – Snapshot eines Dateisystems

   zfs snapshot pool/filesystem@snapshotname

 – ZFS Dateisystem mounten (geht nicht mehr mit dem „normalen“ mount)

 zfs mount pool/filesystem /mountpoint

 – Dateisystem entfernen

   zfs destroy POOL/NAME

Error in OMV4.x bei update

Wenn apt-get update/upgrade einen error auswirft der die weakref.py betrifft

Dann folgendes ausführen!

wget -O /usr/lib/python3.5/weakref.py https://raw.githubusercontent.com/python/cpython/9cd7e17640a49635d1c1f8c2989578a8fc2c1de6/Lib/weakref.py

Oder wenn man es lieber von Hand macht:

nano /usr/lib/python3.5/weakref.py 

Edit Zeile 109:
def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):

Edit Zeile 117:
_atomic_removal(d, wr.key)

OMV: ACL mit ZFS-Pool nutzen

Um in ZFS Pools die ACL zu setzten muss für jeden Pool folgendes aktiv gesetzt werden. XXXX steht für den Poolnamen

Im Terminal deiner Wahl:

zfs set aclinherit=passthrough XXXX
zfs set acltype=posixacl XXXX
zfs set xattr=sa XXXX
zfs set compression=lz4 XXXX

^^^^^^^
Muss gemacht werden sonst geht ACL nicht auf ZFS!!!! FRAG NICHT MACH ES !!!!!

FÜR J E D E N P O O L

Kann auch in der ZFS GUI gemacht werden. Nach setzen eines Werts speichern, sonst wird man doof weil die GUI nur den letzten Wert speichert.

OMV auf Debian installieren

OMV per Hand auf Debian installieren

nano /etc/ssh/sshd_config

 #PermitRootLogin prohibit-password --> PermitRootLogin yes

reboot

echo „deb http://packages.openmediavault.org/public arrakis main“ > /etc/apt/sources.list.d/openmediavault.list
apt-get update
apt-get install openmediavault-keyring postfix
apt-get update
apt-get install openmediavault
omv-initsystem
reboot

Fritzbox + USG Gastzugang

!! Wenn man den Gastzugang auf der Fritzbox nutzen will !!

  • Fritzbox Gastzugang auf Lan-Port 4 aktiviert, mit Kabel auf Switch verbunden
  • auf dem Netgear Switch
    • VLAN –> 802.1Q –> Erweitert (Aktiviert)
    • VLAN-Konfiguration: VLAN-ID: 100
    • VLAN-Mitgliedschaft: VLAN-ID 1 alle ungetaggt
      VLAN-ID 100
      – Accesspoints getaggt
      – Port an dem der LAN-Port 4 der Fritz!Box hängt, muss ungetaggt sein
    • Port-PVID: Port an dem der LAN-Port 4 der Frtz!Box hängt, muss PVID 100 bekommen
  • auf dem Unifi-Controller mit beim Gastnetzwerk das VLAN 100 aktiv/eingetragen sein

VPN Windows 10 zu USG

  • VPN Verbindung erstellen
  • dann auf VPN-Adaptereigenschaften
    • Go to Control Panel > Network & Sharing settings > Change Adapter Settings.
    • Right-click the L2TP adapter, then go to Properties > Security.
    • Under Type of VPN, select Layer 2 Tunneling Protocol with IPsec.
    • Click Advanced Settings. Select preshared key for authentication and enter it.
    • Make sure to have the option of Allow these protocols enabled and mark the
      checkbox for Check Microsoft CHAP Version 2 (MS-CHAP v2).

cmd.exe – als „admin“ und ausführen:

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\PolicyAgent /v AssumeUDPEncapsulationContextOnSendRule /t REG_DWORD /d 0x2 /f

Unifi-Video Controller password reset

Login to the database form the console (Linux)

Run the mongo db console: „mongo 127.0.0.1:7441/av“

Find the admin username that was set in the database: „db.account.find().forEach(printjson)“

Set the password to „ubnt“ (bcrypt hash) in the database: „db.account.update( { username: „admin“ }, {$set: { password: „$2a$06$cJz8kbmsELt.zmoXRGFs.uJwimjClVdIfu/NCt.A.pFdQyQJpji9K“ } } )“

Login to the interface with: „admin“/“ubnt“.
Click Users, Slect the admin user.
Change the ADMIN password to a strong passphrase!! (Seriously.)

Unifi G3 Flex Snapshot

  • zum Einbinden in Mediola über die URL, da RTSP nicht unterstützt wird

Overview…

This requires you to allow API access for a user, the user needs View Camera privileges, copy the user API key, identify the camera you wish to retrive the snapshot from and copy it’s unique ID – all which are required to compile a URL which you can test in a browser and if successful you can use the URL as your snapshot request for your alarm system.

Step by Step…

1. Select a user that has View Camera privileges (admin users will have this by default).

2. Allow API Usage for this user and make a note of the API key for later.

3. Find and select the camera you want to take snapshots from, under RTSP Service, enable the RTSP Service to show the RTSP URL and copy the uniquie ID without the appended underscore and it’s corresponding integer. Make a note of this for later (you can now turn this off if it was originally off).

4. Compile the URL by replacing nvr_hostname_or_ip with the IP or hostname of your NVR, keep the port (7080) of the web UI unless changed, camera_id with the camera ID we copied in step 3, and user_api_key with the user’s API key copied in step 2… and we should have a URL as below:

http://<nvr_hostname_or_ip>:7080/api/2.0/snapshot/camera/<camera_id>?force=true&apiKey=<user_api_key>

Try the URL in a browser, preferably logout of the NVR first, and it should retrieve a JPEG snapshot.

For remote access you’ll need to forward port 7080.