Archive for the 'PC stuff' Category

Slim DVD-RW for Dell Latitude C610 laptop

Friday, April 25th, 2008

I’ve got a couple of Dell Latitude C610 laptops with sufficient power in the 1 GHz Pentium III Mobile processor for playing a DivX video full screen. What they are particularily great with is power consumption, running easily for 2.5 to 3 hours on a full charge, and they’ve got room for two batteries each! Obviously, this comes at a cost: the weight.

But one thing drives me bonkers: one came with a 24x CDROM drive, and the other with a flimsy 8x CDRW drive. With the omnipresence of DVDs, these are annoyingly limited for reading and writing optical media.

Option 1: Purchase an external drive. A fair option I actually considered, however it would require a fully functional USB2 or FireWire port. The laptop has only one USB 1.1 port, and the extra CardBus USB2 controller is not very reliable for intensive data transfers.

Option 2: Purchase a DVD-RW drive from Dell. Not only these drives are expensive, but also very difficult to find. Over the years, Dell changed the removable tray format, so there’s no way I could find a brand new DVD-RW drive for the ancient Latitude C600-series laptop model.

Option 3: Purchase a standard slim DVD-RW drive and replace the existing drive in the plastic caddy. I managed to find a Pioneer slim DVD-RW drive for a very reasonable price (30€ give or take) which arrived in the mail today.

It was immediately obvious that the new drive won’t fit. Its front bezel is flat and square, unlike the extruded, rounded-corners bezel of the existing drives. It was also slightly wider, only by one or two millimeters, but enough not to fit through the hole in the caddy. The bezels from the old drives didn’t match the button position, nor did the clips securing them to the drive tray.

I decided that, instead of trimming the excess from the new drive’s plastic bezel, I could file off the caddy to make room for the new drive. This was a fairly easy job and didn’t take more than 10 minutes of carefully filing the plastic, beveling the edges and cleaning everything.

So, here’s the story of modding the Dell Latitude C610 CDROM tray to fit a standard slim DVDROM drive, in pictures.

The original drive in its caddy:

Original drive in tray

Note the rounded corners of the drive bezel:

Rounded corners

New drive on top of the old drive, removed from caddy. See how the original bezel is shorter with two millimeters at the right?

New drive on top of old drive

After using a file to make room for the new bezel, this is what the modded caddy looks compared to the original:

Modded caddy on top, original underneath

Detail on the filed corners - not an extremely pleasant result, but it’s functional:

Rounded corner is gone
Extra space for the full width bezel

Mounting the original connector to the new drive:

Mounting connector on drive

Mounting the new drive into the modded caddy - perfect fit:

New drive mounted in caddy

Caddy fully assembled, ready to be inserted back into the laptop. Miniature screwdriver on top was a must have tool for working with the tiny screws.

Drive assembled

Any suggestions or comments would be greatly appreciated!

Testing dedicated file servers, the sequel

Monday, December 17th, 2007

Man, what a nightmare this project has turned into!

I have never seen so many unexpected restarts and problems. I have gone through all the distributions — FreeNAS, ClarkConnect, OpenFiler — and ended up pulling hair with despair. Nothing worked, and the symptoms made no sense at all.

So, filled with hope for putting an end to this journey, I went back to installing Windows. It worked just fine before, so I should be thankful for having a solution, right?

Wrong. Windows was acting up just like the Linux and BSD distributions did. It installed and ran flawlessly. But if I dared turning it off during a weekend out of town, it wouldn’t start up again. It would reboot at some point before the GUI was initialized, then go in safe mode which didn’t work either, and so on. Can you imagine the frustration built up in so many hours of trial-and-error debugging, without getting anywhere?

At this point I am convinced it’s some hardware flaw. After all, this old Dell has lived a rich, long life; it’s time something gave in. Could be graphics mode, could be the interrupt table, power lines, fishy drivers, the need for a display or keyboard, another swollen capacitor… Frankly, I don’t care anymore. It’s been fun, but you gotta know when to draw the line.

So I’m again left without a file server. But not for long: one thing led to another and I ended up buying the core components of a new PC — motherboard, processor, cooler and memory. The new configuration was meant to be a testbed for a video surveillance system; video capture card is very picky about the hardware it runs on and must be tested first. The test was postponed, so I am now the proud owner of a top-knotch motherboard and low-power processor with a monster passive cooler. It’s so much more powerful than the old system, more versatile, and dead quiet — joy to my ears. Old hardware? That’ll be my file server, after the winter holidays.

Now, the question is, should I go back to square one and try out all those distributions, or just throw in Windows and enjoy the afternoon with the lads at the pub? :)

Testing dedicated file servers

Monday, October 29th, 2007

I have a small network set up at home, and a bunch of files I’d like to share easily without the need to keep my computer on all the time. Clearly, a file server is my solution, but there are 1001 ways to make one.

The obvious choice is to get a Network Attached Storage (NAS) device. Lots of these are popping all over the market. Some are as simple as a hard drive in an external box with an Ethernet connectors, others can create redundancy over several hard drives and even run applications on their own.

Pros: they’re quiet and don’t eat up a lot of electricity.

Cons: oh boy, what a long list. The cheap ones require all computers to install some software, have limits in number of concurrent accesses and use the unreliable FAT instead of NTFS or some other file system. The more expensive ones have a severe problem with performance; RAID is incredibly slow, defining access restrictions is quirky at best, and I could go on for days.

If you want to go in detail about what’s available on the market, SmallNetBuilder.com site has an entire section dedicated to NAS.

So, about a year ago I rescued an old computer from a second hand shop. It’s a pretty decent Dell desktop, with enough juice to run a dedicated file server software, and then some. I maxed out the memory installed on it and added a fat hard drive with plenty of space. Then, I began looking around for software options. I crossed out Windows in a second, as it’s a resource hog and requires constant maintenance. I could install some decent Linux, but I dreaded customizing it for the role I had in mind. And finally, there are some specialized Linux/BSD distributions for file servers that caught my eye, all oriented towards simplicity of use and complete remote management through a friendly browser interface.

First to look at was OpenFiler, considering the reviews. All seemed nice, except it would play really well in a network with Active Directory or LDAP for managing accounts, and I really didn’t feel like tinkering with it to make it run one.

Next was FreeNAS, a BSD spin-off, which survived on this box for a few weeks. It’s weird at configuring drives and shares, and the account authentication is still problematic. Plus, I’m reading lots of posts about people losing data in the event of an upgrade. Not fun.

Now I’m downloading the recently released new version of ClarkConnect. It’s more than what I need, but I can “opt-out” on extra features. But even before I install it, the information available on it warn me that the particular Dell hardware I have may not be supported and may not work. Tut tut.

Worst case scenario, I’ll just get Ubuntu Linux (possibly Server) installed and running for what I need. At least with that one I know that I’ll have open possibilities and loads of help. But, for the sake of keeping resources low, I’ll end up fiddling with this as much as if I kept running Windows, if not more.

Looks like I’m going in circles. What solution would/did make you happy?

I got hacked

Wednesday, October 3rd, 2007

The first e-mail I have sent was sometimes in 1994, so I’ve been very much alive and active online for a whopping 13 years. I’ve got a fleet of e-mail addresses, a long list of forum accounts, and many logins for various online services. 9 years ago I was launching my own tentative of a site, on Tripod. Remember Tripod, Hotbot, Lycos, Netscape and all those buzzwords back then? Gosh I’m old.

One would think it had to happen sooner. Having an account hacked into, I mean. Nope. I think I defy statistics. This must be some sort of a record, to be so prolific online and only have the first intrusion today. And it wasn’t even something important — it was my 10 year old eBay account, which only saw around a dozen transactions over the years. How pathetic is that? Not even my Yahoo! account.

So here I am, talking with eBay customer support about unlocking my account, and unsure whether I should worry or laugh. I have no idea how it happened, since those principles that kept me safe so far have not been crossed. I’m thinking of an exploit on eBay’s site used to spam sellers with ads through the “Ask seller a question” option. This would make more sense than breaking my random consonnants and digits password, always changed less than a month ago. I mean, you’d probably screw up the login even if I spelled out the password to you, twice.

For the peace of mind, I just took a tour on my major accounts and gave them fresh, random passwords. The eBay account lock-out has been addressed within 3 hours. Now I think I’ll celebrate this glitch in a perfect score, the reminder that even with the best protective measures in place, mistakes do happen. It’s only natural, and it had to happen. Issue contained, damage insignificant, moving on.

Have you been hacked? How did you deal with it?

Scheduled automatic hard drive defragmentation for Windows Server 2003

Friday, March 16th, 2007

The problem

Suppose you are the administrator of one or more servers running Windows Server 2003. You probably have a schedule of maintenance tasks you perform on a periodic basis, such as checking system logs, installing software updates, maintaining security policies, cleaning up users’ files and defragmenting the hard drives.

For the last activity, you may have opted for a third party solution such as O&O Software’s Defrag for servers. I love and trust this solution — it’s a powerful and flexible tool specialized on defragmenting drives, making this recurring activity a breeze to manage.

But what if you’re in a corporate environment that, for several reasons, will stick to the Windows built-in defragmenter? Would you spend several hours a week attending to manually defragmenting drives and be happy with it? That’s silly.

Fortunately, unlike the Windows XP counterpart, the defragmenter application in Windows Server 2003 can be started from a batch script, so you can automatize the defragmentation activity. But things get a little more complicated if you have several partitions you want to defragment or if you want to perform more advanced tasks.

The needs

Here’s what I wanted:

  • Defragment all drives and partitions in the system sequentially (one after another).
  • Prevent multiple instances of the defragmenter from running in parallel.
  • Defragment only if there is sufficient free disk space for the defrag to work optimally (minimum 15% of disk space free).
  • Defragment only if the defragmenter recommends it, so it doesn’t run on drives with a 2% fragmentation.
  • Log the activity somewhere — I chose the system log for it, since I’m already checking it at least once a week, but this can be done easily in a text file.
  • Prepare for possible errors and log them.

I studied several scripts for automatic defragmentation on the web and built my own, to match my needs. Credit and thanks goes to everyone else who has attempted this in the past.

The script

' Unattended defragmentation script for Windows Server 2003
' Checks all hard drives and defragments them as necessary
' Create a BAT file with the following command:
'     CSCRIPT AutoDefrag.vbs //B
' Call the BAT file from Scheduled Task, run as Administrator or another user with rights for defragmenting disk
Const EVENT_SUCCESS = 0
Const EVENT_ERROR = 1
Const EVENT_WARNING = 2
Const EVENT_INFORMATION = 4
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objShell = CreateObject("Wscript.Shell")
' Check if another instance of Windows Defrag is already running
Set colProcesses = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = ' Dfrgntfs.exe'")
If colProcesses.Count = 0 Then
	' No other instance found
	' Write information message in the system log
	objShell.LogEvent EVENT_INFORMATION, "Starting unattended disk defragmentation."
	' Find all hard drives
	Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume where DriveType = 3")
	For Each objVolume in colVolumes
		' Analyze drive, check if it is recommended to defragment it
		errResult = objVolume.DefragAnalysis(blnRecommended, objReport)
		' Check if the operation completed without errors
		If errResult = 0 Then
			' Fragmentation check completed without errors
			' Check if there is sufficient free space on disk for defragmentation (minimum 15%)
			If (objReport.FreeSpacePercent < 15 ) Then
				' Drive doesn't have enough free space for an efficient defragmentation
				' Write error message in the system log
				objShell.LogEvent EVENT_WARNING, "Drive " & objVolume.Name & " is almost full and cannot be defragmented! Drive is " & objReport.FreeSpacePercent & "% free."
			Else
				' There is enough free space
				' Is it is recommended to defragment current drive?
				If (blnRecommended) Then
					' Yes, current drive should be defragmented
					' Write information message in the system log
					objShell.LogEvent EVENT_INFORMATION, "Drive " & objVolume.Name & " should be defragmented: " & objReport.TotalPercentFragmentation & "% total fragmentation, " & objReport.FilePercentFragmentation & "% file fragmentation. Drive is " & objReport.FreeSpacePercent & "% free."
					' Begin defragmentation
					errResult = objVolume.Defrag()
					' Check if defragmentation completed without errors
					If errResult = 0 Then
						' No errors, defragmentation is complete
						' Write information message in the system log
						objShell.LogEvent EVENT_SUCCESS, "Drive " & objVolume.Name & " successfully defragmented."
					Else
						' Error encountered
						' Write error message in the system log
						objShell.LogEvent EVENT_SUCCESS, "Drive " & objVolume.Name & " could not be defragmented. Error code: " & errResult & "."
						Err.Clear
					End If
				Else
					' No, current drive doesn't need to be defragmented
					' Write information message in the system log
					objShell.LogEvent EVENT_SUCCESS, "Drive " & objVolume.Name & " does not need to be defragmented: " & objReport.TotalPercentFragmentation & "% total fragmentation, " & objReport.FilePercentFragmentation & "% file fragmentation. Drive is " & objReport.FreeSpacePercent & "% free."
				End If
			End If
		Else
			' Fragmentation check generated an error
			' Write error message in the system log
			objShell.LogEvent EVENT_WARNING, "Drive " & objVolume.Name & " could not be analyzed. Error code: " & errResult & "."
		End If
	Next
	' Finished checking and defragmenting all hard drives in the system
	' Write information message in the system log
	objShell.LogEvent EVENT_INFORMATION, "Unattended disk defragmentation is complete."
Else
	' Another instance of Windows Defrag already running
	' Write error message in the system log
	objShell.LogEvent EVENT_ERROR, "Unattended disk defragmentation is unable to start: another instance of NTFS Defrag is already running."
End If

How to use this?

  1. Copy and paste this text in Notepad, save the text file as autodefrag.vbs in a folder on your Windows Server 2003 machine.
  2. In another Notepad window, enter the command: cscript autodefrag.vbs //B and save it as autodefrag.bat in the same folder with autodefrag.vbs .
  3. Create a new scheduled task that runs autodefrag.bat whenever you want. Make sure you run this under an account with administrative priviledges.

Tips

  • Schedule automatic defragmentation at a time when it doesn’t conflict with other disk-intensive activities, such as file transfers, database backups, file archival, tape backups, other maintenance.
  • Check logs to make sure the defragmentation ended without errors.
  • If a partition is almost full, free up some space and defragment it manually.
  • Check if partitions that were skipped by the automatic defragmenter really do not need to be defragmented.
  • For optimum performance, prepare your drives before automatic defragmentation commences — delete temporary files, archive logs and other files.
  • Augment this script to write details of its actions in a separate log file you can back up or send by e-mail, as needed. On request, I could prepare a version which also uses text files for logs.

If you find this script useful, I’d really like to hear your experiences with it.