Diskpart – resizing virtual machine system volumes (windows)

Diskpart works quite well extending disk sizes – …unless its the system disk that you need to extend.

Luckily in the virtual world its somewhat easier to move your disks about. This is a quick list of the steps required to increase your system disk… 

You will need to have another virtual machine available to boot into (windows 2003 etc) 

  1. Shut down the virtual machine with the system disk you wish to extend
  2. Go into virtual machine settings and increase the system drive size to what you require
  3. Now you need your spare w2k3 virtual machine or similar. While it is in a shutdown state add the system disk you wish to extend into this machine as another hard disk. Note: select “existing harddrive” and not the default option of  “new harddrive”, and point to the system drive you wish to extend (It is possible to attach this disk as long it is not on and being used) 
  4. Power up the spare machine with the newly attached hard drive (the drive you wish to extend) 
  5. Logon, open up cmd prompt and type “diskpart” 
  6. Now you need to find and select your disk. Type “list disk” to see available disk numbers (most likely the last drive letter). Then type “select disk #”   (# = the number you got from the list command)
  7. Next select the volume, similar to above type “list volume” then “select volume #
  8. Type “extend”
  9. Type “exit” 
  10. Done – shutdown the machine and disconnect the drive you just extended. Be carefull not to DELETE the drive, you only want to disconnect it. 
  11. Now you should be able to fire up the original machine and it will have a larger system drive. 

There are obviously other 3rd party utilities to do this but this is handy to know and is actually quite fast.

Windows / Linux – File Migration Tools

In Windows i use robocopy

This is the syntax to copy from one location to another…  (i like how robocopy uses UNC paths)

robocopy \\192.168.9.70\videos \\192.168.9.101\videos /e /r:2 /w:10 /sec
robocopy \\192.168.9.70\software \\192.168.9.101\software /e /r:2 /w:10 /sec

Note: i always copy instead of the move. Run multiple times before switch over to shorten time for final sync. Always use the /SEC to copy over the NTFS permissions. I have had problems with the non X010 version of robocopy not copying NTFS permissions across. Check NTFS permissions before removing the source files. You can update files NTFS permissions with /SECFIX switch if required.

/e moves all directories including empty ones.

In Linux i use rsync

i typically mount a smb share on a windows host…. (you must have cifs client on linux first)

mount -t cifs -n //192.168.9.70/backup /mnt/backup -o username=user,password=mypassword

then use rsync for the copy work…

rsync -rcav /etc/ /mnt/backup/etc/

if your after linux to linux copying then rsync is also the best way to do it (via ssh), logon to your destination box via ssh and run this from your distination diretory..

rsync -ave ssh 192.168.9.10:/var/lib/mysql .

Windows – Port forwarding

Just wanted to note here that there is a tool for windows to ‘port forward’ Its a command MS ships that enables IPv6 to work on IPv4, but can be used as a port redirector…. so as long as you have IPv6 support on your box, you can do this.

syntax as follows;

netsh interface portproxy add v4tov4 listenport=443 connectaddress=targetmachine connectport=3389

so the machine above listens on 443 and redirects traffic to 3389 on targetmachine.

Be warned though, NETSH is insanely powerful. And if you make a mistake good luck at cleaning up the mess…. Feeling confident now?

Corporate Firewall – SSH and port 443 goodness

Things you’ll need; (basic instructions)
SSH – either Linux or Open SSH for windows (set this up first and ensure its working!). I have only used Linux, so i do not know the details of setting up a Open SSH box on windows (good luck).

Router with pinhole or port forwarding abilities. — forward your external 443 port to internal 22 on your SSH box

Putty.exe – use this to test your SSH connection locally (you should be able to connect on port 22 locally or 443 externally)

Your home IP – setup a dyndns account on one of the free services available on the web (either use your router if it has it or get a dyndns client that runs on your ssh box) — i use dyndns.org

Putty is the client side device that you will use when you are not local to your network. If you are connecting to your SSH box from external (i.e. at work) then you’ll need to configure a SSH connection profile to connect on port 443. If you have a proxy at work (which you will most probably have) you need to ensure you have filled out your proxy address and authentication details — select HTTP then enter your username / password. Then try to connect.

When you can successfully connect to your SSH box from work via 443 you can then create SSH tunnels. Under SSH on putty there is a tunnels option. This is where you can forward local ports to your remote ports… for example – 127.0.0.1:82 –> 192.168.0.10:3389. Then if you fire up RDC you can connect to your remote machine via 127.0.0.1:82

Simple? — if i haven’t made a specific part clear please ask any questions and i’ll try to make it easier to follow

fakeRAID vs Software RAID (windows)

O.k. here is the latest from atomic magazine… I’m talking about RAID 0 (stripe) here.

Software RAID (i.e. windows stripe) is faster (both in throughput and seek time) than the “hardware” fake RAID built in to most new mother boards. Apparently it doesn’t matter about the stripe size of your raid either…. Software raid still wins??

I’m a bit skeptical about this, and will have to en devour on a few tests to conclude whether this is true or not…

What i propose…. i have 3 x 120Gb disks in my machine…. In both cases i will use windows solely on the first disk. The other two disks will then be created using fake raid first (bios raid), then i will recreate the raid using software raid.

In both cases i will test throughput / average seek times using HDTach, but i will also perform some real world tests such as loading times for games etc…

further reading shows that Software RAID may only beat fake RAID at the 64K stripe set — which is actually a highly recommended size .

I have been unable to reproduce the results, as i’m having troubles restoring my system back to a single drive. Oh well, i’ll try and remember to do it the next time i’m rebuilding my machine.

Edit : ZFS is faster than both! – by a long shot. ;)   …but of course it is not currently an option within windows.