Clandestine Development Guides and utilities for sysadmins

Windows Deployment Services

Posted 12. April 2010 22:14 in Support

I've been messing around with Windows Deployment Services (WDS) lately, and it seems like it's a very nice tool. I used to distribute images to our various platforms using the otherwise brilliant Paragon Hard Disk Manager. So far it's been pretty easy to setup a new machine with the desired image, capture it to a USB drive and distribute it manually to other machines of the same model. But what if the hardware changes? What about new drivers? Then it usually gets a bit more messy. And the problems just seem to expand at the same rate the company does.

In comes Windows Deployment Services. It's the successor of Remote Installation Services (RIS), and I never quite became good friends with RIS. Don't know why really. But WDS on the other hand seems to be pretty easy to get going, and if you're only interested in distributing images of Vista, 7, Server 2008 and Server 2008 R2, then there's a lot of benefits. It's pretty darn easy to setup the WDS server. It's pretty darn easy to set up your first blank standard OS images, and it's just as easy to setup driver packages for different kinds of hardware. The unattended installs can still be a bit quirky if you haven't messed around with that bit before, but luckily I found a bunch of articles on the matter, that explains everyting pretty well.

So if you ever want to experiment with WDS yourself, get a hold of a Windows 2008 R2 server with plenty of diskspace, some clients and these tutorials. Good luck.

Augusto Alvarez: Part 1, Part 2 and Part 3.
His focus is mainly on getting the WDS server up and running and deploying a Vista image. But it translates directly to other image types as well.

Midteq: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6 and Part 7.
The focus here is on XP images, HAL independency and WDS on 2003 R2 servers. Also some Sysprep gold here.

Sharepoint George: Part 1, Part 2, Part 3 and Part 4.
WDS, Windows 7 deployment, WAIK, unattended installs and driver injection.

Tsaysoft: MySysprep2
A custom Sysprep utility that might come in handy.

Media is write protected

Posted 12. April 2010 14:23 in Support

I ran into a problem a while back with a testserver. It used Windows 2008 and a cheap Promise RAID controller for it's data drive (4 SATA disks, RAID 5). After rebooting the server, I was suddenly unable to write or modify any files on the data drive, but I was able to read and copy all files to the system drive. I constantly got the error message "media is write protected".

Apparently it's a problem in a SAN policy in Windows, that resets the readonly attribute of the disk. Microsoft states that it is a SAN only problem, but it also seems to apply to SATA drives (or the cheap RAID controller).

To fix this, use DiskPart to clear the readonly attribute on the faulty disk.

Run "DiskPart" from a command prompt. Then type:

  • LIST DISK
  • SELECT DISK <number>
  • If the disk is offline, then type: ONLINE DISK
  • DETAIL DISK (note: ignore the read only attribute here, it's probably wrong).
  • ATTRIBUTE DISK CLEAR READONLY
  • EXIT

    You should now be able to write or modify files on the disk again. The operation won't harm any files on your drive. For more information take a look at the Microsoft knowledgebase article on the problem.

    SQL Server Diskspace Usage

    Posted 12. April 2010 13:57 in Support, Tools

    If you have a SQL server running and need to do some cleanup (or just figure out who's using all of your precious space on the harddrive), then just run this query on the master database.

    It will list the name, size of the db + logfile, compatibility level and recovery model for each database on the server. Compatible with Microsoft SQL Server 2005 and up.

    select
        dbid,
        d.name,
        d.compatibility_level,
        d.recovery_model_desc,
        convert(decimal(18,2),(sum(size)*8)/1024.0) as db_size_in_mb,
        (
            select
                (size*8)/1024.0
            from
                sys.sysaltfiles
            where
                dbid = saf.dbid
                and groupid=0
        ) as log_size_in_mb
    from 
        sys.sysaltfiles saf
        join sys.databases d on saf.dbid=d.database_id
    where 
        groupid > 0
    group by 
        dbid,
        d.name,
        d.compatibility_level,
        d.recovery_model_desc
    order by 
        name