Friday, February 26, 2010

Windows 7 - Finding Missing Harddisk

Recently I bought a bunch of computer hardware and assembled a new system and installed Windows 7 on it. However, upon running the system I realized that one of the two 1TB harddrives was not being listed on the Windows File Explorer. The File Explorer would only list one of the hard drives. This hard drive had two partitions, one for the operating system and the other for files. I thought this was odd as I had installed Windows Vista on the very same machine the day before and there I could access both hard drives.

I had a quick google search and found loads of pages but none of them provided a solution. Actually, I was more concerned with setting up the system and transfering all my files, so left this problem to be solved another day.

How to get Windows 7 to list your HD

Today I was playing with the computer trying to create a scheduled task, which involved me going to the Computer Management console.

After creating the task I continued to play with Computer Management console. To be more precise with the Disk Management. The Disk Management lists all disks and CD/DVD drives on the computer, and here I was able to see both my disk drives. Disk 0 was greyed out, but when I right-clicked it I was presented with a meny and there I could make a selection that caused the disk to be shown on File Explorer as the G: drive. Unfortunately, I did not note down what item I selected, and now the context menu has changed.

Hopefully people reading this article will be able to solve any problem they might be having.
Feel free to link to this post or write a comment if it has solved your problem. This way other people are more likely to find it :) 

Wednesday, February 17, 2010

Installing SQL Server 2008 on Windows 7 - Restart Computer Failed.

I have just bought a new PC and I am trying to install SQL Server 2008 Developer on it. The computer is running Windows 7 enterprise 64bit. However, I keep getting an error message on the Setup Support Rules check list. It always fails at the same point Restart Computer. I will try to post the solution here once I find it.
Solution update (19/02/10): Go to the bottom of article.

Running the installation process.

On the installation center I choose New SQL Server and stand-alone installation or add features to an existing installation which is found under Installation. Once the program starts running I get the following error message.
---------------------------------

This program has known compatibility issues


Check online to see if solutions are available from the Microsoft website. If solutions are found, Windows will automatically display a website that list the steps you can take.

Program: Microsoft SQL Server 2009
Publisher: Microsoft
Location: F:\setup.exe

After SQL Server Setup completes, you must apply SQL Server 2008 Service Pack (SP1) or a later service pack before you run SQL Server 2008 on this version of Windows.

[check for online solutions] [run program] [cancel]
---------------------------------

I click [check for online solutions] and get the following window:
---------------------------------

Solve a problem with SQL Server 2008

Your version of SQL Server 2008 isn't compatible with this version of Windows.
An update is available that solves this problem.

Click to download the update from the Microsoft Corporation website
(Link: http://support.microsoft.com/default.aspx/kb/968382)
---------------------------------

The link takes me to the SQL Server 2008 Service Pack (SP1) download page, and I down load the appropriate service pack and try to install it (SQLServer2008SP1-KB968369-x64-ENU.exe).

At the very start of the installation the installation process runs a series of check and it fails at the restart computer check point. Upon viewing the detailed report I get the following table. I find it odd as I have restarted the computer serveral times without it solving the problem.

When I try to repeat the SQL Server installation process  and click [run program] instead of [check for online solutions] I get the same error message Restart computer as with the SP1 installation error.

Microsoft SQL Server 2008 Setup - System Configuration Check Report


Computer Name(s): PR-PC
Report Date/Time: 17.02.2010 11:59
Saved to Directory: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100217_115932\SystemConfigurationCheck_Report.htm
Rule Name Rule Description Result Message/Corrective Action

PatchGlobalRules:
SQL Server 2008 Setup configuration checks for rules group 'PatchGlobalRules'



RebootRequiredCheck Checks if a pending computer restart is required. A pending restart can cause Setup to fail. Failed A computer restart is required. You must restart this computer before installing SQL Server.

AclPermissionsFacet Checks if the SQL Server registry keys are consistent. Passed SQL Server registry keys are consistent and can support SQL Server installation or upgrade.



Cluster_IsLocalNodeGroupOwner Checks if the local computer is an owner of an online cluster group for a failover cluster instance that contains the SQL Server service, Analysis Services service or a generic service. Passed The local computer is not an owner of an online cluster group for a failover cluster instance that contains the SQL Server service, Analysis Services service or a generic service. The SQL Server instances do not need to be taken offline.

Cluster_IsOnlineIfClustered Verifies that the computer is not clustered or that the computer is clustered and the cluster service is online. Passed The computer is either not clustered or the cluster is up and online.

Engine_ResourceDLLUpdateRestartCheck Checks whether shared resource DLLs will be updated, causing restarts for clustered SQL Server instances active on this node. Passed Cluster resource DLLs will not be updated, or there are no other clustered SQL Server instances active on this node.

OsVersionCheck Checks whether the computer meets minimum operating system version requirements. Passed The operating system version meets the minimum requirements for this product.

ThreadHasAdminPrivilegeCheck Checks whether the account running SQL Server Setup has administrator rights on the computer. Passed The account running SQL Server Setup has administator rights on the computer.



WmiServiceStateCheck Checks whether the WMI service is started and running on the computer. Passed The Windows Management Instrumentation (WMI) service is running.
Rules Documentation:
http://go.microsoft.com/fwlink/?LinkId=94001


Community:
http://msdn2.microsoft.com/en-us/sql/aa336317.aspx

Setup Help File:
http://msdn2.microsoft.com/en-us/library/bb500469(SQL.100).aspx

Solution

The way I by-passed this problem as by editing the registry. To be more precise I edited the following registry entry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
You could either rename the entry to PendingFileRenameOperations2 or delete it.

 Feel free to link to this post or write a comment if it has solved your problem. This way other people are more likely to find it :) 


Saturday, February 6, 2010

DNS Host Files

One of the most powerful tools available to somebody working on their site during a migration is their computer’s ‘hosts’ file. This file is especially useful when migrating a site between two servers, or any other time when DNS might not be working properly.

Lets start with an example of the the information that would be found in a typical hosts file:

127.0.0.1 localhost

That is all you will generally see in a clean hosts file. Its layout is tab or space delimited. The first field in the line is the IP address that you would like the site to resolve to, and any additional fields after that should be domain names. For example, if I wanted to reroute example.com to some other location I might put a line in my hosts file that looks something like this:

123.123.123.123 example.com www.example.com

As you can see, this will redirect both example.com and www.example.com to the IP address of 123.123.123.123. When moving a site to a new server, you can use this file to test out your sites to ensure that they work after the move, while still leaving your original site online. Simply point the desired IP address at the domain name in question and you computer will connect to the new IP whenever you type in the domain name.

This file is located in a few different places depending on your operating system. The file name is ‘hosts’ no matter what operating system you have.
Windows

On Windows XP/2003/Vista/7 this file is located in:

%SystemRoot%\system32\drivers\etc\
(Typically C:\Windows\System32\drivers\etc)

With Vista/Windows 7 you will need to edit this file with administrative privileges. You can do this by following one of these two sets of intructions:

1. Click on the Windows logo.
2. Search for ‘notepad’
3. Right click on the notepad launcher and select ‘Run As Administrator’
4. Click File, then Open
5. Browse to the folder mentioned above and select the hosts file

OR

1. Click on the Windows logo.
2. Click on Search.
3. Search for the word “hosts” (Please be advised this search can take several minutes to complete)
4. Double click on the hosts file and choose notepad as the program to open the file once prompted

MacOS

On Mac OS X, your hosts file is located here:

/private/etc/hosts

You will need administrative privileges to edit this file.
Linux

On Linux, you can find the hosts file here:

/etc/hosts

Depending on the distribution you may need administrative privileges to edit this file.
Please remember to revert the hosts file to its original state after the migration is complete.

Feel free to link to this post or write a comment if it has solved your problem. This way other people are more likely to find it :)  

Fighting Spam - SPF - Sender Policy Framework

An SPF (Sender Policy Framework) record is a list of servers that are allowed to send e-mail from your domain. This reduces spam activity that may be perceived to originate from your domain, which is known as source address spoofing.

Backscatter

If you have ever received a sudden influx in bounced e-mail that appears to have originated from one of your domains your first thought might be “Oh no! Something on my server is sending spam!” While this is sometimes the case there is a large chance that what you are seeing is known as “backscatter”; a product of some other server sending spam and using source address spoofing to make the messages appear to originate from your domain.
SPF records are one of several options available for limiting the amount of backscatter you receive. When a server attempts to send spam using your domain name other servers that are receiving the messages may check your domain name to see if it has a SPF record. If a SPF record is present in your domain’s DNS zone file the server will then check to see if the mail originated from a server or IP that is listed in the SPF record. If the mail came from a SPF-listed source then the message is processed normally. If the mail did not originate from a server in the SPF list then the message is instantly rejected per the receiving server’s policies.

Example SPF Record

Example 1: A One-Server Environment
If your server is running both your web site and your e-mail your SPF record can be as simple as:
domain.com. IN TXT "v=spf1 a mx ~all"
So what is this saying? Remember, SPF records are really just a simple list of “approved” sources, servers that are allowed to send e-mail from your domain.
Breaking the SPF record down:
  • domain.com – The domain that the SPF record applies to
  • IN TXT – The DNS zone record type. SPF records are written as TXT record types.
  • v=spf1 – Identifies the TXT record as an SPF record.
  • a – Lists the domain’s primary A record as approved to send e-mail.
  • mx – Lists the domain’s MX record(s) as approved to send e-mail.
  • ~all – Signifies that this list is all inclusive, and no other servers are allowed to send e-mail per the SPF.
Example 2: Adding More Servers
If you use any third-party service or different physical server to handle your domain’s e-mail then you are likely using a modifed MX record to point your e-mail at that other server. Because the other server handles your e-mail, and may be used to send e-mail as well, you will need to list it in your domain’s SPF record.
Remember, an SPF record lists what servers are approved to send e-mail from your domain. If you do not list other sources of e-mail your messages may not be delivered because they came from a source that is not in the list.
A common scenario is when an e-mail user is forced to send all e-mail using their ISP’s SMTP server because their ISP blocks traffic to any other SMTP server. In this case you need to list your ISP’s smtp server as an include statement. A similar example a domain that uses Google Apps to handle all e-mail activity. When using Google Apps it is a good idea to list google.com in your SPF record as an include statement so that all outbound e-mail is delivered successfully.
domain.com. IN TXT "v=spf1 a mx include:google.com ~all"
The include statement tells other servers to include all relevant SMTP and MX information for google.com in your SPF list.
Openspf.org maintains an easy to use SPF wizard that will ask you several questions regarding your domain and will help you setup a complete SPF record including other sources of e-mail. If you have any questions regarding your current setup please contact us anytime using the Support information below.

Adding Your SPF Record

Now that you have your SPF record ready to go it needs to be added to your domain’s existing DNS records. Run a WHOIS command on your domain name and double check the nameservers it is using. If your server is also acting as the nameservers you can add the SPF record to your domain’s DNS using the tools built in your web server control panel.
If your domain’s DNS is being handled by nameservers that you do not have direct access to, such as your domain registrar or Liquid Web’s nameservers, then you will need to contact the responsible party and have them assist you with updating your DNS.

Recommended References:

SPF Records
http://en.wikipedia.org/wiki/Sender_Policy_Framework
http://openspf.org
Backscatter:
http://en.wikipedia.org/wiki/Backscatter_(e-mail)

Feel free to link to this post or write a comment if it has solved your problem. This way other people are more likely to find it :)