Thursday, 28 June 2012

Failed to write file data on cluster disk 0 partition 1, failure reason: The disk structure is corrupted and unreadable


While configuring a Failover Cluster on Windows Server 2008 R2, i encountered this error:


Failed to write file data on cluster disk 0 partition 1, failure reason: The disk structure is corrupted and unreadable.


The shared storage for the cluster is an iSCSI SAN, and the servers to participate in the cluster could all see the shared disks.


After much attempt to fix this error,  these are the things i did. I suggest you check out for either or all of them as applicable in your situation.
  1. In my case, i had to grant read/write permissions to the luns(shared drives). I did this because when tried creating a test text file in the drives, i got an access denied error. So i figured there was no way the cluster validation tool would be able to write to the disks. I simply gave everyone modify permission.
  2. The account i was using initially was a local administrator, and since i still had a lot of configuration to do on the servers, i had to get a higher privileged account(a domain admin).
  3. I traced the particular disk 0 ( you can get this from the report) and did a format and chkdsk.
  4. I then also reformatted the other disks.
When i ran the Cluster Validation test again, it passed and the annoying error was gone.

I hope this helps someone.

Friday, 8 June 2012

Create SharePoint Sites with PowerShell

I had a request to provision ("fancy word for create") about 30 SharePoint sites today. And the lazy me went like "WTH", so i thought this is a good candidate for scripting(automation).

Here is what i did. I got an email with a list of the site names. something like this:

Site 1
Site 2
Site 3
Site 4 ....

So i quickly copied this into a text file, and imported it into an Excel sheet (am sure you can do that)

I then made a little bit of adjustment, and i ended up with something this.


Then i saved this as a csv file named sites.csv.

After that i opened my favourite text editor, and put this together.


$parentSiteUrl = "http://sharepointportal/"
$siteList = import-csv "sites.csv"
foreach ($site in $sitelist)
 {
  $siteUrl = $parentSiteUrl + $site.url
  $siteName = $site.sitename
  New-SPWeb –url $siteUrl -name $siteName -template STS#0 –AddToTopNav –UniquePermissions
 }


Then i saved the script above as createsite.ps1.  After that, i copied both files(createsite.ps1 & sites.csv) to the root drive C:\ of my sharepoint server.

I then opened the SharePoint 2010 Management Shell( as administrator) - shown below.


When the shell opened, I ran my script as shown below, and in a jiffy all the sites were created. Pretty Cool uhm.









Thursday, 7 June 2012

Resolve SharePoint 2010 RSS Feed Error

If you try adding the RSS Feed webpart to your SharePoint page and you keep getting an error. It is possible that your SharePoint server is configured to use a proxy. In this case, even though you might be able to open the rss url in a web browser, SharePoint would still be unable to load your rss feeds from the url.


Here is what you do. Open the the web.config file of the your SharePoint web application (typically in c:\inetpub\wwwroot\wss\VirtualDirectory\...)


Then do a find for "defaultProxy", and add this line.

  <proxy usesystemdefault = "false" proxyaddress="http://proxyservername" bypassonlocal="true" />


Your proxyaddress can either be the FQDN or the ip address of your proxy sever. You should also add a port if required, so you might have something like this.


<system.net>
      <defaultProxy>
       
  <proxy usesystemdefault = "false" proxyaddress="http://192.168.100.1:8080" bypassonlocal="true" />
      </defaultProxy>
   </system.net>