From 033760c32888f2b058be196bf15760b293390821 Mon Sep 17 00:00:00 2001 From: localhorst Date: Wed, 11 May 2022 21:53:58 +0200 Subject: [PATCH] disk uuid changed to 8 byte long --- README.md | 37 ++++++++++++++++++------------------- ignoreDrives.conf | 6 +++--- src/reHDD.cpp | 2 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index ddf5bc8..ab18a43 100644 --- a/README.md +++ b/README.md @@ -14,28 +14,24 @@ * clone repo * make release -## Create Standalone with Debian +## Create Standalone with Debian 11 Instructions how to create a standalone machine that boots directly to reHDD. This is aimed for production use, like several drives a day shredding. ### Software requirements -* apt-get install hwinfo -* wget http://ftp.de.debian.org/debian/pool/main/s/smartmontools/smartmontools_7.1-1_amd64.deb -* dpkg --install smartmontools_7.1-1_amd64.deb +* apt-get install hwinfo smartmontools curl ### Start reHDD after boot without login (as a tty shell) -nano /etc/systemd/system/reHDD.service -``` -[Unit] -Description=Custom user interface on tty1 -Conflicts=getty@tty1.service -Before=getty.target +nano /lib/systemd/system/getty@.service +and replace the [Service] with this: +``` [Service] WorkingDirectory=/root/reHDD -ExecStart=/root/reHDD/reHDD +ExecStart= +ExecStart=-/root/reHDD/reHDD StandardInput=tty StandardOutput=tty Restart=always @@ -47,10 +43,10 @@ TTYVHangup=yes TTYVTDisallocate=yes SendSIGHUP=yes -[Install] -WantedBy=multi-user.target ``` +systemctl daemon-reload + nano /etc/systemd/system/reHDDSettings.service ``` [Service] @@ -66,14 +62,17 @@ nano /root/reHDDSettings.sh ``` #!/bin/bash dmesg -n 1 #disable overlay if a drive is attached/detached +# remove comment for the following to activate log telemetie +# curl -k -T /root/reHDD/reHDD.log -u "fgggfffgfgfgfg:" -H 'X-Requested-With: XMLHttpRequest' https://schuttercloud.com/public.php/webdav/`echo $(date '+%Y-%m-%d_%H-%M')`_reHDD.log rm -f /root/reHDD/reHDD.log ``` -Make sure the binary reHDD is in /root/reHDD/ -Add your system drive in /root/reHDD/ignoreDrives.conf like: -``` /dev/sdX:e102f49d-5ed5-462b-94c5-ef66a4345671``` -Get your UUID via blkid /dev/sdX +chmod +x reHDDSettings.sh -systemctl enable reHDD.service + +Make sure the binary reHDD is in /root/reHDD/ + +Add your system drive in /root/reHDD/ignoreDrives.conf like: +```e102f49d``` +Get the first 8 Bytes from your UUID via blkid /dev/sdX systemctl enable reHDDSettings.service - diff --git a/ignoreDrives.conf b/ignoreDrives.conf index ed2b36a..f38b1e1 100644 --- a/ignoreDrives.conf +++ b/ignoreDrives.conf @@ -1,3 +1,3 @@ -/dev/sdc:4673974d-1af2-44fd-996b-a2d8e4c43d9a -/dev/sda:508ef27d-5039-4e8b-9e2c-22d7528b7149 -/dev/sdb:32b66944-ffa0-40e9-817c-3f0c52eefaf4 +/dev/sdc:4673974d +/dev/sda:508ef27d +/dev/sdb:32b66944 diff --git a/src/reHDD.cpp b/src/reHDD.cpp index f4a764e..380159c 100644 --- a/src/reHDD.cpp +++ b/src/reHDD.cpp @@ -354,7 +354,7 @@ void reHDD::filterIgnoredDrives(list * plistDrives) { string sBlkidOut = string(cLine); sBlkidOut.erase(0, 18); - sBlkidOut.erase(36, sBlkidOut.length() - 36); + sBlkidOut.erase(8, sBlkidOut.length()); sUUID = sBlkidOut; //cout << "blkid uuid:" << sUUID << endl; }