DD-WRT on Buffalo WZR-HP-G300NH (Japanese version, A0 A3)

I’ll be moving to a new house next week, my first move in a decade. To make the switchover as smooth as possible I decided to set up and test the broadband connection and router at the new location ahead of the move, so I’d only have to bring along my PCs and everything should work on the new router that will duplicate the existing setup.

I chose the Buffalo WZR-HP-G300NH because it is supported by DD-WRT, Linux-based open source firmware that I also use on my Buffalo WHR-HP-G54. The new router has 32 MB of flash vs. 4 MB on the old one and 64 MB of RAM vs. 16 on the old one, which will make it much easier to add more features. It also offers 11n with wireless speeds up to 300 Mbps versus up to 54 Mbps on the old router that supports 11b and 11g. One USB-port provides access to mass storage for hosting a website, for audio or video files or for a Samba file server.

Installing DD-WRT was much easier on the Buffalo WZR-HP-G300NH than on its predecessor, as the DD-WRT team offers a special firmware version that can be flashed directly from the firmware upgrade menu of the standard Buffalo firmware. The older router required the use of TFTP for that and the steps involved were more complicated.

Here is what I did:

  • Go to http://dd-wrt.com/site/support/router-database and search for WZR-HP-G300NH. Open the page for this router and download file buffalo_to_ddwrt_webflash-MULTI.bin to the local hard disk.
  • Connect one of the LAN ports of the router via an Ethernet cable to your PC. You can leave the blue WAN port disconnected. Check with ipconfig on Windows or ifconfig on Linux that you receive an IP address like 192.168.11.2. Start your Browser and open http://192.168.11.1/ (enter user name root and leave the password empty).
  • Select the firmware upgrade link on the initial configuration screen or Admin Config / Update in the regular menus. Select local file and browse to the buffalo_to_ddwrt_webflash-MULTI.bin downloaded above. Start the upgrade. This takes about 6 minutes, during which you must not reset or power off the router. When the progress bar reaches 100% and the DIAG LED stops flashing you’re done.
  • Start your browser and open http://192.168.1.1/ — you should see the DD-WRT menus. Assign a new user name and password.
  • Reset the router using the 30/30/30 procedure: Push the reset button at the underside of the router and keep it pushed for a total of 90 seconds. After the first 30 seconds, pull the power cable without releasing reset. After another 30 seconds reconnect power, still holding down reset. After the final 30 seconds release reset. This clears the non-volatile RAM (NVRAM) for a factory reset.
  • Start your browser and again open http://192.168.1.1/ — again assign a new user name and password, which were cleared by the factory reset.

Congratulations! You now have a Buffalo WZR-HP-G300NH running English language open source DD-WRT firmware.

GuruPlug Server and JTAG interface

The GuruPlug Server Plus that I ordered from GlobalScale Technologies in February finally arrived around the middle of May, about two weeks later than anticipated.

These ARM-based Linux computers draw a mere 5-6 Watt of power at idle according to my WattChecker Plus, yet provide as much port connectivity as a regular notebook or desktop PC. It’s a full-featured Linux server, provided your application matches the storage available (or or you add enough storage) and integer performance comparable to a Pentium III 800 MHz is adequate for your purpose.

Here’s the specification of the machine:

  • 1.2 Ghz Marvell Kirkwood ARM CPU
  • 512 MB of DDR2 RAM
  • 512 MB of NAND flash
  • two gigabit Ethernet ports
  • 802.11b/g WLAN
  • Bluetooth
  • two hi-speed USB (480 Mbps) ports
  • eSATA port
  • microSDHC slot
  • Debian GNU/Linux 5.0 (2.6.32 kernel)

Normally the GuruPlug boots Linux off its NAND flash (see log below), but it can be reconfigured to load an image from a microsSD / microSDHC card (4 / 8 / 16 GB) and it can also use USB or eSATA disk drives. To reconfigure the boot loader, one needs to access a serial port via a JTAG interface, one of which came bundled with my order but is also available separately. To access this serial port one needs a terminal program such as PuTTY for Windows, a micro-USB cable and drivers for the USB-connected serial port.

If you look at the GuruPlug from the top there will be two tiny sockets on the right, a narrow one with 4 pins for the serial interface and a wider one for the flash interface. Connect these to the JTAG module. Plug the micro-USB cable into the socket at the opposite end of the JTAG module, but don’t connect it to the PC just yet.

Download the FTDI driver .zip file from here into a folder and extract its contents. Modify the two files FTDIBUS.INF and FTDIPORT.INF as described here. (EDIT): Download the FTDI driver archive file from here and save it in a folder. Extract the archive within the archive and unpack it into a folder.

When you finally connect the JTAG module to the PC via the micro-USB cable, it will start the plug and play device detection for it. Windows will not find a matching driver for the two ports (“SheevaPlug JTAGKey FT2232D B”) and so you’ll need to manually chose the location where it may find the driver and INF files (the ones you extracted and edited as above).

If anything goes wrong with the device installation, you can always delete the unrecognized devices in the device manager of Windows and disconnect and reconnect the USB cable to have another try.

Configure the virtual serial port (COM10 in my case) in device manager for 115200 bps. Download and install PuTTY. Then create a PuTTY profile for a connection to the virtual serial port. When you power-cycle the GuruPlug you should see messages come up. Here is a sample of an uninterrupted boot process:

U-Boot 2009.11-rc1-00602-g28a9c08-dirty (Feb 09 2010 – 18:15:21)
Marvell-Plug2L

SoC: Kirkwood 88F6281_A0
DRAM: 512 MB
NAND: 512 MiB
In: serial
Out: serial
Err: serial
Net: egiga0, egiga1
88E1121 Initialized on egiga0
88E1121 Initialized on egiga1
Hit any key to stop autoboot: 0
*** ERROR: `ipaddr’ not set
ping failed; host 192.168.2.1 is not alive
No link on egiga1
*** ERROR: `ipaddr’ not set
ping failed; host 192.168.2.1 is not alive
(Re)start USB…
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices… 3 USB Device(s) found
scanning bus for storage devices… Device NOT ready
Request Sense returned 02 3A 00
1 Storage Device(s) found

NAND read: device 0 offset 0x100000, size 0x400000
4194304 bytes read: OK
## Booting kernel from Legacy Image at 06400000 …
Image Name: Linux-2.6.32-00007-g56678ec
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2789756 Bytes = 2.7 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum … OK
Loading Kernel Image … OK
OK

Starting kernel …

Uncompressing Linux…………………………………………………..
…………………………………………………………………………..
…………………………….. done, booting the kernel.
Linux version 2.6.32-00007-g56678ec (root@msi-linux-build.marvell.com) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33.fa1)) #1 PREEMPT Mon Feb 8 03:49:55 PST 2010
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell Plug2L Reference Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 256MB 256MB = 512MB total
Memory: 513024KB available (5144K code, 1034K data, 148K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:114
Console: colour dummy device 80×30
Calibrating delay loop… 1192.75 BogoMIPS (lpj=5963776)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Kirkwood: MV88F6281-A1, TCLK=200000000.
Feroceon L2: Cache support initialised.
bio: create slab at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
(start_freq – end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz – 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
(5170000 KHz – 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz – 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz – 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz – 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5735000 KHz – 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
Switching to clocksource orion_clocksource
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 4010, nTxLock = 32080
msgmni has been set to 1002
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
brd: module loaded
loop: module loaded
sata_mv sata_mv.0: version 1.28
sata_mv sata_mv.0: slots 32 ports 1
scsi0 : sata_mv
ata1: SATA max UDMA/133 irq 21
NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung NAND 512MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 1265 at 0x000009e20000
Creating 3 MTD partitions on “orion_nand”:
0x000000000000-0x000000100000 : “u-boot”
0x000000100000-0x000000500000 : “uImage”
0x000000500000-0x000020000000 : “root”
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
ata1: SATA link down (SStatus 0 SControl F300)
UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB handling, reserved 39, need 40
UBI: attached mtd2 to ubi0
UBI: MTD device name: “root”
UBI: MTD device size: 507 MiB
UBI: number of good PEBs: 4055
UBI: number of bad PEBs: 1
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 4055
UBI: number of PEBs reserved for bad PEB handling: 39
UBI: max/mean erase counter: 2/0
UBI: image sequence number: 0
UBI: background thread “ubi_bgt0d” started, PID 454
MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
net eth0: port 0 with MAC address 00:50:43:01:5c:56
net eth1: port 0 with MAC address 00:50:43:01:5c:57
ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver…
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mice: PS/2 mouse device common for all mice
rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
i2c /dev entries driver
cpuidle: using governor ladder
cpuidle: using governor menu
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)
Registered led device: plug2l:red:health
Registered led device: plug2l:green:health
Registered led device: plug2l:red:wmode
Registered led device: plug2l:green:wmode
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mmc0: new high speed SDIO card at address 0001
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
rtc-mv rtc-mv: setting system clock to 2009-08-08 08:10:20 UTC (1249719020)
usb 1-1: new high speed USB device using orion-ehci and address 2
UBIFS: mounted UBI device 0, volume 0, name “rootfs”
UBIFS: file system size: 516225024 bytes (504126 KiB, 492 MiB, 4001 LEBs)
UBIFS: journal size: 9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:13.
Freeing init memory: 148K
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
INIT: version 2.86 booting
usb 1-1.1: new high speed USB device using orion-ehci and address 3
usb 1-1.1: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events…done.
Waiting for /dev to be fully populated…Bluetooth: Core ver 2.15
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas_sdio mmc0:0001:1: firmware: requesting sd8688_helper.bin
libertas: can’t load helper firmware
libertas: failed to load helper firmware
libertas_sdio: probe of mmc0:0001:1 failed with error -2
Bluetooth: vendor=0x2df, device=0x9105, class=255, fn=2
btmrvl_sdio mmc0:0001:2: firmware: requesting sd8688_helper.bin
btmrvl_sdio_download_helper: request_firmware(helper) failed, error code = -2
btmrvl_sdio_download_fw: Failed to download helper!
btmrvl_sdio_probe: Downloading firmware failed!
done.
Setting the system clock.
Activating swap…done.
Setting the system clock.
scsi 1:0:0:0: Direct-Access Generic STORAGE DEVICE 9909 PQ: 0 ANSI: 0
sd 1:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:0: [sda] Attached SCSI removable disk
scsi 1:0:0:1: Direct-Access Generic STORAGE DEVICE 9909 PQ: 0 ANSI: 0
sd 1:0:0:1: Attached scsi generic sg1 type 0
sd 1:0:0:1: [sdb] 7954432 512-byte logical blocks: (4.07 GB/3.79 GiB)
sd 1:0:0:1: [sdb] Write Protect is off
sd 1:0:0:1: [sdb] Assuming drive cache: write through
sd 1:0:0:1: [sdb] Assuming drive cache: write through
sdb: sdb1
sd 1:0:0:1: [sdb] Assuming drive cache: write through
sd 1:0:0:1: [sdb] Attached SCSI removable disk
Cleaning up ifupdown….
Loading kernel modules…done.
Checking file systems…fsck 1.41.3 (12-Oct-2008)
done.
Setting kernel variables (/etc/sysctl.conf)…done.
Mounting local filesystems…done.
Activating swapfile swap…done.
Setting up networking….
Configuring network interfaces…done.
Starting portmap daemon….
Setting console screen modes and fonts.
cannot (un)set powersave mode
Setting up ALSA…done (none loaded).
INIT: Entering runlevel: 2
Starting enhanced syslogd: rsyslogd.
Starting system message bus: dbus.
Starting OpenBSD Secure Shell server: sshdNET: Registered protocol family 10
.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
Starting MTA: exim4.
ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken failed!
Starting Network Interface Plugging Daemon:ADDRCONF(NETDEV_UP): eth0: link is not ready
eth0.
Starting web server: lighttpd.
Starting internet superserver: inetd.
Starting Samba daemons: nmbdeth0: link up, 100 Mb/s, full duplex, flow control disabled
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
smbd.
Starting file alteration monitor: FAM.
Starting Hardware abstraction layer: hald.
Starting periodic command scheduler: crond.
Sat Aug 8 08:08:00 UTC 2009
uap_probe: vendor=0x02DF device=0x9104 class=0 function=1
uap_sdio mmc0:0001:1: firmware: requesting mrvl/helper_sd.bin
uap_sdio mmc0:0001:1: firmware: requesting mrvl/sd8688_ap.bin
UAP FW is active
ADDRCONF(NETDEV_UP): uap0: link is not ready
SSID setting successful
BSS started!
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (8022 buckets, 32088 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
Starting very small DHCP server: udhcpd (v0.9.9-pre) started
udhcpd.
Starting DNS forwarder and DHCP server: dnsmasq.
Starting bluetooth: bluetoothdBluetooth: L2CAP ver 2.14
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
.
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: vendor=0x2df, device=0x9105, class=255, fn=2
Bridge firewalling registered
Bluetooth: SCO (Voice Link) ver 0.6
Bluetooth: SCO socket layer initialized
Agent registered

Debian GNU/Linux 5.0 sheevaplug-debian ttyS0

sheevaplug-debian login:

The initial admin password for user “root” is “nosoup4u”. Change this as soon as you can to something different.

By default the Plug acts as a broadband access point. Join the GuruPlug WLAN from a laptop and you’ll get an IP address in the 192.168.1.100-192.168.1.200 range. You can access a simple website at htpp://192.168.1.100:80 to learn more about the GuruPlug settings.

http://plugcomputer.org/ is a great resource for finding more information about setting up your GuruPlug.

RsyncServer not started because pid file rsyncd.pid exists

I had a scary experience today because one of my Windows PCs “blue screened”, i.e. it crashed. While the “Blue Screen of Death” was fairly common in Windows 95 and 98, it is unusual to see it on any healthy machine running Windows 2000, XP, 2003 or 2008 Server, Vista or Windows 7.

Since the CPU fan of the machine had been running faster than normal recently, I had already suspected it of dust buildup in the CPU heat sink and when I opened up the machine, my suspicion was confirmed. I pulled out some dust and vacuumed the machine before starting it up again.

The machine booted normally and the fan was quiet, but I got alerts from another machine that it could not connect to the Rsync server of the restarted machine. I use an Rsync service for Windows to synchronize data updates between various machines. The service was shown with startup mode “Automatic”, which means it should start whenever Windows is booted, but it was not showing as “Started”. Looking into the log file at “C:\Program Files\ICW\rsyncd.log” I found several of these error messages, one each for every restart I had performed after the crash:

2010/05/08 15:37:45 [2128] rsync: failed to create pid file rsyncd.pid: File exists (17)
2010/05/08 15:37:45 [2128] rsync error: error in file IO (code 11) at clientserver.c(985) [receiver=3.0.6]
2010/05/08 15:52:32 [2120] rsync: failed to create pid file rsyncd.pid: File exists (17)
2010/05/08 15:52:32 [2120] rsync error: error in file IO (code 11) at clientserver.c(985) [receiver=3.0.6]
2010/05/08 16:11:13 [2644] rsync: failed to create pid file rsyncd.pid: File exists (17)
2010/05/08 16:11:13 [2644] rsync error: error in file IO (code 11) at clientserver.c(985) [receiver=3.0.6]

Probably the sudden crash had prevented the Rsync service from deleting its pid (process ID) file, as it normally does when it is shut down orderly.

After I deleted “C:\Program Files\ICW\rsyncd.pid” I was able to start the service and the other machine could connect to it and synchronize with it properly.

Hopefully the machine will keep running reliably again now that the heat sink is clean again. I will keep checking it for dust buildup at least monthly now that the summer months are approaching.

Vir7remover_2009_b2.exe / defend6-pc.com scareware

While researching some information, I came across a Google hit that looked like what I was looking for, but when I opened the page, none of the text in the preview paragraph was there. Somebody must have fed bogus contents to GoogleBot to attract searches.

Instead of the expected information I found myself on a scareware site called defend6-pc.com that was then trying to coerce me into downloading and installing their fake security software. A pop-up dialog asked me whether I wanted to scan my computer with their software. It didn’t matter if I clicked OK or Cancel, a download would always start. Only by closing the browser Window could I get rid of their nasty popup dialogs.

I’m using Mozilla FireFox, which does not offer to run downloaded EXEs directly. I did not click on the downloaded “Vir7remover_2009_b2.exe”, instead I ran it through the VirusTotal.com online malware scanner (highly recommended!) and products by four companies diagnosed it as malicious or suspicious:

  • Microsoft (1.5605) says it’s a “Trojan:Win32/FakeXPA”
  • Sophos (4.52.0) says it’s “Mal/FakeAV-CX”
  • VBA32 (3.12.12.4) says it’s “BScope.Trojan.MTA.0157”
  • Panda (10.0.2.2) calls it a “”Suspicious file”

“Mal/FakeAV-CX” indicates “scareware“, software that pretends to be an anti-virus / malware scanner that scares you with bogus alerts of malware on your harddisk into installing and or purchasing the software. Such software can include Trojans (as you would suspect from “Trojan:Win32/FakeXPA” and “BScope.Trojan.MTA.0157”) that take over your machine and can give someone else full control over your machine for malicious activities.

The following domains are all hosted on the same server as defend6-pc.com (IP address 93.174.95.154) and this list probably is not complete. I definitely would not recommend installing any software from any of these sites:

  • 10scanantispyware.com
  • 20scanantispyware.com
  • 2scanantispyware.com
  • 30scanantispyware.com
  • 3scanantispyware.com
  • 50virus-scanner.com
  • 5scanantispyware.com
  • 60scanantispyware.com
  • 7scanantispyware.com
  • 80scanantispyware.com
  • 8scanantispyware.com
  • 90virus-scanner.com
  • antispy-scan200.com
  • antispy-scan400.com
  • antispy-scan600.com
  • antispy-scan700.com
  • antispy-scan800.com
  • antispywarehelp002.com
  • antispywarehelp004.com
  • antispywarehelp008.com
  • antispywarehelp010.com
  • antispywarehelp022.com
  • antispywarehelpk0.com
  • antispywarehelpk2.com
  • antispywarehelpk4.com
  • antispywarehelpk6.com
  • antispywarehelpk8.com
  • antivirus-inet01.com
  • antivirus-inet31.com
  • antivirus-inet41.com
  • antivirus-inet51.com
  • antivirus-scan200.com
  • antivirus-scan400.com
  • antivirus-scan600.com
  • antivirus-scan700.com
  • antivirus-scan900.com
  • antivirus-test88.com
  • antivirus10scanner.com
  • antivirus900scanner.com
  • av-scanner200.com
  • av-scanner300.com
  • av-scanner400.com
  • av-scanner500.com
  • av-scanner700.com
  • defend-computer10.com
  • defend-computer30.com
  • defend-computer50.com
  • defend-computer70.com
  • defend-computer82.com
  • defend-computer83.com
  • defend-computer84.com
  • defend-computer85.com
  • defend-computer86.com
  • defend-computer88.com
  • defend-computer90.com
  • defend-pc100.com
  • defend-pc130.com
  • defend-pc150.com
  • defend-pc170.com
  • defend2-pc.com
  • defend5-pc.com
  • defend6-pc.com
  • inetproscan001.com
  • inetproscan031.com
  • inetproscan061.com
  • inetproscan081.com
  • inetproscan091.com
  • insight-scan20.com
  • insight-scan40.com
  • insight-scan60.com
  • insight-scan80.com
  • insight-scan90.com
  • insight-scanner2.com
  • insight-scanner5.com
  • insight-scanner7.com
  • insight-scanner8.com
  • insight-scanner9.com
  • internet-scan020.com
  • internet-scan040.com
  • internet-scan050.com
  • internet-scan070.com
  • internet-scan090.com
  • internet-scanner020.com
  • internet-scanner030.com
  • internet-scanner050.com
  • internet-scanner070.com
  • internet-scanner090.com
  • net-02antivirus.com
  • net-04antivirus.com
  • net-05antivirus.com
  • net-07antivirus.com
  • net001antivirus.com
  • net011antivirus.com
  • net021antivirus.com
  • net111antivirus.com
  • net222antivirus.com
  • novirus-scan00.com
  • novirus-scan01.com
  • novirus-scan22.com
  • novirus-scan31.com
  • novirus-scan33.com
  • novirus-scan41.com
  • novirus-scan55.com
  • novirus-scan61.com
  • novirus-scan81.com
  • novirus-scan88.com
  • spyware-stop01.com
  • spyware-stopb1.com
  • spyware-stopm1.com
  • spyware-stopn1.com
  • spyware-stopz1.com
  • spyware200scan.com
  • spyware500scan.com
  • spyware800scan.com
  • spyware880scan.com
  • spywarescan010.com
  • spywarescan013.com
  • spywarescan015.com
  • spywarescan017.com
  • spywarescan018.com
  • stop-all-virus1.com
  • stop-all-virus3.com
  • stop-all-virus6.com
  • stop-all-virus9.com
  • stop-virus-01a.com
  • stop-virus-01b.com
  • stop-virus-01d.com
  • stop-virus-01e.com
  • stop-virus-01f.com
  • stop-virus-03b.com
  • stop-virus-03u.com
  • stop-virus-03y.com
  • stop-virus-03z.com
  • stop-virus-040.com
  • stop-virus-070.com
  • stop-virus-090.com
  • stop-virus-091.com
  • stop-virus-099.com
  • stopvirus-scan11.com
  • stopvirus-scan13.com
  • stopvirus-scan16.com
  • stopvirus-scan18.com
  • stopvirus-scan33.com
  • stopvirus-scan66.com
  • stopvirus-scan88.com
  • stopvirus-scan99.com
  • virus77scanner.com
  • virus88scanner.com

GuruPlug Server Plus, a $129 Linux server based on ARM

GuruPlug Server Plus

Over the years, Intel and its microprocessors have become a household name, recognized by millions of PC users. However, far more people own computers based on ARM processors without ever having heard of that CPU – it’s their mobile phones. More than a billion mobile phones are sold worldwide every year, each one more powerful than an office computer that used to run Windows 95/98 not too long ago. Whatever the brand or model, almost all of them (98%) use at least one CPU based on the ARM architecture. Also, if you own a car navigation system or a broadband router that connects your PC to a DSL or cable modem, it probably uses an ARM chip. Do your kids own a Gameboy Advance, a Nintendo DS, do you listen to music on an iPod? ARM CPUs are common to all of these, as well as the iPhone, the Blackberry and other mobile phones.

From the start, ARM was meant to compete head-on with Intel CPUs in desktop computers, but for many years there really was no direct competition between the two. The issue was mostly software, and as that may change, we’ll increasingly see ARM and Intel compete directly in the same markets. This is bad news for Intel (and AMD) as per-CPU revenue has been far higher in their markets than for makers of ARM chips. As Intel is trying to get a bigger slice of the exploding handheld market with Atom while ARM is taking a bite out of Intel-dominated markets, this gap in pricing is set to erode.

A short history of ARM

ARM has a colourful history. The first ARM chips were developed by Acorn Computers Ltd in Cambridge/UK, who in the early 1980s had successfully launched the 6502-based BBC Micro home/educational computer, an 8-bit machine. I first visited Acorn in the summer of 1984 as a young software engineer working at Digital Research UK. Under an OEM contract I ported Concurrent DOS to a prototype Acorn ABC 310, a 6502-based machine with an 8 MHz 80286 second processor equipped with 1 MB of memory. That 286 machine was one of several projects meant to take Acorn into the more lucrative business market, using a range of 16-bit and 32-bit machines to compete against the likes of the new IBM PC/XT, PC/AT and the 8086-based ACT Apricot that was very successful in the UK. Acorn was well aware of the limitations of the 6502, which was only an 8-bit processor that could not address more than 64 KB of memory. Acorn then decided to replace the 6502 with a simple but efficient 32-bit RISC design, the Acorn RISC Machine (ARM) which came out in 1986.

As it turned out, machines based on ARM never took much market share from the new IBM-compatible PCs that were gradually taking over the desktop market. So instead of building entire computers, or making chips and selling them like Intel does, the developers of ARM decided to license the design to anyone wishing to integrate it into their own custom designs. That’s how ARM became both ubiquitous and nameless. One reason for the lack of success on the desktop was the huge library of software written for MS-DOS and later the various MS Windows versions, which only worked on Intel-compatible CPUs. Despite that, the ARM design eventually became successful beyond anybody’s wildest dreams in mobile and embedded markets where low power usage and low cost were crucial. Mobile phones and other handheld devices and appliances had no need to run desktop applications written for MS Windows. Subsequently, ARM as a hardware platform became so successful that Microsoft ported its Windows CE operating system to ARM (besides x86, MIPS and SuperH as other supported platforms). Even Intel was involved for 8 years with StrongARM and XScale, which it sold to Marvell in 2006.

The marriage of ARM and Open Source

Now it looks like ARM is returning to its roots, with the announcement of ARM-based netbooks and with ARM-based Linux servers. Until recently notebooks and servers were mostly Intel domains, but open source and portable Linux is bridging the gap between Intel and ARM hardware, leveling the playing field for applications. In early 2009 Marvell launched the SheevaPlug, a $99 self-contained ARM and Linux-based mini-server about the size of a notebook power brick. A year later, Globalscale Technologies announced the GuruPlug range of low cost, energy saving computers as the successor to the SheevaPlug; both SheevaPlug and GuruPlug are based on a Marvell chip set, with similar specs and sizes. The GuruPlug is 95mm (L) x 65mm (W) x 48.5 mm (H) and draws under 5 Watts. Its built-in universal power supply handles 100-240V, 50/60Hz for worldwide use with only a plug adapter. The GuruPlug is supposed to start shipping in April and I have two on order 🙂

The most interesting of the three GuruPlug Server models in my opinion is the “Plus” model, which sells for $129, $30 more than the GuruPlug Server “Standard” model or the older SheevaPlug base model. All GuruPlug Server models sport a 1.2 Ghz Marvell Kirkwood ARM CPU, 512 MB of DDR2 RAM, 512 MB of NAND flash, 802.11b/g WLAN and Bluetooth. While the Standard model offers one gigabit Ethernet port and one hi-speed USB (480 Mbps) port, the Plus has two of each and also offers an eSATA port (3 Gbps) plus an external micro-SD slot.

Dual network interfaces make the Plus very suitable as a router (one port for the WAN, one for the LAN). Just add a 4-port hub and you have a direct replacement for a regular broadband router, but with the ability to also hook up USB or eSATA hard disks for Network Attached Storage (NAS) or as a web server or media server, or plug in a USB-printer to be shared over the LAN. Or you could run a VPN, or a mail server, or a spam filter – or all of these combined. Basically anything that works on a Linux server should work in this tiny box, as long as there is enough storage for files on either the internal flash or RAM or the micro-SD or a USB-stick or an external USB or eSATA hard disk.

A third model, the GuruPlug Display for $179 has also been announced, but (as of 2010-02-21) can not be ordered yet. This one will come with 3 USB ports and an HDMI video connector for hooking up an external monitor, so you could use it with a keyboard and mouse (via USB or Bluetooth) for web browsing.

The most robust router I ever used – WHR-HP-G54 (DD-WRT)

It’s been 15 months since I set up a Buffalo WHR-HP-G54 with open source Linux-based DD-WRT firmware as my main broadband router (see “DD-WRT on Buffalo WHR-HP-G54”, 2008-09-06). I’m happy to report that this US$70 router it is the most robust router I have ever used. Its performance has been solid as a rock.

I’ve owned other routers that would occasionally need resetting because of connection problems, or that would spontaneously reboot themselves, but not the WHR-HP-G54. It never misses a beat.

Currently, its uptime count is at 157 days, that is since a family member accidentally pulled its power cord out of the wall socket five months ago. This box will stay up and running forever, no matter how hard you push it. It works better than any other router I’ve owned at any price.

In five months my router has handled a total of 1080 GB (1.08 TB) of data that either came from or went out to the cable modem, or over 6 GB per day (I process a lot of spam data and have 4 hard disks of 1 TB or larger).

On top of all the regular functions of a home / small office router it handles IPv6 tunneling over IPv4 and offers many features. The user interface is straightforward, yet very powerful.

A friend of mine who used to have chronic problems with two different routers, which he uses with about 10 different computers in his home, on my recommendation bought the same model several months ago. He thanked me again today because he hasn’t had any problems since 🙂

Fix Windows as default boot on Ubuntu with Grub2 loader

If you install Ubuntu on a machine that came with Windows pre-installed you have the choice of preserving Windows and chose each time you boot which operating system to run. By default, the boot menu will list the current Linux kernel, followed by any older Linux kernel versions, followed by a memory test and finally the original Windows version. By changing a GRUB boot loader configuration file you can chose which one is the default that gets booted when you just wait and don’t touch the keyboard.

(NOTE: The following instructions assume the Grub2 loader used in Ubuntu 9.10 – earlier versions are different)

For example, the menu might look like this:

Ubuntu, Linux 2.6.31-14-generic
Ubuntu, Linux 2.6.31-14-generic (recovery mode)
memory test (memtest86+)
memory test (memtest86+, serial console 115200)
Windows Vista (loader) (on /dev/sda1)

You can configure Linux to — unless you tell it otherwise — always boot Vista by setting GRUB_DEFAULT in /etc/default/grub to the number of lines above the entry you want to boot (4 in this case), instead of 0 (zero) for the top entry. After any change to /etc/default/grub you need to also run sudo update-grub:

joe@ubuntu910:~$ gksudo gedit /etc/default/grub

GRUB_DEFAULT=4

joe@ubuntu910:~$ sudo update-grub

The problem with that is, when the next kernel update comes out, two lines will be inserted at the top and your default value now selects the wrong entry:

Ubuntu, Linux 2.6.31-15-generic
Ubuntu, Linux 2.6.31-15-generic (recovery mode)
Ubuntu, Linux 2.6.31-14-generic
Ubuntu, Linux 2.6.31-14-generic (recovery mode)
memory test (memtest86+)
memory test (memtest86+, serial console 115200)
Windows Vista (loader) (on /dev/sda1)

You would need to manually select the latest kernel and repeat the above steps with a new value of 6 in this case. This is clearly a problem. Fortunately, there’s a simple workaround: use a name instead of a number for selecting the default. Here is how it works:

1) List the bootable operating systems:

joe@ubuntu910:~$ fgrep menuentry /boot/grub/grub.cfg
menuentry “Ubuntu, Linux 2.6.31-15-generic” {
menuentry “Ubuntu, Linux 2.6.31-15-generic (recovery mode)” {
menuentry “Ubuntu, Linux 2.6.31-14-generic” {
menuentry “Ubuntu, Linux 2.6.31-14-generic (recovery mode)” {
menuentry “Memory test (memtest86+)” {
menuentry “Memory test (memtest86+, serial console 115200)” {
menuentry “Windows Vista (loader) (on /dev/sda1)” {

2) Mark and copy the entry you want to stay bootable, including double quotes, for example "Windows Vista (loader) (on /dev/sda1)".

3) Edit the Grub configuration and paste the new value after the GRUB_DEFAULT= (in place of 0 or 4 or whatever number):

joe@ubuntu910:~$ gksudo gedit /etc/default/grub
GRUB_DEFAULT=”Windows Vista (loader) (on /dev/sda1)”
joe@ubuntu910:~$ sudo update-grub

Note: Make sure to close the gedit window before doing sudo update-grub

That’s it, no more Grub configuration tinkering required! 🙂

NTFS disk corruption on frequent file creates and deletes

I recently upgraded a secondary hard disk in a Windows machine from a Seagate Barracuda 7200.11 1 TB drive to a Western Digital Caviar Green WD15EADS 1.5 TB drive. Mirror imaging the data off the old drive to the new drive using the Linux dd utility from an Ubuntu live CD went very smoothly and completed in a little over three hours, but I subsequently hit a snag when I tried to resize the partition on the larger drive.

The image copy of the 1 TB NTFS partition resulted in a 1 TB partition followed by 500 GB of unallocated space, which I wanted to add to the free space of the NTFS partition. That should be no problem for Linux gparted, but only if the partition to be resized is internally consistent. If it is not, one will have to use CHKDSK /F under Windows to fix it first.

C:\>chkdsk m: /f
CHKDSK is verifying files (stage 1 of 3)...
0 percent complete. (0 of 21942736 file records processed)
Deleted corrupt attribute list entry
with type code 144 in file 2300.
Deleted corrupt attribute list entry
with type code 176 in file 2300.
Deleting corrupt attribute record (144, $I30)
from file record segment 2300.
Deleting corrupt attribute record (176, $I30)
from file record segment 2300.
Deleted corrupt attribute list entry
with type code 144 in file 2332.
Deleted corrupt attribute list entry
with type code 176 in file 2332.
Deleting corrupt attribute record (144, $I30)
from file record segment 2332.
Deleting corrupt attribute record (176, $I30)
from file record segment 2332.
Deleted corrupt attribute list entry
with type code 144 in file 2342.
Deleted corrupt attribute list entry
with type code 176 in file 2342.
Deleting corrupt attribute record (144, $I30)
from file record segment 2342.
Deleting corrupt attribute record (176, $I30)
from file record segment 2342.
21942736 file records processed.
File verification completed.
41475 large file records processed.
0 bad file records processed.
1552 EA records processed.
0 reparse records processed.
CHKDSK is verifying indexes (stage 2 of 3)...
10 percent complete. (4118 of 81648013 index entries processed)
Correcting error in index $I30 for file 2300.
10 percent complete. (5149 of 81648013 index entries processed)
Correcting error in index $I30 for file 2332.
Correcting error in index $I30 for file 2342.
34 percent complete. (23316097 of 81648013 index entries processed)
Correcting a minor error in file 2300.
Correcting a minor error in file 2332.
Correcting a minor error in file 2342.
81648013 index entries processed.
Index verification completed.
CHKDSK is recovering lost files.
997 unindexed files processed.
997 unindexed files processed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
21942736 security descriptors processed.
Security descriptor verification completed.
Inserting data attribute into file 2300.
99 percent complete. (1 of 939015 data files processed)
Inserting data attribute into file 2332.
Inserting data attribute into file 2342.
939015 data files processed.
Correcting errors in the master file table's (MFT) BITMAP attribute.
Correcting errors in the Volume Bitmap.
Windows has made corrections to the file system.

1465135996 KB total disk space.
871385828 KB in 18183533 files.
7651336 KB in 939018 indexes.
0 KB in bad sectors.
22057856 KB in use by the system.
65536 KB occupied by the log file.
564040976 KB available on disk.

4096 bytes in each allocation unit.
366283999 total allocation units on disk.
141010244 allocation units available on disk.

Googling for these error messages, I found a Knowledgebase article by Microsoft about disk corruption on Windows NT that could occur with frequent file creates and deletes (for which they had a fix) and a posting by a Windows XP user who also frequently creates and deletes files.

The three files reported by CHKDSK were three folders on my hard disk. CHKDSK converted them into zero length files. After recognizing this, I deleted these files and recreated the original directories. Since then my application has been working again.

As it so happens, these three directories are three places on my computer where the largest number of files is created and deleted in rapid and random succession (there’s one process each creating them and one process each asynchronously consuming them), just like in the articles that I googled.

If anyone else comes across a similar problem with NTFS with similar symptoms, I would be glad to hear from them.

Update 2009-11-20:
The three corrupted folders that were turned into zero length files by ChkDsk did not actually disappear completely. Instead their contents was moved to a hidden folder tree. Note the above lines:

CHKDSK is recovering lost files.
997 unindexed files processed.

I looked on the hard disk for hidden files or folder from the command prompt:

M:\> dir /ah m:\found.*
 Volume in drive M is wd15
 Volume Serial Number is E861-DD52

 Directory of m:\

2009-11-18  17:39    <DIR>          found.000
               0 File(s)              0 bytes
               1 Dir(s)  576,809,738,240 bytes free

This hidden folder contains the three lost directories:

M:\>dir m:\found.000
 Volume in drive M is wd15
 Volume Serial Number is E861-DD52

 Directory of m:\found.000

2009-11-20  12:06    <DIR>          dir0000.chk
2009-11-18  17:39    <DIR>          dir0001.chk
2009-11-18  17:39    <DIR>          dir0002.chk
               0 File(s)              0 bytes
               3 Dir(s)  576,804,810,752 bytes free

Looking at the contents of each of these folders I could soon tell which was which and move those files back to the original path.

Marvell MC85 with NdisWrapper on Ubuntu 9.10

Last week I updated my Gateway M-6750 from Ubuntu 9.04 to Ubuntu 9.10 (“Karmic Koala”) and managed to get myself into a right mess, as I lost access to both my wired and wireless internet connections. I then burnt an Ubuntu 9.10 live CD from an ISO image dowloaded with uTorrent and reinstalled from there. That got the wired connection working, but the wireless was still gone. Before I fixed that problem I upgraded my notebook hard disk drive, complete with dual-boot Vista and Ubuntu partitions, to a new 500 GB drive (see yesterday’s blog post).

The Marvell MC85 doesn’t have a native Ubuntu driver yet. Therefore you have to use a Windows XP driver for it as described here. You can download the Netgear wn311t_setup_4_1.exe driver set and extract its content on either XP or Wine. You’ll end up with NetMW14x.inf, netmw143.sys and netmw145.sys. Only NetMW14x.inf and netmw145.sys are actually needed.

See my instructions in my earlier blog post for the initial steps (look for a section labeled “Update, 2008-03-18”).

Installing the driver with ndiswrapper does almost everything. The magic ingredient that was missing when I tried to get it working this time was to ensure that ndiswrapper loads every time, before using the Network Manager or when booting up. Without ndiswrapper the Windows driver won’t be loaded and Ubuntu simply won’t see the wireless adapter. It will show up as unclaimed on this command:

lshw -C network

*-network UNCLAIMED
description: Ethernet controller
product: Marvell Technology Group Ltd.
vendor: Marvell Technology Group Ltd.
physical id: 0
bus info: pci@0000:02:00.0
version: 03
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: latency=0
resources: memory:f6000000-f600ffff memory:f4000000-f400ffff
*-network
description: Ethernet interface
product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:06:00.0
logical name: eth0
version: 01
serial: 00:e0:b8:XX:XX:XX
size: 10MB/s
capacity: 100MB/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=0 link=no multicast=yes port=MII speed=10MB/s
resources: irq:28 ioport:4000(size=256) memory:fa200000-fa200fff memory:c0000000-c001ffff(prefetchable)

Ubuntu uses file /etc/modules to enumerate extra drivers and kernel modules that need to be loaded at boot time. Therefore I needed to add a line in /etc/modules using gedit:

gksudo gedit /etc/modules

Add

ndiswrapper

in a line of its own at the bottom of the file and save it, then restart your machine. After the reboot you should be able to use the Network Manager to manage wireless connections, including looking for available networks and configuring security parameters (for WPA, WPA2 / RSN) to be able to connect.

I found many other threads and blog postings that discussed manually editing configuration files and configuring wpa_supplicant, but none of that is required if you just configure Ndiswrapper for NetMW14x.inf, tell NDiswrapper about the device ID and then ensure that Ndiswrapper is always laoded. Here is the lshw output with Ndiswrapper having claimed the wireless adapter:

*-network
description: Wireless interface
product: Marvell Technology Group Ltd.
vendor: Marvell Technology Group Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlan0
version: 03
serial: 00:16:44:XX:XX:XX
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=ndiswrapper+netmw14x driverversion=1.55+NETGEAR,10/04/2006, 2.1.4.3 ip=192.168.42.122 latency=0 link=yes multicast=yes wireless=IEEE 802.11g
resources: irq:16 memory:f6000000-f600ffff memory:f4000000-f400ffff
*-network
description: Ethernet interface
product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:06:00.0
logical name: eth0
version: 01
serial: 00:e0:b8:XX:XX:XX
size: 10MB/s
capacity: 100MB/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=0 link=no multicast=yes port=MII speed=10MB/s
resources: irq:28 ioport:4000(size=256) memory:fa200000-fa200fff memory:c0000000-c001ffff(prefetchable)

Notice the driver=ndiswrapper+netmw14x after configuration:. If you get that you should be in business! 🙂

Backing up / migrating your hard disk data with a Ubuntu live CD

Recently two hard disks died in my household, both of which were Windows boot disks, just as if I needed a reminder how quickly one can lose important data. This and some troubles while upgrading my Gateway M-6750 notebook from Ubuntu 9.04 to Ubuntu 9.10 (“Karmic Koala”) prompted me to get some spare hard disks and do a complete backup / upgrade.

I upgraded my notebook from 250 GB to 500 GB, and I can now keep my old drive as a safe snapshot to go back to if anything should ever go wrong with the new drive.

The most important tools needed for this were an Ubuntu 9.10 live CD from an ISO image (downloaded with uTorrent) and the NewerTech Universal USB 2.0 Adapter, which lets you hook up just about any IDE or SATA drive to a USB-equipped computer.

My notebook has Windows Vista on it, for which Gateway did not ship an install DVD – theres’s only a recovery partition. For installing Ubuntu I had originally shrunk the Vista NTFS partition on the 250 GB drive to make space for a 60 GB Linux partition, which provides a dual-boot feature via the GRUB loader.

I ordered some WD Scorpio Blue 500 GB notebook hard disks (WD5000BEVT) from Amazon and they arrived the next day. These are good work horse drives. I hooked one up to the NewerTech Universal USB 2.0 Adapter and booted into the Ubuntu Live CD.

From there I started a terminal window and used the “dd” command to make an image copy of the drive, see below. Be very careful with the source and destination specification. Use fdisk -l to verify which drive is which and in some cases the USB drive will appear as /dev/sdc instead or /dev/sdb. For IDE (PATA) drives the names could be /dev/hda, /dev/hdb, etc. If you specify the wrong drive as the destination you could wipe out all your data!

sudo dd if=/dev/sda of=/dev/sdb

This will copy every single byte from the first SATA hard disk to the second SATA (or USB 2.0) hard disk on the machine. You won’t have to worry about what partitions there are and which one is bootable, because it will simply copy all of them.

I started it last thing before I went to bed. It took about 2 hours to copy the entire 250 GB of the existing to the existing WD2500BEVS to the new drive. In the morning I shut down Ubuntu, opened the bottom of the case and transplanted the new drive inside, which took a small screw driver and about 10 minutes. Then I fired up the machine again and it successfully booted both Windows Vista and Ubuntu 9.10 off the new drive.

Since the new drive had more space, I wanted to resize the partitions so that each could take 250 GB instead them having to share that space. GNU utility gparted lets you do that. It can shrink, grow and move partitions pretty any way you like. You can tell it the new size of a partition and how much space to leave before and after it.

I first did not know that gparted can move partitions as well as resizing them, so I decided to remove the Ubuntu partitions, grow the NTFS (Windows) partitions and the reinstall Ubuntu into the remaining space. Be careful when removing an Ubuntu partition in a dual-boot system, because the active loaded and its menu file will be in the Ubuntu partition. Thus if you shoot it without first making the Windows partition the active boot partition you won’t be able to boot off that hard disk any more! Either boot of your operating system install CD/DVD or off an operating system recovery partition (if available) and select the command prompt. From there use fixldr /mbr (2000/XP/2003) or bootrec /FixMbr (Vista / 7) to rewrite the Master Boot Record. This will disable the Ubunto bootstrap loader. Make sure Windows will boot without the Ubuntu boot menu coming up. No you can remove the Ubuntu
partitions.

With sudo gparted on the Ubuntu Live CD you can resize the NTFS partition for Windows to any sensible value. In my case I got an error because some NTFS data structures were in an inconsistent state. To fix that I had to boot Windows and run chkdsk /f from a command prompt and then restart. Windows fixed the problem and one restart later I was back in Ubuntu live and gparted was able to resize the partition

After that I installed Ubuntu into the free space that I’d left for it on the 500 GB drive.

Given the low cost of SATA and USB 2.0 drives versus the time and data lost when something goes wrong with your hard disk, I do recommend a full image backup like mine. The dd command also lets you copy drives or partitions to files, so you can back up multiple machines to one large drive.