4 ms·
I had a similar thing happen (having to recover from a very very stupid mistake), I hadn't deleted everything, but I had moved the entire tree into /var/www (oo
by blhack 17y ago
I had a similar thing happen (having to recover from a very very stupid mistake), I hadn't deleted everything, but I had moved the entire tree into /var/www (oops)
This is an profanity-laden blog I wrote immediately after I figured out how to fix it and got everything back up and running:
http://newslily.com/blogs/94 http://newslily.com/blogs/94
(I'll be the first to admit that I sound like an obnoxious teenager in this blog, and that some of the things that I tried to fix it were very naive...it was a few years ago that it happened and as stupid as it is to admit, trying to get everything back up and running made my adrenaline pump pretty hard, so...I apologize in advance...)
- ajross 17y agoTo be fair: you had this happen on a piece of consumer hardware which can boot off of any of several dozen live CDs or USB drives, available off the internet at megabit speeds using one of the (no doubt) several other pieces of consumer hardware you have in arms reach. The VAX 11/780 had no portable boot device, and BSD unix had no "installation media". You bootstrapped to a system monitor, loaded a second stage off of tape header into memory manually, and hand-build your root filesystem. And that's assuming you still have your original tapes from Berkeley in storage somewhere. I actually tried doing this on the simh simulator a while back, out of sheer curiosity. I gave up before managing to make it work.
- deleted 17y ago[deleted]
- blhack 17y agoTo be fair: you had this happen on a piece of consumer hardware which can boot off of any of several dozen live CDs or USB drives, available off the internet at megabit speeds using one of the (no doubt) several other pieces of consumer hardware you have in arms reach. I wish! This was done on a VPS located god knows where and run by a company that was owned by people who didn't seem to speak any English. I remember emailing them and asking them if they could just move my dirs back using a chroot, but they had no clue what I was talking about. If I had allowed my SSH session to time out, I would have most-certainly lost the server and everything on it. I have since switched to a combination of slicehost and linode.
- cperciva 17y ago... I would have most-certainly lost the server and everything on it. I have since switched to a combination of slicehost and linode. Switching to a different VPS provider is not the right way to prevent data loss. Doing backups is the right way to prevent data loss. :-)
- orborde 17y agoThis is true, but he gets props in my book for being smart enough to switch away. It seems surprisingly common that people don't do this.
- blhack 17y agoAbsolutely, and I didn't say that switching VPS providers was a replacement for backups (the linode and slicehost boxes now trade rsyncs every night which include mysqldumps). My point was that I think if a similar thing happened now, that the fine folks at either provider would be more able to help me out. Even still, I would much rather be able to just mv the dirs back to their proper location from a chroot than having to do a restore from scratch over the network.
- BrandonM 17y agoIt's one thing to work under root sometimes, and it's another thing entirely to work in the root directory. I'm still trying to understand how the file upload sent a bunch of images into the root directory. I would undoubtedly have scp'd or ftp'd the files to either my home directory or the standard ftp directory with user permissions, and then I would have moved the images to where they belong (as root if necessary). Still, you had some good points. The information on explicitly indicating the library directory is good. Most important of all is the lesson to double check any mv, rm, and splat-completing command that is run as root (or under sudo, for you sudo junkies out there). Personally when I'm using a * in a root command, I first add "echo " to the beginning of the line so that I am sure of what is going to happen before I execute it.
- blhack 17y agoI was being incredibly lazy and did the following: pscp *.jpg root@gibsonandlily.com:/ This was monumentally stupid, I know. Looking on the bright side of things, however, I learned my lesson :).
- BrandonM 17y agoYou know that if you just left the slash off, the files go into root's home directory (typically /root/)? On a separate note, I tend to disable root SSH access on my servers. I SSH as a user and then when necessary, I'll su to root. Not only does that kill the temptation to use root as the default login, it also makes it doubly-hard to get to root as far as password-stealing goes.