Sunday, December 20, 2009

Remove Raid metadata from drive under linux

Following my previous post, the disk was initiall part of a RAID group using HP Embedded SATA RAID controller, it was removed from the controller and used at another PC.
Since the dmraid -x command doesn' work, I ended up with using the following command to remove the raid metadata (will destroy the old data!)

[root@localhost liveuser]# dd if=/dev/zero bs=1M seek=150000 skip=150000 of=/dev/sdc

(this is a 160G drive so I decide to remove the last 10G's data which will definitely include the raid metadata).

Friday, December 18, 2009

Raid metadata prevent fedora from installing on Sata Drive

I was trying to install fedora12 on my PC but the installation process didnt recognize the sata disk at all...after spend some time searching, it turned out to be the RAID metadata that is causing the issue...

Below are the output:

[root@localhost george]# dmraid -r
/dev/sdc: ddf1, ".ddf1_disks", GROUP, ok, 312237856 sectors, data@ 0

[root@localhost george]# dmraid -x
ERROR: ddf1: wrong # of devices in RAID set "ddf1_System" [1/2] on /dev/sdc

About to delete RAID set ddf1_System

WARNING: The metadata stored on the raidset(s) will not be accessible after deletion
Do you want to continue ? [y/n] :y
ERROR: Raid set deletion is not supported in "ddf1" format
[root@localhost george]#

still trying to figure out how to remove the raid metadata without putting back the drive to RAID controller (it is on another computer, the HP ML110 server I mentioned in my previous post)

Tuesday, December 15, 2009

Extend SharePoint Databases

search DBs:
http://www.mssqltips.com/tip.asp?tip=1794

For Content DBs:
http://www.mssqltips.com/tip.asp?tip=1777

moving tables between filegroups:
http://decipherinfosys.wordpress.com/2007/08/14/moving-tables-to-a-different-filegroup-in-sql-2005/

search objects inside filegroup(By John@sqlservercentral):


SELECT o.name AS TableOrIndex
FROM sysfiles f
JOIN dbo.sysfilegroups s
ON f.groupid = s.groupid
JOIN dbo.sysindexes i
ON i.groupid = s.groupid
JOIN dbo.sysobjects o
ON i.id = object_id(o.name)
AND i.indid in (0, 1)
WHERE f.name = 'My_Logical_File_Name'

UNION

SELECT i.name
FROM sysindexes i join sysfilegroups f ON i.groupid = f.groupid
JOIN sysfiles l ON f.groupid = l.groupid
WHERE l.name = 'My_Logical_File_Name'

Wednesday, November 18, 2009

create Document Library based on user template

it took me a while to figure out that the Lists.asmx web service doesn't support creating a document library based on user template, the only way to do it is via a customized web service.
the code for web service can be found at http://blogs.msdn.com/sridhara/archive/2008/06/07/getwebtemplate-web-method-does-not-return-addlist-web-method-does-not-recognize-my-custom-list-templates.aspx

In my code, I also need to check whether the docLib already exists which can be done via the standard Lists.asmx web service.

Tuesday, November 10, 2009

AD Distinguished Name and special character

I wrote a script to send out password expiration notifcations a while ago, recently I got told that some users didnt' receive their notification.
After looking into it, I realized that the OU structure got changed recently and some OU name contains special characters, in this case if you use GetObject("LDAP://"& DN) to get user Object, DN has to be encoded for special characters.
In my case, a '/' was causing the issue and has to be replaced with '\2F' (hex).

Disable Microsoft Defender for Cloud for Visual Studio Subscription (MSDN)

I use a visual studio pro subscription which comes with $150 azure cloud credit, for some reason Microsoft Defender for Cloud was turned on ...