Okay, you ever do something and forget to do one simple thing, and it completely hozez the whole thing? I do, I do! Last night I was repartitioning some space on the www server. This should be a relatively simple task since I was completely wiping out a 5g partition, then creating new partitions on it to move existing ones to.
So I unmount the partition, use fdisk, wipe out the existing partition, and create 3 new ones. Then rebooted (this would be where I fucked up). I forgot to format the partitions, so when linux is booting up, fsck starts spewing out the errors. Now had I realized right away what I had forgotten, this would have been easily recoverable. But I did not.
I look in fdisk, and see that there are a bunch of errors on the partitions, one of which was (what I though) an old partition that should have been removed. So I hit “d” fdisk says pick a partition (1-10) I hit “5” then “w” to save the table, then exit out of fdisk. It is now that I realize that I had forgotten to format before, so I format my 3 new partitions, and reboot.
Linux starts booting, and fsck gives me another error about a partition that should have been “swap”. I go into fstab and realize that something got fucked up some how, and hda7 and hda8 some how switched. I fixed this and rebooted.
Linux boots fine this time. I log in, and type in an alias that I use, and get an error. I immediately knew what happened. /home was gone! somehow, the partitions had all gotten switched around, and /home ended up getting formatted. DOH!
Luckily, unless my users were doing so without my knowledge, there was nothing terribly important on this partition. I lost a lot of misc. stuff that I kept in my home dir, but nothing I can’t live without. Thank god /www /usr & /var are all on another disk.
Oh well, shit happens! This is how I learn all the stuff I know. Make a dreadful mistake, don’t ever do it again.