Archive for September, 2011
I routinely back up my RHEL boxes with RSYNC over SSH… It’s just something I do. Yeah, I know, I’m using “X” commercial backup application and it works well, yadda, yadda, yadda. However, I still make at least weekly backups with RSYNC to a NAS. It is a habit of mine, like hookers and blow.
Question came up, “how do you do a bare metal restore from that backup?” which tags along with the question “how do you do a bare metal copy from old server to brand new server?”
If the hardware isn’t too odd (usually hardware RAID controllers you have drivers in your initrd is the limiting factor here, but you can work around that too with some Linux foo skillz…), or it’s a bare metal restore to same hardware, yes, you can use RSYNC.
for my examples: “sourceserver” is the other running server that you want to bare metal copy to the destination.
“target” is the destination server.
First: boot the destination server with a rescue disk. I use RHEL rescue CD.
Create your partitions to taste, and reboot again with the RHEL rescue CD.
Second: Mount partitions in the order you want them. example: (I just picked an example partition table, seriously, match what you really need…)
mount /dev/sda2 /mnt/sysimage
mount /dev/sda1 /mnt/sysimage/boot
mount /dev/sda5 /mnt/sysimage/home
mount /dev/sda6 /mnt/sysimage/var
this mounts all of the “target” under /mnt/sysimage on the rescue cd.
Third: I have this script I run: (which you can make on the rescue disk, once again, a little bit of foo goes a long way…)
rsync –verbose –stats –owner –group –devices \
–recursive –times –perms –links \
enter your SSH password (yes, you should allow root logon through SSH for this one, if you don’t know how to enable that, look it up on google, it’s braindead easy…)
Fourth: reset the permissions on the “/” share and make sure they are right:
chmod 755 /
Fifth: Finally, fix grub. (this example is from my VMware ESX servers…)
From the linux rescue:
Issue the grub command:
then type in these commands: (depending on your hard drive layout and 0 = zero for those easily confused…)
device (hd0) /dev/sdm (this server was /dev/sdm instead of something normal like /dev/sda… salt to taste, or add butter like Paula Dean…)
then reboot and test, test again, enjoy!
A little over a year ago, I purchased one of Harbor Freight’s auto-darkening welding helmets. For $50, it’s a great deal.
Unfortunately, after less than a year of use, it simply stopped working. Somewhat ironically, the way you find out that your helmet has stopped working is by getting a flash burn in your eyes when you weld using a broken helmet.
One of the guys in my welding class mentioned that there are batteries in the helmet which can go bad over time. Batteries in a solar-powered helmet? Clearly this guy was nuts — but I thought I’d check it out anyway.
Turns out, he wasn’t crazy. There are two CR2330 coin cells soldered directly to the main circuit board inside of the unit:
Since soldering in batteries every time they go dead is not exactly a user-friendly solution, I decided to replace them with AAA’s. Here’s the procedure.
1) Remove the darkness adjustment knob by gently prying it off with a screwdriver. Un-screw the plastic nut which holds the unit in place.
2) Remove the clear plastic shield from the front of the helmet, and then gently remove the electronics assembly by unhooking the retaining spring.
3) Use a utility knife to pop open one corner of the enclosure. Work your way around the circumference with a screwdriver, breaking apart the plastic weld, until the cover can be removed.
4) Mark the locations of the (+) and (-) of each coin cell. Using your desoldering braid, remove the coin cells.
5) Go to Radio Shack and buy two AAA battery holders. I used these:
6) Solder one AAA holder in place of each of the coin cells that you removed. Be sure to observe polarity.
7) Using the shaft of your soldering iron, melt a hole in the side of the enclosure so that the wires from the battery holders can exit. You’ll also want to melt a corresponding hole in the cover.
8) Mix up some 2-part epoxy, and epoxy the wires to the enclosure. This step probably is not necessary, but I don’t want to burn my eyeballs again.
9) Wait for the epoxy to dry. Take this opportunity to clean all the viewing windows with Windex and a lint-free cloth, then reassemble the unit. There are four friction pins which seem to hold everything together just fine.
10) Re-install the electronics housing into the helmet. Re-attach the darkness adjustment dial.
11) Glue the two AAA holders to the inside of the helmet. I initially used the same epoxy that I used to hold the wires in place, but it didn’t bond to either the plastic of the helmet or the plastic in the battery holders. I ended up using my hot glue gun, which worked very well.
12) Install four AAA batteries, and then test your helmet. I found – quite by accident – that the helmet will darken when you look at a halogen light bulb.
13) Go weld stuff.
Good luck with your repair!