-
What are all the failure codes that are programed into the OS and what do they all mean? This would be good to know in case I have to do some troubleshooting. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
I assume you mean errors that the nwipe code generates? It doesn't tend to produce distinct exit codes, generally -1 for error, 0 for success. All errors have a fairly obvious & verbose English error message written to the nwipe log which is located in the root directory. So the first place to look is in that log file. The log file is only created on disc on nwipe exit, however the tail end text & summary tables are automatically shown on screen on exit. To view the full log you would jump to the second virtual terminal ALT F2 and type ls to list the files. Choose the most recent nwipe[date&time].log and use more/cat to display it. Other than a I/O errors related to failing discs, I don't tend to see errors in general usage as the code is pretty stable. If anybody wants to go through the code and compile a list of all possible error messages and post it here then please feel free. |
Beta Was this translation helpful? Give feedback.
-
So I tried to get some of them, I don't think I got all of them though. I will attach a document later with everything compiled. As far as I can tell for the GUI, the only error displayed in the GUI is "Failure Code -1" which actually ties to a linux command On success, the system calls the return 0, in which nwipe then displays. On error, -1 is returned, and errno (number of last error) is set appropriately. It does have specific errors it can display, but I can't seem to find it anywhere in the code so I don't think its an addition Either way, nwipe determines what the cause of the error is and writes in the log what it was, but I can't seem to find out how it does that, I looked through a lot of the code for both nwipe and ShredOS and can't find much, i might be looking in the wrong places. Any tips? Also, are the logs written to the USB thumb drive (if inserted) or are the stuck in the RAM until moved? Thanks for all the help, I'm still kinda learning about linux processes so if I'm wrong about something just tell me :) |
Beta Was this translation helpful? Give feedback.
-
If I remember correctly, the wipe threads returned 0 on success, -1 on a critical failure that meant the wipe would stop and +1 on a soft error. Trouble is, it was never really clear what a soft error might be. So over time it's become that any error is critical. At least, without looking at the code that how I remember it. I'm not keen on the message Failure code -1, in my opinion it would be better if the threads returned more detailed codes so the appropriate error could be displayed. Something to improve on in the future, however having said that that once the wipe thread is active the device has already been opened so failures that occur will generally be I/O failures picked up by fdatasync.
To make a log entry the nwipe_log() function is called always from within the nwipe source code. All logging related functions are located in the source file /src/logging.c and it's header logging.h The logging function works by storing log entries in RAM which are indexed. Mallocs are used to allocate memory for each log message so logging is limited only by memory limits not some arbitrary array size. Nwipe then calls, on completion of all wipes another logging function to send all log entries to stdout. The allocated memory is then free'ed before nwipe exits. That's how nwipe manages to print log entries that may have happened many hours ago. Nwipe also has a command line option to write the logs to a file, which ShredOS uses. Each wipe is stored in a timestamps nwipe_xxxxx.log file in the root '/' of the RAM drive. Currently ShredOS doesn't copy these logs back to the USB stick however that is a feature that will be added at some point. ShredOS does support ftp'ing those log entries to a FTP server on your network. Instructions in the ShredOS README.md file.
I've been using Linux for twenty years and before that UNIX and I'm still learning 😁 |
Beta Was this translation helpful? Give feedback.
-
So I believe I found an answer to my original question, which was what there error codes mean. This is what nwipe generates but I imagine it's a pretty straight forward crossover to ShredOS. Let me know if this doesn't sound right. I got a total of 4 messages that can print depending on what happens; The only other thing I found is the use of exclamation tags if there was an error of any kind, or at least that's what I can interpret from this piece of code for the error summary: Anyways, at this point I'm doing more digging just for fun, I'm pretty sure I found the answer to my original question. Thanks for the help! |
Beta Was this translation helpful? Give feedback.
-
I'm sure I recently fixed that bug in nwipe martijnvanbrummelen/nwipe@978c4e9 and pull request here That fix should be in nwipe & ShredOS 0.32.22 and later. It was only recently committed 12/Jan/2022. What version of nwipe have you got? |
Beta Was this translation helpful? Give feedback.
-
That's correct, In the summary table and error log, as well as a text entry stating success or failure a exclamation mark is placed as the first character of the line to highlight that the line contains an error.
|
Beta Was this translation helpful? Give feedback.
@PartialVolume
So I believe I found an answer to my original question, which was what there error codes mean. This is what nwipe generates but I imagine it's a pretty straight forward crossover to ShredOS. Let me know if this doesn't sound right.
I got a total of 4 messages that can print depending on what happens;
-FAILED- if it failed
Erased if it wiped successfully
UABORTED if it was aborted
INSANITY if there was a bug
The only other thing I found is the use of exclamation tags if there was an error of any kind, or at least that's what I can interpret from this piece of code for the error summary:
for( i = 0; i < nwipe_selected; i++ ) { if( c[i]->pass_errors != 0 || c[i]->verify_errors…