What are the side effects of a full root partition?

245

The severity of a full root partition can be mitigated a little if other parts of the filesystem are on their own partitions. However just picture what any process may do if it can't write to the filesystem and gets an error instead.

As an exmple the /var/run/*.pid files can't be created by any process that uses this mechanism (and lots do), they should fail to start or just crash or they may repeatedly try and start, not detect they have started already due to no pid file being present and start a new instance, until the out-of-memory killer process fires up and starts killing stuff at mostly random.

Side effects can include but are not limited to

  • the server crashing unexpectedly in the middle of the night while the admin(s) are on holidays, heavily asleep, etc...
  • depending on how your custom application is written it may not handle that crash in any sort of reasonable fashion and corrupt itself to the point where you need to restore from backup. Most developers first thoughts when testing are not, "what happens if I yank the power cord out..... NOW! WOW that didn't kill it, what about if I do it....... NOW"

You do have backups right...

How long would it take to

  • realise you can't recover the existing system in any sort of reasonable timeframe
  • possibly setup a new machine (so you take out the old one for analysis for some hopeful info recovery)
  • actually restore from backup

How much will management like that sort of downtime and data loss...?

Share:
245

Related videos on Youtube

hookenz
Author by

hookenz

Updated on September 18, 2022

Comments

  • hookenz
    hookenz almost 2 years

    Here is my content in my text file: and I only want to get this sha1 and description then parse it to a csv file using prefix and delimiter a trimed the strings then selected the sha1 between "\" and "->" then I want to get the description.

             +----------------------------------------------------+
             |          VSCAN32            Ver 2.00-1655          |
             |                                                    |
             |     Copyright (c) 1990 - 2012 xxx xxx xxx Inc.     |
             |                                                    |
             |    Maintained by xxxxxxxxx  QA for VSAPI Testing   |
             +----------------------------------------------------+
    
    Setting Process Priority to NORMAL: Success 1
    
    Successfully setting POL Flag to 0
    VSGetVirusPatternInformation is invoked
    Reading virus pattern from lpt$vpn.527 (2018/09/25) (1452700)
    
    
    Scanning samples_extracted\88330686ae94a9b97e1d4f5d4cbc010933f90f9a->(MS Office 2007 Word 4045-1)
    ->Found Virus [TROJ_FRS.VSN11I18]
    
    
    
    Scanning samples_extracted\8d286d610f26f368e7a18d82a21dd68b68935d6d->(Microsoft RTF 6008-0)
    ->Found Virus [Possible_SMCCVE20170199]
    
    
    
    Scanning samples_extracted\a10e5f964eea1036d8ec50810f1d87a794e2ae8c->(ASCII text 18-0)
    ->Found Virus [Trojan.VBS.NYMAIM.AA]
    
    
    18 files have been checked.
     Found 16 files containing viruses.
    (malloc count, malloc total, free total) = (0, 35, 35)
    

    So far this is my code: it still outputs many string but i only need the sha1 and description to be parsed in csv I used split so the sha1 can be selected between "\" and "->" it does put the sha1 but the description is not trimed, and the contents are still there

    import csv
    
    INPUTFILE = 'input.txt'
    OUTPUTFILE = 'output.csv'
    PREFIX = '\\'
    DELIMITER = '->'
    
    def read_text_file(inputfile):
        data = []
        with open(inputfile, 'r') as f:
            lines = f.readlines()
    
        for line in lines:
            line = line.rstrip('\n')
            if not line == '':
                line = line.split(PREFIX, 1)[-1]
                parts = line.split(DELIMITER)
                data.append(parts)
    
        return data
    
    def write_csv_file(data, outputfile):
        with open(outputfile, 'wb') as csvfile:
            csvwriter = csv.writer(csvfile, delimiter=',', quotechar='"',
                                    quoting=csv.QUOTE_ALL)
            for row in data:
                csvwriter.writerow(row)
    
    def main():
        data = read_text_file(INPUTFILE)
        write_csv_file(data, OUTPUTFILE)
    
    if __name__ == '__main__':
        main()
    

    Here is what I want in my csv: sha1 and description, but my output file dispplays the whole text file, but it filtered the sha1 and putted it in a column sha1 and description only

    EDIT: At first it was working but this line of text can be placed in the csv file because of it's multiple lines, any answer please?

    Scanning samples_extracted\0191a23ee122bdb0c69008971e365ec530bf03f5
     - Invoice_No_94497.doc->Found Virus [Trojan.4FEC5F36]->(MIME 6010-0)
    
     - Found 1/3 Viruses in samples_extracted\0191a23ee122bdb0c69008971e365ec530bf03f5
    
    • Evgeny
      Evgeny almost 6 years
      A little problem with your question is that lacks a bit of focus. The description you give is 'here is what is happening, but also that is happening, and I also want another thing to happen', it is hard to see what is wrong. You can probably narrow down your question by throwing away the file read / file write operations and a sceeenshot. Try refactoring your code into something like doc = """" file contents or string """; result = parse(doc) and assert about result. This way it will be much closer to your actual problem and will make your question more helpable.
  • hookenz
    hookenz almost 11 years
    Thanks that's actually useful. It's mission critical but is actually a stateless server so deploying a new one is easy. It's just that taking it offline could affect a lot of people.
  • BeowulfNode42
    BeowulfNode42 almost 11 years
    even though my answer sounds sarcastic, it is not. I've had both windows and linux servers crash because file systems were full. The server can take itself offline, and Murphy's Law will make sure it happens at the worst time. It may not be the whole system but if the mission critical app stops, it might as well be.
  • Admin
    Admin almost 6 years
    ImportError: No module named pandas
  • Admin
    Admin almost 6 years
    it's working for some text but it doesn't do the function for multiple line, please refer to my EDITED question
  • vishalk
    vishalk almost 6 years
    @jeremydevera try to install pandas by using this command pip install pandas on your command prompt