Musings of a remote software developer…

Category Archives: IT

I had to setup a 2nd domain controller at an offsite location this past week. I don’t have any good VPN-ing routing equipment so I was just going to use OpenVPN to create a tunnel between the two sites. I set up OpenVPN to work with site-to-site routing and everything seemed to work… I could browse the shares from both sides, everyone was happy and could ping each other. I was even able to successfully install the 2nd domain controller and join the Windows domain. But then, I started getting all these random issues:

I spent lots of time troubleshooting it and I realized the issue. I set up the 2 OpenVPN servers to Masquerade NAT between the 2 subnets so all the traffic looked like it was coming from the VPN server itself. All the RPC calls were failing presumably because the domain controller was trying to open ports to communicate on. Anyways, I fixed that by making the openVPN server properly route and then DFSR was able to properly sync and replicate the two domain controllers. Moral of the story – make sure you set up proper routing and not NAT between domain controllers!

If you were able to get DCs working using masquerading NAT, please let me know. I’d be interested if that was possible.

This will clean up old kernels. The only way this won’t work is if you’re at 100%. Then you have to clear a few old kernels out manually and then resume installation of the latest kernel, then run the autoremove command.

Do you ever put your computer to sleep or hibernate only to find it mysteriously staring at you the next morning awake?? That certainly disturbed me and I tried many things to stop my computer from being a zombie and eating brains in the middle of the night. Here’s the steps to troubleshoot and nail it on the head exactly what is happening.

Modern computer BIOSes have a host of functions for waking up the computer when it is off. Among them are the Real Time Clock (RTC) alarm that can wake up the computer on a scheduled basis (wiki), Wake On LAN (WOL) which can wakeup based on a special packet (wiki), device wake-up, and of course, the old fashion power button. Windows has a few programs that allows you to control the different features. For device wake-up, you can follow the instructions here. The post below is focused on RTC alarm which was the issue I was having.

If you are interested in killing this behavior all together and do not want to bother with everything else, simply navigate to Control Panel -> Search for “Power Options” -> On the left sidebar, “Change when the computer sleeps” -> “Change Advanced power settings”. You will see the screen below. Simply disable “Allow Wake Timers” and your computer will never wake up again by the timer when you put it to sleep.

I

If you are interested like me to figure out what exactly is causing the computer to wakeup, we can dive deeper into the power management system. Open a cmd prompt as administrator.

We can see it is a scheduled task that is causing the system to wakeup at 2:59 in the morning. I’m on Windows 8, I believe the name might be different for previous versions, but you can go to Control Panel -> Search for “Scheduled” -> Scheduled Tasks. Look for the task listed above, in my case it was “Regular Maintenance”. Open that task and go to the “Conditions” tab and deselect “Wake the computer to run this task”.

After disabling that, check back with your wake timers and you should see the following:

C:\Windows\system32>powercfg -waketimers
There are no active wake timers in the system.

Now you can still have wakeup timers that go off when you want them while not having the daily 3AM alarm go off.

I got tired of having to have different media for installing the various versions of Windows 7 and Win 2k8 so I put together a master install disk. The procedure on how to do so has been around for a long time on the net, but I decided to automate it so I can repeat this in the future if I wanted to add other versions of Windows (say Win 8?).

I had a Lenovo Y570 I recently had to repair. It seemed like a straightforward job to mount the HDD using my favorite LiveCD and copy the data to a secondary hard drive. I quickly found out it wasn’t that straightforward. On this model, there was a 750GB hard drive with a 64GB SSD that was hybridly merged together using something called RapidDrive. The technology dynamically copies data between the HDD and SSD so that you can get the best of both worlds in terms of performance and space. Unfortunately, recovery of such systems when the drive is unbootable is almost impossible.

I booted up to my favorite live CD to find two partitions on the SSD, 1 spanning 750 GB. cfdisk would not even run because it said that this partition ends after size of the drive. The 750GB HD had several partitions on it, the largest 700GB one with all the data on it would not mount either… (probably because half of it was on the SSD!)

I could not find any information on the internet on how to mount the hard drives or recover the data. Lenovo was unhelpful and wanted to take the laptop and probably wipe it and give it back to me. I noticed though that when you run the “OneKey Recovery System” that the virus scanner was able to read the hybrid partition of data. There was hope of recovering the data.

Unfortunately though, OneKey Recovery gives you only 2 options, scan for viruses or wipe the hard drive and restore. I wish they would give me a command prompt or something. I tried numerous things such as booting OneKey Recovery System in safe mode and other things like that. Nothing worked. I finally dived into the internals and forced a command prompt to load up.

Here’s how.

UPDATE Thanks to reader RM, you can skip the steps in modifying the lrs.wim file and just try using his pre-modified lrs.wim file. No guarantees that it will work though – there may be specific drivers for each Lenovo laptop model that may make them incompatible. As always, backup your own lrs.wim file before using his just in case it doesn’t work.

Boot off your live CD. Identify the recovery partition. On my system, the SSD was /dev/sda and the HDD was /dev/sdb. The recovery system was on /dev/sdb3.

1
2

$ mount/dev/sdb3 /mnt/local
$ mount/dev/sdc1 /mnt/usb # storage drive

Make a backup, then copy off the wim file off the recovery partition.

1
2
3

# the filenames may be off since I am writing this from memory
$ cp/mnt/local/Onekey/PE/lrs.wim /mnt/local/Onekey/PE/lrs.wim.original
$ cp/mnt/local/Onekey/PE/lrs.wim /mnt/usb/

Unmount your external drive and bring it to your windows machine with AIK installed on it. Mount the wim and update the boot loader file. You must run all the following commands as administrator (right click on cmd.exe and click “run as administrator”)

Copy the lrs.wim back to the original location and shutdown and restart using the “OneKey” button. When you startup, you should get a command prompt instead of the one click install. On my computer, e: was the hard drive. There seems to be 3-4 drives, c:, d:, e:, x:, perhaps even more. You’ll have to search.