How to enable AHCI/RAID mode in Windows 7 without reinstalling
I recently got a wild hair up my ass to add a RAID to my desktop. My desktop is a Gateway FX6840-23 and it came with a 1TB drive. I bought an identical drive and thought that I'd put then in RAID 0 for the increased performance, seeing as my Experience Index was only 5.9 due to a slow HDD (all other indexes were in the mid-7's, and the drive is a 7200 RPM unit).
Digging around the BIOS I saw that the SATA controller was using AHCI mode. I cloned my current drive to another 1TB drive I had (yeah, I have 3 -1TB drives, a 500GB, and a 1.5 TB), rebooting into the BIOS and changed it to RAID. After a reboot, I hit ctrl-I and entered the RAID utility. I built the RAID and rebooted. Well, to put it nicely, I got a BSOD. I tried various things for the next 3 hours, including using Windows 7's extended partition utility, doing a complete restore to factory on the extended partition, and everything. After I did the restore, I saw that the HDD performance hadn't changed.
Well, I haven't messed with RAID before on a desktop, so this was a learning experience. After some Google searches, I put the computer back in AHCI mode and booted to the clone. This worked just fine. I went to Gateway's website and downloaded the RAID drivers.
I noticed that the driver was named iaStorV.sys, so I did a search for it and found it already installed in the Windows\System32\Drivers folder. I did a registry search for it and found it in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\iaStorV. This made me happy!
Some more Googling later and I figured out that if I changed the REG_DWORD from 3 to 0 that it would enable things to work. I rebooted the computer, went back into the BIOS and changed the SATA controller to use RAID, pointed it to boot from the clone, and it booted right up! No BSOD, no hiccups, no nothing!
This should work going from IDE mode as well. I tried to clone the clone to the RAID, but Acronis didn't like that too much, so I'm doing a full backup of the clone (I needed to do it anyway) and I'm going to try to restore it with the Acronis Resuce media. It's already midnight, and this is one of those things that I'm not going to be able to put down until I'm done with it. Oh well, I guess it's time to get back to work! Good luck getting your stuff working!
My pain is your gain: Installing Windows after Ubuntu and the joy of GRUB2
Do yourself a favor and never do this if you have other things on your mind. The information is sparse and not very well written, so I'm going to fix that right now. Today I had to install Windows XP on my wife's laptop because some company that makes software that she needs decided that it would be too easy to allow people to use virtual machines to run their software. When I installed Ubuntu on the machine a few months back, I left a 30GB partition at /dev/sda1 to put Windows on there at a later date should she need it. Well, she needed it and I installed it. Once installed, I needed to get GRUB back. If you haven't done this with GRUB2, consider yourself lucky. Here's the easiest way to do it.
- Boot to the LiveCD Desktop (Ubuntu 9.10 or later).
- Open a terminal by selecting Applications, Accessories, Terminal from the menu bar.
- Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L".
-
sudo fdisk -l
If the user isn't sure of the partition, look for one of the appropriate size or formatting.Running sudo blkid may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently.
-
- Mount the partition containing the Ubuntu installation.
sudo mount /dev/sd''xY'' /mnt
Example: sudo mount /dev/sda1 Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot
- Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.
sudo grub-install --root-directory=/mnt/ /dev/sdX
Example: sudo grub-install --root-directory=/mnt/ /dev/sda
- Reboot
- Refresh the GRUB 2 menu with sudo update-grub
That doesn't look that difficult, does it? Yeah, well, it was a pain in the ass to get to that point. If you notice, I highlighted the example for #5. If you do what I did and try to sudo grub-install --root-directory=/mnt/ /dev/sda1, then you're going to end up getting something that looks like this:
grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea.
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged.
You don't want this. You're going to try to force it and you're going to fuck something up. Make damn sure you do it right. Let's look at my particular situation.
My setup looks like this:
/dev/sda1 is NTFS
/dev/sda2 is ext4
/dev/sda3 is swap
I would have to enter the following commands:
sudo mount /dev/sda2 /mnt sudo grub-install --root-directory=/mnt/ /dev/sda
After knocking that out, it should tell you that it's been successful and all you now need to do is reboot! It took me 5 different times to get this damn thing back. I ended up bombing out the Windows MBR by installing GRUB on it, which made me have to do a fixboot/fixmbr from the windows recovery console and start all over again. Once I was back to square 1, following the commands above got me done in 5 minutes.
I hope this helps you!
-Greg


Uploading multiple vCards to Google Contacts
As you can see from my last post, I've been messing around with my contacts list as of late. I'm trying to get as much info on these people as possible. Stuff like their birthdays and anniversaries, mailing addresses, emails, phone numbers, etc. While I'm putting all of this together, I'm also adding pictures for everyone on their vCard; a head shot for friends and the company logo for business contacts. Since I'm using Outlook 2007 as my main mail program, it's pretty easy to get all of this stuff in one place. The only problem I was running across was, like I said in the last post, Google was screwing with my contacts list. First off, you can only import 2 types of files to Google; a vCard file and a CSV. You can't upload a .pst file which would contain all of my contacts' pictures. The CSV file does move all the info I want except the pictures, and the vCard file moves everything, but you have to do it one at a time... or do you?
For those of you that don't know what I'm talking about, this is what a Business card vCard looks like in Outlook if I were to email it to you. It's a .vcf file and contains all kinds of rich information on the back end. There's a link under the picture for you to download a full vCard for the president. There's also tons of other formats out there to store your contacts; everything from simple text files all the way to QR codes. If you have an app on your phone that does 3D barcodes, snap a pic of that one and you'll get the same info that's in the vCard.
Now, back to what I was originally talking about. Seeing as I want all that rich information in my contacts and I want to import them into Google, I need to use a vCard. I don't want to have to upload 239 individual files, so this is what I'm going to do.
- Go to your contacts in Outlook and highlight them all (ctrl-A). Right click and "Send Full Contact" then "In Internet Format (vCard)". Depending on how many contacts you have, you may have to split them up into groups. I did...
- An email should pop up with a bunch of attachments. Send that email to yourself.
- From the email you just sent to yourself, highlight all the attachments, right-click, save as. Save them somewhere easy to access.
- Open up a command line. (Windows Key + R, then type "cmd" and press OK)
- Navigate to the folder where you saved the contacts. I saved them in C:\contacts, so we'll use that.
- The command to type from the directory you have saved your contacts is:
copy /B *.vcf all_contacts.vcf - This will create a file in that directory called "all_contacts.vcf". In that file will be the vCards of all of your contacts.
- Now you just go to Google.com/contacts, click "Import" on the right side of the page, and upload that file!
It's pretty easy when you think about it. I don't know of any way to do this from the GUI, so you're going to have to use the command line. Once you have everything uploaded to Google Contacts, you should be set. All you pictures and information should have been transferred and now you have a full backup of your contacts list should your computer crash! I also use the same contacts list on my Windows Mobile phone, so I have multiple backups of my contacts list. I'll never have to run around trying to rebuild it after losing my phone again!!!
-Greg
A message about security
When I originally started this blog, it was entitled "Adventures in Networking" and it dealt primarily with networking and, more specific, Cisco network security. Since that time I've written about everything from hurricanes to hacking an Western Digital NAS device and giving a $50 Linksys router the power of a $500 Cisco box. Lately, I've been posting how-to's for all kinds of stuff and it's time to take a step back and talk about security for a little bit.
A web hosting client of mine got his site hacked in the past couple of days. About a year ago, I installed phpBB3 for him and setup his domain on my server. After that, I acted as admin on the forums and stuff like that. Well, phpBB3 got neglected and hadn't been updated in a while. It was running version 3.0.6 while the latest version was 3.0.7-PL1. 4 versions have been released since the last update. When the site got exploited, he looked at me like it was my fault. In fact, he told me something along the lines of "I paid you to build a site that was secure and you didn't do that". Well, I did build him a secure site a year ago, but in the past year, there has been enough holes found in phpBB3 to kill a horse.
I'm sure that any freelancer or businessman out there has had to deal with clients that don't understand what it is exactly you do. This happens a lot to me due to the range of things that I do. But in this instance, the client was under the illusion that I was going to maintain the website and keep it up to date for him. The original invoice that I sent for the site was simply 8 hours of work to get everything installed and setup properly and for a year of hosting. Since that first invoice, I have fixed little errors here and there for him without invoicing him because it's little things that only take a few minutes to take care of. Plus, the guy is a real good friend of mine and has been my friend since before we started doing business together. I do freebies for a lot of my customers from time to time. Maybe I messed up by doing these repairs and not charging him for them and by doing that I lead him to believe that I was doing it all for free.
I logged into the site this morning to notice that it had been defaced. Some hacker managed to get in and screw around with the AdminCP. Language packs were messed with, 300+ accounts were created and a bunch of spam had been posted. I went ahead and fixed everything that happened and went through the process of upgrading phpBB3 to the latest version. It took me about 2½ hours to get it all cleaned up and upgraded. Once I was done, I submitted a service ticket for the work. Here's another place I screwed up. I should have asked him if he wanted me fix it first because we don't have a service agreement between the two companies.
Well, the site got upgraded to the latest version of phpBB3 and it was working fine.... for about 3 hours. That's when our little hacker managed to get back in and lock me out completely. My best guess is that there's a zero-day exploit on phpBB 3.0.7-PL1 that will also work on all previous versions. In that instance, there's not a whole lot I can do about it other than block the proxies that he's used to get to the site with or just shut the site down. Well, I shut it down.
Here's where the main problem starts. The customer assumed that it was my responsibility to update the software for him. I don't go to HP and bitch at them because there's holes in Windows. Once I install the software, it's up to the client to keep that software up to date. All of my other web clients know this and they keep their CMS software up to date. If we would have set up a service contract in which I said I would maintain the security of his site, then it's no problem. It's my responsibility to fix the security issues that come up, but there's no agreement there.
Also, the client wants 100% security. We all know that 100% security does not exist and never will exist. He didn't like the fact that I used open-source software for the site because people can read the source code. Well, the open-source stuff is free, so that's why it was used. But even closed-source software has security holes in it.
To wrap up this rant, I wish people could understand that the only secure computer is one that's powered down and unplugged from the internet. A friend once told me that if you installed a fresh copy of Windows XP (no service packs) on a computer and plugged it directly into the internet, it would be rooted within 12 seconds. 12 seconds! There is no security, only the illusion of it.
-Greg
Install MagicJack VoIP on Server 2003
I've been going without a land line for a few years now and it's starting to get old. Because of the plan that my wife and I are on with Sprint, it gets rather expensive when I start going over my minutes. And I sure as hell didn't want to fork out the kind of money that the phone and cable companies charge. I'm a Cisco Engineer for Christ's Sake! I should be able to set this up!
So I got my hands on the Cisco uBR924 you see in the rack. It uses H.323, but I couldn't find a reliable H.323 provider to give me a number. And I'm lazy. I'm sure I'll get around to using the H.323 in the modem sooner or later, but I wanted to try this product out anyway. I ended up ordering a MagicJack.
Well, MagicJack doesn't support Server 2003. But the only box that I have that stays on 24/7 is my server. And my server runs... you guessed it... Server 2003. My install went a little like this.
1. Plug the MagicJack into a USB port and let the drivers install.
2. Once the install runs, go to "My Computer" and run the Autorun on the MagicJack drive
3. Let MagicJack install (it downloads its software)
4. Get the message "No audio devices found no output/input devices are found".
5. Curse loudly at computer and say something along the lines of "Oh, you are GOING to work..."
Because I'm an idiot and didn't realize what I was doing, it was flat NOT going to work. The reason being is the only sound driver running was the Microsoft RDP Sound Driver. My server is headless, therefore I needed to be RDP'd into the box. I'm going to go ahead and make a long story short...
I plugged a keyboard into the box and logged in locally. I tried to "mstsc /v:server /console", but it still had the RDP driver. I haven't looked into it, but there may be someway to use the local drivers during that console session. Once I was logged in locally, I shadowed the local session from an RDP session. I turned on the Telephony Service, installed the sound drivers (they weren't installed), and started the Windows Audio service. Once that was done I restarted the MagicJack software and BAM! It worked.
***EDIT***
I just found out why the "/console" wasn't working when I was RDPing into the box. It seems that Microsoft changed /console to /admin in Vista for you to login to session 0. Here's the correct way to do it. In XP SP2, you want to run "
In Windows XP SP3, Windows Vista or Windows 7, run %systemroot%\system32\mstsc.exe /admin
If you are using Windows XP < SP3 the command is:%systemroot%\system32\mstsc.exe /console
Once you get the client up, you want to make sure that under the "Local Resources" tab you have the audio options set to "Leave at remote computer". This should fix that damn "No audio devices found no output/input devices are found" problem without having to plug a monitor and all into your server.
From what I've seen so far using WireShark, this is a simple SIP device that runs the G.711 Codec. Pretty straight forward. I'll mess with it some more and get back to you guys.

