Ever since it was first introduced, I have hated the fact that most applications insisted on installing stuff in my c:\Program Files folder. Some gave me the option of choosing another location but most, especially Microsoft Applications, like SQLServer and others, did not give this option and  insisted on putting everything in my C: drive.

When I bought my present computer it came with an 80 Gig HD which at that time was sufficient. I also added another drive of 250 Gigs as my D: drive and most of my apps are stored here.

Unfortunately over time the C: drive has filled up with C:\Documents and Settings\<user name>\Application Data

and c:\Program files and of course c:\Windows, with all its updates over time, filling up that 80 gigs of space.

Then I bought an iPod and later an iPad and was forced to install iTunes, that horrible application.

iTunes insisted on storing EVERYTHING on my c:\ drive in a number of places.

Also as drives became cheaper and bigger, I have bought external drives and now have 2 external drives of 1TB and 3 TB

giving my desktop a total of nearly 4.4 Terra bytes of data.

But apps, including iTunes still insist on using my c:\ drive, so all this space is wasted.

With every iteration of iOS I had to make backups of my iDevices (which now includes an iPhone 4S) which iTunes insisted on storing on my c: \drive, as well as all the iOS apps I have downloaded.

I found a solution to the App storage problem by changing the location of where iTunes stored the APPS by directing the folder to my external HD as shown below.

This solved my APPS storage location problem which had now grown to nearly 70 Gigs.

Another problem was the default setting where any Media, videos,  photos and Music was copied into the c:\drive by iTunes if I transferred them to my iDevice. This was solved by Un-Ticking the checkbox as shown above - "Copy files to iTunes Media folder....". Now iTunes used a link instead of making duplicates of all my media.

There was still the problem of the backups and although I had the original files stored on my HD, the backup insisted on saving EVERYTHING - all media, all APPS etc even though you cannot edit Apps and Media on your device.

This backup was stored in my c:\ drive with NO option to change its location. Thanks crApple.

All this came to a crux the other day, when Apple released the latest iteration of iOS - iOS 6.1.1. So before updating, I did a backup that took, believe it or not, 5 hours. I now had incremental backups of my iPad and iPhone with a total of 50 GB and 50,000 + files. That's how crApple does it. And I was not allowed to change this location to my external 4 TB storage sitting there idly.

After updating to the latest iOS I tried to Restore from a backup and it failed saying there was no more disk space. Then Windows chimed in and messages boxes started popping up that I was low on disk space. On checking, I now had 400 mb left on my c: \ drive!!!

No wonder Windows complained. So I checked my disk usage using a tool and found that the

C:\Documents and Settings\<username>\Application Data\crApple Computer\MobileSync\Backup

folder was the culprit sucking up all my remaining drive space - 50 GB of it.

The only other folders I had on c:\  were Program Files, Documents and settings and of course VFP9,  so I was not moving them anywhere. So how to get more space? How to move that stupid MobileSync folder to my external drive where I had ample space?

Off to Google and search and found that iTunes would not allow me to change this Backup location. But there always is a solution and a number of them spoke about the NTFS ability of creating something called a NTFS Junction point.

This KB describes it - http://support.microsoft.com/kb/205524 - and spoke about a tool called linkd

But for Windows XP .....

After more searching I finally found it. A tool called JUNCTION and created by the great Mark Russinovich who has created such great tools on his old site SYSINTERNALS. Well MS bought him out so now these tools along with others like Filemon, Portmon, Regmon, Procmon etc. are all free and available on the Microsoft technet site

http://technet.microsoft.com/en-au/sysinternals/

and I found Junction here:

http://technet.microsoft.com/en-au/sysinternals/bb896768.aspx

Downloaded it and read the documentation. It is a Console app and after a few tries I mastered the syntax was able to create a junction on my c: drive to a folder on my external HD.

So next I copied the entire MobileSync folder and all its 51,000 files to my 3 TB external drive to a folder

H:\iTunesMedia\iTunesBackup. This took an additional 3 to 4 hours because of the large number of files.

I then renamed the original Backup folder to xxBackup and using the free Junction tool, in the folder

C:\Documents and Settings\<username>\Application Data\Apple Computer\MobileSync\,

I created a " JUNCTION" called Backup that pointed to

H:\iTunesMedia\iTunesBackup where I had copied all the Backup files.

In Explorer, navigating to C:\Documents and Settings\<username>\Application Data\Apple Computer\MobileSync\,

I could now see 2 folders

xxBackup  - the original renamed Backup and

Backup - the new Junction I had created. I dbl-clicked this new Backup folder and there were all my backup files. No extra space was taken up on my c: drive!!!!

One last test. I fired up iTunes and clicked on Restore and iTunes presented me with a list of my backups. So Junction was working now and iTunes was fooled. NTFS Junction points had come to my rescue.

I deleted the xxBackup folder, recovering my 50 gigs and Windows started behaving properly again. Properties on my C:\ drive showed an additional 50 gigs.

Mark's Junction had saved the day.  It works similar to a shortcut except it points to a folder and not a file.

Did a Restore using iTunes and everything was back to normal.

I had now recovered my disk space and my backups were stored on my external drive.

I was also Junction wiser and now knew how to recover space.

If anyone has suffered with this problem of a badly written installation program that insists on putting all files on a particular drive, there is a solution and it is called Junction.

Thank you Mark Russinovich. This is not the first time one of your FREE, excellent utilities has saved the day.

You can read Mark's blog here http://blogs.technet.com/b/markrussinovich/  and know that he knows what he is talking about.

crApple do your worst. I am prepared.

3 Responses to Interesting tool to argument your disk space – Junction

  • Bhavbhuti says:

    Hi Bernard

    Thanks for pointing this out. I will be looking at this very soon. Just a though from backup point of view, can we do this to the C:\Documents and Settings\ folder straight to say the D:\MyDnS\, should remove a lot of C: drive format time voes. Or is it not advised?

    Kind regards
    Bhavbhuti

    • Bernard Bout says:

      You can do this with ANY drives\Folders. NT handles the translation seamlessly. Whether it is advisable or not depends on you. What happens if you disconnect the “Junctioned” drive and boot up with your profile folders missing? I don;t know.

  • Bhavbhuti says:

    Thanks Bernard. Yes I get your concern when the junctioned folder is to an external HDD like you have, but I was more like thinking of a partition on the same physical HDD. Experience says that C drive is the first one to be formatted and that is the one that normally goes out of diskspace because of exponential size increase of applications and their data all viving for the C drive. Moving the D&S folder to another partition IMO might save all the user settings when the C is formatted and the apps reinstalled. Just my 2 cents

Leave a Reply

Your email address will not be published. Required fields are marked *