disk uuid changed to 8 byte long

This commit is contained in:
Hendrik Schutter 2022-05-11 21:53:58 +02:00
parent af38d60982
commit 033760c328
3 changed files with 22 additions and 23 deletions

View File

@ -14,28 +14,24 @@
* clone repo * clone repo
* make release * 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. 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 ### Software requirements
* apt-get install hwinfo * apt-get install hwinfo smartmontools curl
* 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
### Start reHDD after boot without login (as a tty shell) ### Start reHDD after boot without login (as a tty shell)
nano /etc/systemd/system/reHDD.service nano /lib/systemd/system/getty@.service
```
[Unit]
Description=Custom user interface on tty1
Conflicts=getty@tty1.service
Before=getty.target
and replace the [Service] with this:
```
[Service] [Service]
WorkingDirectory=/root/reHDD WorkingDirectory=/root/reHDD
ExecStart=/root/reHDD/reHDD ExecStart=
ExecStart=-/root/reHDD/reHDD
StandardInput=tty StandardInput=tty
StandardOutput=tty StandardOutput=tty
Restart=always Restart=always
@ -47,10 +43,10 @@ TTYVHangup=yes
TTYVTDisallocate=yes TTYVTDisallocate=yes
SendSIGHUP=yes SendSIGHUP=yes
[Install]
WantedBy=multi-user.target
``` ```
systemctl daemon-reload
nano /etc/systemd/system/reHDDSettings.service nano /etc/systemd/system/reHDDSettings.service
``` ```
[Service] [Service]
@ -66,14 +62,17 @@ nano /root/reHDDSettings.sh
``` ```
#!/bin/bash #!/bin/bash
dmesg -n 1 #disable overlay if a drive is attached/detached 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 rm -f /root/reHDD/reHDD.log
``` ```
Make sure the binary reHDD is in /root/reHDD/ chmod +x reHDDSettings.sh
Add your system drive in /root/reHDD/ignoreDrives.conf like:
``` /dev/sdX:e102f49d-5ed5-462b-94c5-ef66a4345671```
Get your UUID via blkid /dev/sdX
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 systemctl enable reHDDSettings.service

View File

@ -1,3 +1,3 @@
/dev/sdc:4673974d-1af2-44fd-996b-a2d8e4c43d9a /dev/sdc:4673974d
/dev/sda:508ef27d-5039-4e8b-9e2c-22d7528b7149 /dev/sda:508ef27d
/dev/sdb:32b66944-ffa0-40e9-817c-3f0c52eefaf4 /dev/sdb:32b66944

View File

@ -354,7 +354,7 @@ void reHDD::filterIgnoredDrives(list <Drive>* plistDrives)
{ {
string sBlkidOut = string(cLine); string sBlkidOut = string(cLine);
sBlkidOut.erase(0, 18); sBlkidOut.erase(0, 18);
sBlkidOut.erase(36, sBlkidOut.length() - 36); sBlkidOut.erase(8, sBlkidOut.length());
sUUID = sBlkidOut; sUUID = sBlkidOut;
//cout << "blkid uuid:" << sUUID << endl; //cout << "blkid uuid:" << sUUID << endl;
} }