{"id":197,"date":"2007-01-17T09:40:42","date_gmt":"2007-01-17T15:40:42","guid":{"rendered":"http:\/\/blog.the-erm.com\/archives\/197"},"modified":"2007-03-17T00:09:04","modified_gmt":"2007-03-17T06:09:04","slug":"when-your-life-comes-crashing-down","status":"publish","type":"post","link":"https:\/\/blog.the-erm.com\/?p=197","title":{"rendered":"When your life comes crashing down"},"content":{"rendered":"<p>It happens, people die, hard drives crash, files get erased.<br \/>\n<!--more--><br \/>\nI really feel guilty for using that analogy.  After all a bunch of deleted files can&#8217;t possibly compare to the grief of loosing a loved one. <\/p>\n<p>Recently &#8211; within the last 3 days-  I somehow managed to recode a <em>mission critical<\/em><\/p>\n<p>I don&#8217;t know if I should share with you how my hard drive crashed &#8230; or partitions got erased, but I might as well.  So you won&#8217;t do the same thing.<\/p>\n<p>To start our story we must go back to the root of the problem.<\/p>\n<p>When I was installing linux I thought it would be a good idea to have a \/var folder for my www data, and a \/ partition.  I neglected to create a \/usr partition.  After a while \/ started getting full.<\/p>\n<p>My \/tmp directory caused mysql to wine about no space.  So I moved it to \/var\/tmp<\/p>\n<p>It kinda bothered me that I didn&#8217;t have enough space, so I started uninstalling various programs I didn&#8217;t need.  I only had about 300-500 meg free by the end of it.  This kinda bothered me.<\/p>\n<p>So I decided that there was plenty of room on my <strong>&#8220;backup&#8221;<\/strong> drive that I could make a nice hefty 10 gig partition for \/usr and use some of that empty space.<\/p>\n<p>Keep in mind this is my <strong>backup<\/strong> drive.  It&#8217;s a separate drive I back everything up to.<\/p>\n<p>I figured worst case scenario I would have to reinstall \/boot.<\/p>\n<p>I backed up \/etc \/boot and just to be safe a copy of my latest mysql dump that&#8217;s ran every day, and then zipped.<\/p>\n<p>I really don&#8217;t know why I was worried about those files, but I did.  I guess it&#8217;s because of all the work I did on the dns recently, and well &#8230; \/etc is pretty vital.  Mysql is equally vital to me.<\/p>\n<p>I don&#8217;t know what i was thinking not backing up \/var\/www\/  It&#8217;s one of the most important folders on my computer.  I guess I was thinking &#8230; I&#8217;m not playing with \/var so everything should be ok. <\/p>\n<p>In preparing for my trip to the unknown insanity which my life was about to become I also downloaded the latest kubuntu linux cd.  A live cd &#8230; I love live cds.  A full os on a CD that is really quite functional.<\/p>\n<p>I popped in the live disk to reparation my drive.<\/p>\n<p>All went well \/var was there, the old \/usr was there, and the new \/usr was there as I expected \/boot needed to be reinstalled.<\/p>\n<p>Just to make sure, kubutu gives you the option of booting to the hard disk.<\/p>\n<p>No problems there.  The server was there, and intact.<\/p>\n<p>Everything was exactly how it should be minus \/boot.<\/p>\n<p>So I copied over the backup of \/boot and &#8230; rebooted.<\/p>\n<p>Nothing &#8230; hmmm still couldn&#8217;t boot from the drive without the CD.<\/p>\n<p>I didn&#8217;t want to have to have a cd in the drive just to boot the hard drive, so I loaded up the live cd.<\/p>\n<p>Looking back &#8230; having it installed the way it was dumb.<\/p>\n<p>I first had windows on \/dev\/hda and linux on \/dev\/hdb<\/p>\n<p>The windows drive later became my backup drive &#8230; just so you know why I had hdb as my boot drive.<\/p>\n<p>Long story short I some how erased \/var.  I guess I saw that free 10 gig on the drive, and said why don&#8217;t I use that as \/usr instead.<\/p>\n<p>I guess I clicked the wrong line, and when I caught it \/var was gone gone gone.<\/p>\n<p>What is kept in var &#8230;. \/var\/mysql *I care about this* and \/var\/www *I care about this*<\/p>\n<p>At first I panicked.  Three years of my life &#8230; no you don&#8217;t understand three years of my life was gone .gone gone &#8230;.<\/p>\n<p>I laughed and laughed and laughed.  Just gone like that.<\/p>\n<p>Backup backup backup.  I thought to myself.  Always backup.  But it should be ok &#8230; it was ok why did i do this I could have just booted from the CD for the rest of my life.  Why did I have to play with the drive like a loose tooth that was waiting to be pulled out.  Like a scab that needs to be ripped off.  Like a hangnail. WHY.  Why did I play with it like pealing paint on a bedroom wall that you know if you pull it you&#8217;ll just end up painting the whole room.<\/p>\n<p>ARGH hahahaha<\/p>\n<p>So I called the parties involved.  It&#8217;s bad enough when you delete your drive, but when you delete your clients \/bosses data &#8230; it&#8217;s bad really bad.<\/p>\n<p>At first I wanted to tell him to F-off and just dump on him every little thing I ever thought of saying to him, but I didn&#8217;t.<\/p>\n<p>In fact he asked me if I was quitting.  I said &#8230; Actually I was wondering if I still had a job, he asked me if he wanted me to have him get an external usb drive, and I told him no, this is my f-up, I&#8217;ll get it.<\/p>\n<p>So it was recoup time.  At this point in time I thought I had lost <strong>all of \/var<\/strong>  Most but 1 key area was hidden and intact.<\/p>\n<p>I got off the phone, and went straight to Sam&#8217;s Club.  Pretty cheap drives.  I grabbed a 250 GB drive, so I wouldn&#8217;t have to mess with the other drive I just goofed up, just in case I could find some sort of data recovery tool.  It was worth $100 to me to get a drive that I didn&#8217;t always have to wonder about maybe I can retrieve the data &#8230;.<\/p>\n<p>I also grabbed an external 100 GB usb drive.<\/p>\n<p>At this point in time my head is spinning, and I&#8217;m just asking myself what do I need to do first, what first?<\/p>\n<p>What&#8217;s the first step?<\/p>\n<p>Set up http, no first step is &#8230; first step is.<br \/>\nWell obviously it was put in the drive, but that wasn&#8217;t what I was thinking about.<\/p>\n<p>For the record I went the speed limit the whole way \ud83d\ude42<\/p>\n<p>I kept thinking to myself &#8230; no I&#8217;m not going to kill myself over a bunch of pictures, it&#8217;s just too stupid&#8230;<\/p>\n<p>It&#8217;s a good thing that my boss doesn&#8217;t care about pictures that were already sent to the client.<\/p>\n<p>There were quite a few &#8220;Oh thank God&#8221; moments, and &#8220;thank you Jesus&#8221; while I was plugging away that night.<\/p>\n<p>I thought I lost my database &#8230; I didn&#8217;t I forgot I even backed it up &#8230; Thank God I had the presence of mind to back that up.<\/p>\n<p>So the night kept getting better.<\/p>\n<p>Damage control was &#8230; I just lost \/var, and not *all the pictures* just the ones that were of my children &#8230; that were backed up on my wife&#8217;s computer &#8230; I hope.<\/p>\n<p>I still had my precious phpMUR, and xphMUR because I kept them in \/home\/erm\/ \ud83d\ude42<\/p>\n<p>My friends website was unharmed as well, just one small area was affected  &#8230; which I don&#8217;t think he cared about, but I&#8217;m not sure.<\/p>\n<p>On the first day I set up the following servers:<br \/>\nDNS, HTTP, SSH, SMTP, POP3, and MYSQL<\/p>\n<p>Most of those were pretty easy since I had the backup of \/etc.  If your BIND9 dns is complaining about permissions, just type killall bind9, and restart.  It wasn&#8217;t letting me kill it using \/etc\/init.d\/bind9 restart.<\/p>\n<p>My second third and fourth days were spent re-developing a mission critical site &#8230; well what I get paid for anyways.<\/p>\n<p>It&#8217;s weird deciding &#8230; should I use the same open template I did before when I make this, or try something new.  I&#8217;m boring I used the old template.<\/p>\n<p>Granted the css isn&#8217;t quite the way I like it on the new site, because I just haven&#8217;t had the time to tweak it, but overall I have a site that is 110% better than the old one in some areas, and 85% in others.<\/p>\n<p>Overall I&#8217;d say that the site is 90% functional in comparison to the old site.<\/p>\n<p>It&#8217;s weird when you recode something, and you think to yourself &#8230; why didn&#8217;t I do it this way last time, this is SOO much easier.  I&#8217;m glad I had my db, and html classes.  Those 2 saved so much time.<\/p>\n<p>In other areas, like my calendar class which I lost I was thinking to myself &#8230; now how did I do that?<\/p>\n<p>I don&#8217;t know if this was a testament to my coding\/server_admin skills, or a testament to how dumb 1 person can be, but now that I&#8217;m almost done with the mission critical site &#8230; I can see a light at the end of the tunnel, and realize I must be pretty good at it.<\/p>\n<p>Erm<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It happens, people die, hard drives crash, files get erased.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,24,5],"tags":[],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-insanity","category-life-stories","category-things-that-get-me-mad"],"_links":{"self":[{"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=197"}],"version-history":[{"count":0,"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=\/wp\/v2\/posts\/197\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.the-erm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}