Friday 5 February 2010

Windows 7 and Samba

Just came across this post. I’ve had trouble connecting Windows 7 to a samba share/printer. For my second desktop (who says men can’t multitask eh?) also running Windows 7 , adjusting the security policies worked OK. However, for my main 64bit Windows 7 Pro machine I also had to add (and change) the registry keys as described in the post.

Dell IN2010N monitor with Ubuntu 9.10

Wow, this took me a couple of hours to figure out, so I thought I better share this with the world. I have a Dell IN2010N 1600x900 widescreen monitor and my desktop's running Ubuntu 9.10 with an ATI Radeon HD 5450 graphics card. Originally I could not get the correct screen resolution as Ubuntu wouldn't even recognize my monitor. Trying to use Ubuntu's automatic restricted hardware drivers system didn't get me any further either. Finally, after trying various hacks including using xrandr and trying to force a custom xorg.conf file, I found the answer.
First off I downloaded a graphics driver via this AMD site. In my case I specified the OS as Linux x86_64, the product family as Radeon and the product as ATI Radeon HD 5700 Series. I figured it's best to go with the 5xxx series than the 4800 one, because my correct model (i.e. HD 5450) wasn't listed. After downloading the automatic installation script I first made it executable by typing

chmod +x ati-driver-installer-10-1-x86.x86_64.run

Note: Obviously you need to cd into the directory where you downloaded the file first.

After that I ran it by typing

sudo sh ./ati-driver-installer-10-1-x86.x86_64.run

and decided to use the "Automatic" installation option. Once everything completed successfully I rebooted my machine. Straight away the monitor seemed to be working with the correct resolution settings. A quick glance in the ATI Catalyst Control Center (found via System->Preferences->ATI Catalyst Control Center) confirmed all was fine. The make and model of my monitor (including its recommended screen resolution) had been correctly recognized. My excitment was somewhat damped though by a mysterious AMD watermark in the bottom right hand corner of the monitor. It seemd to suggest that somehow my monitor was unsupported hardware. "How is it!??" I shouted at my computer, "It clearly isn't, since everything's working fine and my monitor is now recognized!!". However no matter how much I tried to argue with my machine, the watermark remained. In the end I decided to do some more googling, which is when I came across this life-saving post. I was already so fed up that I didn't really care to understand what exactly the little piece of code in that post did, and I decided to give it a shot regardless. I created a file

test.sh

and pasted the following content in it.

#!/bin/sh
DRIVER=/usr/lib/xorg/modules/drivers/fglrx_drv.so
for x in $(objdump -d $DRIVERawk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
done

Next I made the file executable by running chmod

chmod +x test.sh

and executed it as super user

sudo sh ./test.sh

Since nothing exiting seemed to happen after the script had completed I decided to reboot. To my relief the damn watermark was gone and I could get on with more pleasurable things in life such as writing this blog.

Useful resources related to this post:

AMD Graphics Drivers & Software download page

Ubuntu X/Config/Resolution resource page

Lifesaving hack to suppress the AMD watermark

Thursday 4 February 2010

Factory Restore for a Dell Inspiron 560

Here is my experience in trying to do a factory restore on a Dell Inspirion 560. First off, here's what my setup was.

The computer came shipped with Windows 7 professional. After creating a user account etc., I installed Ubuntu 9.10 so I could dual boot Windows and Ubuntu. I had 4 partitions; a boot loader, Recovery, Windows 7, Ubuntu.

After running Windows for a while in the above configuration I noticed that it crashed quite frequently, automatically rebooting the computer. I got so annoyed that I decided to do a clean install with the OS CD that shipped with my Dell. After this install I couldn't get Windows back to its original configuration. For starters, the display settings for my monitor were wrong and no matter what driver I installed (both from the drivers, monitor drivers and dell website), I couldn't get the correct resolution. Furthermore, the RocketDock like toolbar was gone and nowhere to be found again. In the end I got so frustrated that I decided to do a factory restore.

After much googling, I finally established that the only way to do the restore was to use a tool called "imagex", since neither the F8 option described in Dell's handbook, nor Ctrl+F11 during startup worked for me.

First I downloaded Windows AIK for Windows 7 from here and installed it. Next I restarted the computer and kept pressing F8 to get the Windows boot options. The first was

Repair Computer

Selecting this leads you to a basic log in (after you've specified your keyboard layout) and a screen of various System Recovery Options. I used

Command Prompt

The next problem was trying to locate Dell's factory image. By default, the command prompt was in

X:\windows\system32

Which led me to the next problem. How the heck could I get a list of drive letters? Some more googling revealed the following useful command

wmic logicaldisk get caption,volumename

The source of this useful information can be found here. Anyway, this revealed that my recovery partition was infact under C:and my Windows system was under D:, while X: was the boot partition. So I typed ([Enter] just means hit Enter on your keyboard)

C: [Enter]
cd dell [Enter]
cd Image [Enter]

Now in order to see the contents of this folder I typed

dir /a [Enter]

By the way, the above command also works if you want to inspect everything that's in this hidden partition.

Looking at this image directory there were two files

FACTORY.WIM and FACTORY2.WIM

So far so good. Next I entered this command and hit Enter

"D:\Program Files\Windows AIK\Tools\amd64\imagex.exe" /apply FACTORY.WIM 1 D:\ /ref FACTORY2.WIM

Note 1: If you only have one wim file (as determined by dir /a), then you don't need to add

/ref FACTORY2.WIM

Note 2: "D:\Program Files\Windows AIK\" may be different on your system. For starters, your windows could be under a different drive letter, e.g. E:. Second, you may have installed Windows AIK under "Program Files (x86)".
The "Tools" directory also contains "ia64" and "x86" directories. If imagex.exe under "amd64" does not work for you, you may try any of the ones under those directories. You will get an error message if you're trying to use the wrong one.

Note 3: Some people suggested copying the "amd64" or "ia64" or "x86" folders to a USB stick and running it from there, so that the command would look like something like (assuming F: is the driver letter of your USB stick)

"F:\amd64\imagex.exe" /apply FACTORY.WIM 1 D:\ /ref FACTORY2.WIM

I didn't bother copying the files to a USB stick first and it all went fine.

Back to the restore. After six odd minutes or so the restore process reported that the image had successfully been applied. Hurray!! Before reaching for the bubbly to celebrate, I first checked that everything had indeed worked as intended. I typed

exit [Enter]

to exit the command prompt and hit the "Restart" button under the System Recovery Options, and voilĂ , the computer was successfully restored to its original state!

Here are some resources I found useful during the process:





Note: You might want to format your Windows drive prior to creating the factory restore. When I did the restore without formatting the Windows drive first, I got some weird User folder duplicates. In order to do the factory restore with format you have to boot from you OS CD that came with the computer. To do so:

  • Press F12 during startup when the blue Dell bar appears
  • Select you DVD/CD drive (and hit Enter when it asks if you want to boot from CD or DVD)
  • Click on "Repair System" (bottom left corner of screen)
  • Select the "Use recovery tools that can help fix problems ... " option
  • Select "Command Prompt"
  • Type Format D: (replace D with the letter of your Windows drive)
  • Follow the steps outlined above, i.e. from wmic logicaldisk get caption,volumename onwards. Obviously if you format your Windows drive before the factory restore you must copy the imagex utility (i.e. the folder it's contained in) onto a USB stick and run it from there.