Access local drive with UNC and mklink on Windows

March 4, 2012

I set up a Tomcat app server on a ‘virtual’ hard drive. The virtual drive is assigned a local hard drive letter. But when a Groovlet attempts to access a local file, the file path used is on the default local drive, C:. How to allow access to the non-local file?

Symbolic links
There are probably many ways to do this and of course corresponding security concerns. One of these is to use Universal Naming Convention (UNC) paths. My quick approach is to just use file directory symbolic links. These are supported in most windows versions. On Windows 7 the MKLINK command is available.

You want to access the folder w:\a\b\c on the virtual drive. On the “real” drive you create a link:

mkdir a\b
mklink /D c w:\a\b\c

Now when the app server access the “c” folder via a UNC, \\mymachine\a\b\c, it will find it.

Duplicate post on other blog: Access local drive with UNC and mklink on Windows

Show hidden windows utility on PC

March 4, 2012

Sometimes a program may crash or show deranged behavior and one of the dialogues cannot be accessed. This just happened to me. A program looks like it is stuck in a thread issue. When I look on its thread list it seems to be waiting for user input. There is no dialog visible. Clicking on the program’s window just gives the waiting mouse pointer. Sure you can just kill the program but this may not help you find out what the problem really is.

I remember years ago I used a utility that could show these hidden windows. Good luck searching on web for something like “show hidden windows” or better phrases. You won’t find it. Well, yea, you could. I did. But, I’m good, smirk.

Note that this utility is pretty basic, just shows a list of window objects. Some of them should not be unhidden, they will lock the utility itself or cause other problems. Perhaps there is something out there that is better? Seems this should be part of the Sysinternals utilities.


  1. Unhider
  2. Windows Sysinternals

Using Powershell instead of cygwin for scripting

February 27, 2012

In this blog entry, Windows Tricks For Whacking Lingering Java Processes …, the author resorts to the cygwin linux shell to automate an admin need.  Now cygwin is awesome, bringing some of the best tools from *nix.  However, with Powershell, Microsoft finally transformed the Windows command line into a powerful and usable administration resource.

Below a line from the bash script the author used to find each process given a process name and then loop thru each process ID and terminate it.   Note how the script requires a good understanding of bash scripting and in addition multiple Linux utilities  ps, grep, and sed.   The most important line in the script is:

found=` ps -aW | grep $procText |  sed -e's/^\s*\([0-9][0-9]*\).*/\1/' `
Here is how this works.
ps -aW:   show all processes and windows too.
grep $procText:   only use lines that contain the command line string
sed -e:   run stream editor inline
s///:   substitute
^\s*:  all beginning white space
\([0-9][0-9]*\):  find two or more digits, remember these.
.*:  any characters.
/\1/:  replace with the found digits

Very complex!!!! But, to *nix users this is nothing. Its even fun to do. With a Linux command line you can rule the world. Note that in the above script line, it’s just text processing.

Powershell has a different approach. In Powershell one works with objects (in the OOP sense). Thus, instead of transforming everything to text, one manipulates properties of objects. One pipes object instead of text.

To do:
Show how to do this in Powershell. Unfortunately, wrote the above a long time ago and lost what little Powershell mojo I was developing. Any help?

3/18/12: The powershell approach will probably be expanded from something like this, which just lists the processes by name and process ID:

$strComputer = "."

$colItems = get-wmiobject -class "Win32_Process" -namespace "root\CIMV2" `
-computername $strComputer

foreach ($objItem in $colItems) {
      write-host "Name: " $objItem.Name
      write-host "Process ID: " $objItem.ProcessId

Hierarchical Storage Management, from drive to cloud

January 7, 2012

Years ago I came upon the HSM concept. Is this now applicable in today’s networked world for personal use? I propose HSM can be extended to encompass the Cloud.

HSM is an enterprise data storage technique, a tiered storage. Data is automatically moved from expensive but fast storage systems like hard disk arrays to cheaper but slower systems like optical or tape drive.

Conceptually, HSM is analogous to the cache found in most computer CPUs, where small amounts of expensive SRAM memory running at very high speeds is used to store frequently used data, but the least recently used data is evicted to the slower but much larger main DRAM memory when new data has to be loaded. —

In the consumer world we have in our PCs fast hard drives and on mobile devices fast flash memory. A simple two tiered system would migrate least recently used files from local media to the cloud. In the home or SOHO environment, a three-tiered system is possible. Solid-State Drives (SSD) of modest size could be the 1st tier, SATA disk the 2nd, and finally, Cloud services can provide the 3rd tier.

For example, you have a PDF on your system that is a great resource, but you haven’t used it in a few weeks. The HSM manager would take that file and move it to the cloud (secure, private, encrypted, …., of course). In its place, to allow access by the user, is a link to the HSM managed storage location. Next time you use the file it will be migrated back to the local storage (but now also backed up in the cloud).

This is really an application of “file virtualization“.

Note that the HSM in enterprise systems is not simply based on “files” but on the underlying storage mumbo jumbo (frames, and all that).

This approach could make the potential future Windows 8 ‘Storage Spaces’ be even more useful. On *nix OS this is possible to implement now. It probably already is.

Here is a conceptual demo. We’ll use a known cloud storage service provider like Dropbox. As far as I know, Dropbox does not offer HSM.

On your PC you set a property on various folders that makes them eligible for HSM monitoring. This could be accomplished using a GUI and drag&drop. The HSM will immediately copy the folders to the SSD on your system or the main hard drive, if the files are not already on the fastest subsystem. In the original location of the folders, a link to the new locations will be created (soft links?). The end user will not see any difference. Kind of like “web folders” or WebDAV protocol.

After a period of time, the local HSM monitor will record which files have not been used and invoke the Dropbox local service to stream the files to the cloud. All that remains on the file system are links to the remote files; storage space is reclaimed.

Feb 26, 2012: Another company will be competing with DropBox. As above it allows the user to designate specific folders to participate in cloud storage. Since remote files will be slower to access, this company will attempt to “predict” which files would be used more often. See this article.

Further Reading

Bob Dylan “With god on our side”

Windows 8 Storage Spaces?

January 7, 2012

Finally Windows may get a file system that adds features that have been around for years in Linux and Unix.

The state of the art in file system design could arguably be ZFS which is used in Solaris and a few other places.

Storage systems seem like very complex engineering systems. I wonder if Microsoft would have just been better off not reinventing the wheel and just licensing ZFS technology or something else? Just search for user horror stories regarding any of the storage improvements on Windows, from drive extender, encryption, WHS, etc.

And what ever happened to the object file system, the DB based file system?

Storage Spaces is somewhat like ZFS, although it has no deduplication and lacks other ZFS features. However, it is a start – and Microsoft will probably add features such as snapshots, replication, deduplication, and, maybe, compression. El Reg also thinks that there could be a Hyper-V virtualisation angle to this – and more is to come. —

Jan 17, 2012: Ah, so Microsoft is working Resilient File System (ReFS).

Microsoft mentioned all the important keywords when promoting ReFS with words like resilience, availability and the use of storage pools, something made popular by Sun’s – and now Oracle’s – ZFS.
Source: The Inquirer (

Further Reading

VOWS “Winter’s Grave” OFFICIAL video

Debugging: copying .git folder hangs Windows Explorer

September 26, 2011

Windows Explorer started hanging when using copy & paste of folders. I noticed that it only involved folders that had a “.git” subfolder.


  • Copy a folder and explorer does not refresh; you have to hit F5.
  • After the manual refresh, click on a folder and the explorer gets an hour glass.
  • The explorer.exe CPU usage reaches 50% and higher.
  • Only happens when a subfolder was named “.git”.
  • .git folder could even be empty.

Easy approach unsuccessful
I uninstalled Git and TortoiseGit then restarted the system. Still happening. Hmmm, that should have removed everything. Nope, I looked in the Registry and TortiseGit was still hanging around. I removed all traces and then even used ShellExView tool and could not find any shell extension that could be doing this. Using that tool I disabled all non-Windows shell extensions. Still happening.

More tools to help
This happened a month ago so I don’t remember all the steps I took. I used some of the SysInternals tools but they didn’t help much; you need a lot of internal Windows details to really use some of them.

However, I think it was using the Process Manager and looking only at file activity that all the info finally gave me a clue.


5:23:14.4666723 PM	explorer.exe	5096	ReadFile	C:\Documents and Settings\t16205\Start Menu\Local Disk (C)\target.lnk	SUCCESS	Offset: 0, Length: 299
5:23:14.4668257 PM	explorer.exe	5096	QueryInformationVolume	C:\Documents and Settings\t16205\Start Menu\Local Disk (C)\target.lnk	SUCCESS	VolumeCreationTime: 9/15/2009 8:47:39 AM, VolumeSerialNumber: 64B6-6315, SupportsObjects: True, VolumeLabel:

It seemed to be hanging at that point!

I looked in the Windows Start Menu list and saw that I had placed a link of the C: drive there. Not a junction or anything fancy, just a drag and drop of a shortcut (I think). I removed that link and the problem was solved.

Back to Git
Reinstalled Git and all is fine, knock on wood.

No explanation yet
Not really debugging, just floundering with a purpose. But, why would this only effect folders named “.git”, when even Git is not even installed. Strange.

Windows XP Professional


WhatIsHang v 1.10:
ShellExView v 1.66
Process Explorer v15.04
Process Monitor v 2.96

VB file sharing with Ubuntu guest and Windows 7 host

January 15, 2011

VirtualBox 4.0 can now mount shared folders automatically!

Yes, you could always do it with a few edits of some system config files, but this puts it at a non-geek average user level, a file sharing for idiots perhaps. The instructions on creating shares is in the VB manual section 4.3.2 Automatic Mounting.

I tried it and can now see my full C drive on Windows 7 from the Ubuntu guest running in VirtualBox (VB). But, at first, it did not work, and a previous manually mounted share also stopped working, both with access permission problem. The big detail I missed:

Access to auto-mounted shared folders is only granted to the user group vboxsf, which is created by the VirtualBox Guest Additions installer. Hence guest users have to be member of that group to have read/write access or to have read-only access in case the folder is not mapped writable.

So after you create the share you have to add users to the vboxsf group. Using the Ubuntu UI you navigate to System, Administration, Users and Groups, then Manage Groups. Now find vboxsf and show its properties, from there you can add users. Reboot.

From the Oracle VM VirtualBox manual:

4.3.2. Automatic mounting
Starting with version 4.0, VirtualBox can mount shared folders automatically, at your option. If automatic mounting is enabled for a specific shared folder, the Guest Additions will automatically mount that folder as soon as a user logs into the guest OS. The details depend on the guest OS type:

With Windows guests, any auto-mounted shared folder will receive its own drive letter (e.g. E:) depending on the free drive letters remaining in the guest.

If there no free drive letters left, auto-mounting will fail; as a result, the number of auto-mounted shared folders is typically limited to 22 or less with Windows guests.

With Linux guests, auto-mounted shared folders are mounted into the /media directory, along with the prefix sf_. For example, the shared folder myfiles would be mounted to /media/sf_myfiles on Linux and /mnt/sf_myfiles on Solaris.

The guest property /VirtualBox/GuestAdd/SharedFolders/MountPrefix determines the prefix that is used. Change that guest property to a value other than “sf” to change that prefix; see Section 4.6, “Guest properties” for details.

Access to auto-mounted shared folders is only granted to the user group vboxsf, which is created by the VirtualBox Guest Additions installer. Hence guest users have to be member of that group to have read/write access or to have read-only access in case the folder is not mapped writable.

To change the mount directory to something other than /media, you can set the guest property /VirtualBox/GuestAdd/SharedFolders/MountDir.

Solaris guests behave like Linux guests except that /mnt is used as the default mount directory instead of /media.

To have any changes to auto-mounted shared folders applied while a VM is running, the guest OS needs to be rebooted. (This applies only to auto-mounted shared folders, not the ones which are mounted manually.)

VirtualBox: 4.0.0 r69151
Ubuntu: 10.10 (maverick)
Kernal Linux: 2.6.35-24-generic
Window 7:
PC: p6230

Further reading

  1. Dupe post: VB file sharing with Ubuntu guest and Windows 7 host
  2. VirtualBox Shared Folders in Ubuntu 10.10 Guest with Windows 7 Host
  3. VirtualBox


Ratkje- Vox

Ubuntu 10.10 update in VirtualBox, no gui.

October 11, 2010

I’ve been running Ubuntu Linux 10.03 on a VirtualBox VM with the Windows 7 host PC. Works fine. Updated to Ubuntu 10.10 – the Maverick Meekat, restarted the system, and now it comes up in console mode and asks for a user/pass. I give it what I have, and it doesn’t accept it. Hosed. Gee ain’t Linux grand.

Hmmm. Let me try again. Ah, it accepted another username/password, which is not the one in my Keepass database, now that needs maintenance.


But, now how do I get the Ubuntu gui back. Tried to reinstall the Guest Additions. Nope, even though I do the Devices->Install Guest Additions, I don’t see the CD in /media/cdrom folder.

At the end of this blog post the author has:

The Unixmen’s site has a workaround to the X Window issue. Run the following commands:

sudo apt-get update

sudo apt-get install build-essential linux-headers-$(uname -r)

sudo apt-get install virtualbox-ose-guest-x11

I was prompted whether or not I wanted to keep my current configuration file or replace it, I chose to keep it.

Once the last command finishes reboot the virtual machine. The display can then be resized.

It works! Ubuntu is back to normal.

Incidentally, I also had to remove etckeeper. Its been giving some trouble for a while now.

11Oct10: Oracle just released VirtualBox 3.2.10, that probably fixes this issue.

Add 2nd hard drive to HP p6230y desktop

July 18, 2010

My old Laptop finally reached its end, too slow.  Looked into building a new PC but found a good enough PC:  cheap, quiet, and not slow.

I was going to document how to install the new hard drive.  I saw a few pleas on the web on how to do this with this particular system; if it is even possible?  Of course, the PC’s manual is useless and there is no info on the motherboard being used.  But, the new hard drive I put in did not work on first try!  Was it DOA?  Does this board or OS require complexity?

The PC

The HP Pavilion P6230y is nothing to write home about, but was certainly inexpensive and much lower then any build your own I was considering. Its lowest Windows Experience Index is a measly 4.5 due to its onboard graphics that shares system memory, and with a Power Supply of just 400W cannot accommodate a gaming graphics card.  Nevertheless, so far I have not experienced any lack of power.  The  AMD Phenom II X4 810/2.6 GHz quad processor and 8 GB RAM is enough to multitask to my hearts content.

The best part of this PC is that it is quiet.  Very quiet.  And, the Hard Drives it now has, contrary to people’s reviews on some hardware sites is quiet too.

BTW, why don’t hardware review sites list the noise from any system under review?

Windows Backup

Anyway, the built in Windows 7 backup has a hard time backing up to my NAS, an old noisy Infrant X6.  I backup to an external USB drive, but to be doubly safe I wanted to install a second hard drive to mirror the primary.  Supposedly, Windows 7 can do software based mirroring.

Mirroring or RAID

Why mirror and not RAID?  RAID is not really all that safe.  Sure the data is ‘safer’, but the data is now hidden in the RAID format, and if you lose the controller, its gone (no guarantee that RAID volumes can migrate to a new controller). 

Furthermore, you can’t take a RAID volume and use it directly in another non-RAID system. Not sure if this is also true for RAID1, mirroring.  Todo!

Anyway, software RAID will be much bigger as systems get more powerful. Here is a recent article on Intel’s allowing this much easier.

The New Drive

Buying a hard drive is not easy.  Which is the best or most reliable? Reading the opinions can be confusing.  I read some reviews and searched the web for the definitive assessment.  There isn’t any.  So, I just settled on one after I hope was my filtering of bogus opinions.

The primary hard drive in this PC is a ST3750528AS Seagate Barracuda 7200.12 SATA 3GB/s 750GB Hard Drive.  The new hard drive is a Western Digital Caviar Black WD1001FALS-00E3A0 which is 1TB 32MB Cache SATA at 3GB/s.  This drive sells for about $99.00 Bare Drive, amazing!  I also needed the SATA cable and just in case, another power supply cable Y-connector.  I bought two SATA cables that were on sale.


Installing the new drive was easy.   You just need a lot of light and some manual dexterity to align the cables and gently but firmly get everything attached.  The PC case already has a slot for a second drive though you’ll need to purchase or scrounge for the screws to attach it to the cage.

I installed the drive, now the smoke test….

Turn On

Nothing.  The drive was not detected when I booted the PC.  Nothing in the BIOS screens.  Is the drive DOA?  No ……. !  Should I have listened to the reviews on NewEgg?


Fortunately, I am no stranger to hardware and so started my troubleshooting of the issue.   There were a few easy possibilities:

  1. BIOS settings
  2. Drive DOA
  3. Drive dip switches
  4. Windows configuration
  5. Power supply cable
  6. SATA cable

I booted the PC and got into the BIOS settings (I thought BIOS was history on PCs?).   Nothing I could decipher that had relevance.  There was stuff about the built-in RAID, but did not seem relevant.  Plus, some inscrutable settings.  Well, BIOS screens have not improved in the years since I last built my own homebrew (years ago).

Looked at the jumper pins on the drive.  According to the drive case docs and the WD web site, no changes were required.

The Windows 7 sites said the BIOS must detect the drive before Windows can do anything with it.  Makes sense, that’s how I thought it should work.

So maybe the power cable was bad?  Put my Fluke Multimeter on it.  Had the voltages.  Just in case, I took another cable coming from the PC case’s power supply, but still nothing.  Maybe its the SATA cable?

Switched the SATA cable (I bought two).   Nothing.

That leaves me with the only possibility that the drive is just defective.  One last test.  I took an external SATA enclosure I have, took out its hard drive, and plugged in the new one.  It works!  Now what?

I doubt its the power supply so maybe its the cable or the cheap motherboard really doesn’t support more drives.  I doubt a MB could be that cheap, especially since it has so many SATA ports.  But, I switched SATA cables, could two SATA cables be bad?  Ah, I know, I switched cables on the old working drive with the new cable, and the old drive stopped working!

How frustrating!  Its Sunday, but maybe I can find a cable in a bricks and mortar shop, like Staples.  They don’t have it, the local Radio Shack either.  Another store has it and it’s about $10.00.  The two cheap SATA cables I bought on line were about $2.00 each.  They have the Gigaware SATA cable and it works.  Lesson:  Don’t buy cheap junk.

I was planning to make this post a howto for this type of PC, but the SATA cable issue ruined it.  Now I don’t have the screen captures and the optimal steps.

Did I use Windows Active Drives to sidestep RAID1?  Nope.  Did a bunch of searching on this and it does not look reliable.  The PC comes with RAID already, but no documentation.  So, I still have not created the target configuration.  Needs more work.


Windows 7 Search is weak but …

June 13, 2010

When it comes time to search for a file on the local or networked file system you would think win7 would have advanced capabilities.

keywords: Windows 7, win7, search, keyword search

It does and it doesn’t.  For what it does have, it is not exposed in the GUI.  Yup, a graphical operating system interface does not present an easy way to do advanced searching.  Anyway, below are links to articles that show you how to get access to this search capability.  Many books supply the missing information too.

I’m surprised (not) that Windows help doesn’t really give the information.

Ok, I skimmed the docs below and I still don’t like it. How would I search for a file that has “yup” somewhere in its name and also has the text “foiled” but was also created a certain time period? In Windows XP that would be easy. In Linux I would use the “find” command and all its inscrutable switches.

Windows needs to have its file search redesigned. If I navigate to a folder, I want to be able to search for file content, just like every prior Windows version before it (I skipped Vista). Never mind all that indexing nonsense, Windows is a not a Mac.

If you want to use real search maybe it has to be by an external tool. Like Agent Ransack.


Exploring Windows 7’s New Search Features (Part 3):

Query Syntax:

Exploring Windows 7’s New Search Features (Part 1):

Exploring Windows 7’s New Search Features (Part 2):


Get every new post delivered to your Inbox.