6 Commits

Author SHA1 Message Date
1ceffa56f8 Merge pull request 'Ignore system drives as live image' (#71) from bugfix/systemdrive_live into master
Reviewed-on: #71
2024-08-19 16:30:09 +02:00
4ff1888333 ignore system drives as live image 2024-08-19 15:35:22 +02:00
4b33fb6fdb update live image info 2024-08-17 16:02:58 +02:00
87a859f187 skip delete if drive was shredded before 2024-08-16 10:29:12 +02:00
952e8c8eeb add new flag 2024-08-16 10:29:12 +02:00
1055ef57ee Disable delete after shred was once started. (#69)
documented here: #65

Reviewed-on: #69
Co-authored-by: localhorst <localhorst@mosad.xyz>
Co-committed-by: localhorst <localhorst@mosad.xyz>
2024-08-16 10:26:49 +02:00
6 changed files with 20 additions and 7 deletions

View File

@ -9,7 +9,7 @@
* process multiple drives at once
## Download USB Image ##
[2.5GB image v1.0.0](https://schuttercloud.com/s/ggxGH9sA326aRfK) (`wget` is your friend)
See reHDD-Bootable how the live image created: https://git.mosad.xyz/localhorst/reHDD-Bootable
Use [Etcher](https://www.balena.io/etcher/#download) or `dd` to create an bootable USB drive .

View File

@ -34,6 +34,7 @@ public:
} sShredSpeed;
bool bWasShredded = false; // all shred iterations done
bool bWasShredStarted = false; // shred was atleast once started
bool bWasChecked = false; // all shred iterations and optional checking done
bool bWasDeleted = false;
bool bIsOffline = false;

View File

@ -8,7 +8,7 @@
#ifndef REHDD_H_
#define REHDD_H_
#define REHDD_VERSION "V1.1.2"
#define REHDD_VERSION "V1.1.3"
// Drive handling Settings
#define WORSE_HOURS 19200 // mark drive if at this limit or beyond

View File

@ -32,6 +32,9 @@ void Delete::deleteDrive(Drive *drive)
const char *cpComand = sCMD.c_str();
// cout << "delete: " << cpComand << endl;
if (drive->bWasShredStarted == false)
{
//only start delete if the drive was not shredded before
FILE *deleteCmdOutput = popen(cpComand, "r");
while ((getline(&cLine, &len, deleteCmdOutput)) != -1)
@ -39,4 +42,5 @@ void Delete::deleteDrive(Drive *drive)
// wipefs running
}
pclose(deleteCmdOutput);
}
}

View File

@ -665,6 +665,12 @@ bool reHDD::getSystemDrive(string &systemDrive)
break;
}
if (currentLine.ends_with(" /run/overlay/live\n"s))
{
systemDriveFound = true;
break;
}
if (currentLine.ends_with(" /\n"s))
{
systemDriveFound = true;

View File

@ -36,6 +36,7 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
ostringstream address;
address << (void const *)&(*drive);
Logger::logThis()->info("Shred-Task started - Drive: " + drive->getModelName() + "-" + drive->getSerial() + " @" + address.str());
drive->bWasShredStarted = true; //Mark drive as partly shredded
#ifdef DRYRUN
for (int i = 0; i <= 500; i++)
@ -48,6 +49,7 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
write(*ipSignalFd, "A", 1);
usleep(20000);
}
drive->bWasShredded = true;
#endif
#ifndef DRYRUN