Author Topic: NTFS junctions  (Read 7812 times)

sinsi

  • Guest
NTFS junctions
« on: August 20, 2012, 09:15:37 PM »
So my hard drive layout in the computer is
 - 120GB SSD as C:
 - 1TB data drive (VMs, programming, games) as E:
 - 1TB drive for win8 as F: (soon to be gone Bill  :biggrin:)
 - 1TB sitting there, overspill for my customer images ::)
I bought a 2TB drive and mounted it at e:\games after I moved all the games to it.
Everything has been going swimmingly for the last 12 months, now I decide to trim the 500GB of games...

Uninstall 'Age of Empires Gold' and my junction from 'Volume\blahblah' to 'e:\games' is gone. No games work.
Remade e:\games, re-mounted the drive, all is OK. Got brave, uninstalled 'NFS Most Wanted'.
Same thing happened, except this time the game wasn't deleted from the (presumably unlinked) hard drive.

I thought the whole point of junctions was that they are transparent to the user because of the low level (file system).
Anyone had any problems with junctions disappearing? I just hope the drive isn't bad.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: NTFS junctions
« Reply #1 on: August 21, 2012, 01:35:14 AM »
i don't use such things - lol
i change out drives often enough that drive letters change, then you are screwed

when you format a new drive, you can use up to 4 physical partitions
i always use all of them, making one of them a small bootable XP partition
i guess there might be some advantage in leaving one free
i think that if you create logical partitions, a free physical partition is required

Vortex

  • Member
  • *****
  • Posts: 2283
Re: NTFS junctions
« Reply #2 on: August 21, 2012, 03:12:52 AM »
Hi sinsi,

Did you try Mark Russinovich's Junction tool?

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

Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: NTFS junctions
« Reply #3 on: August 21, 2012, 03:35:20 AM »
Hi Vortex,

Hi sinsi,

Did you try Mark Russinovich's Junction tool?

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

good hint.  :t I didn't know that tool, but it can be useful. Furthermore: version 1.06 seems to be stable.

Gunther
Get your facts first, and then you can distort them.

Vortex

  • Member
  • *****
  • Posts: 2283
Re: NTFS junctions
« Reply #4 on: August 21, 2012, 04:00:01 AM »
The article below provides tools with source code to create NTFS junctions :

NTFS Hard Links, Directory Junctions, and Windows Shortcuts

sinsi

  • Guest
Re: NTFS junctions
« Reply #5 on: August 21, 2012, 12:31:34 PM »
Windows 7 comes with mklink.exe which can create junctions.
I am more concerned with an uninstall removing the link as well.

Bill Cravener

  • Guest
Re: NTFS junctions
« Reply #6 on: August 21, 2012, 08:52:08 PM »
So my hard drive layout in the computer is
. . .
 - 1TB drive for win8 as F: (soon to be gone Bill  :biggrin:)
. . .

You talkin' to me ? :biggrin:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7460
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: NTFS junctions
« Reply #7 on: August 22, 2012, 01:42:59 AM »
As long as I am using XP and have Win2000 machines lurking around as backups, I make sure that any disk can be swapped from one machine to another. I originally had 2 x 1 tb and 2 x 500 gig drives on this box, later bought 2 more 1tb drives but made the mistake of using disk caddies which worked OK for a few months then damaged both of the second pair of 1 tb disks. Put the old 500 gig ones back in but recently bought 2 x 2 tb drives off eBay which I put into this box.

I use standard NTFS formatting and absolutely no trickery at all, this way I can move them, take them out if a board fails and put them into another box if I need to to get data off a disk. Long ago I learnt not to run striped disks as while the disks were generally reliable, the raid hardware/software varied from board to board and usually you could not read the disk from another board.

The other thing I always do is name the partition by its drive letter "drv_j" or similar denoting the actual disk "drv_3_k". This is a leftover from the irksome habit of Win2000 if you had to do a re-install where it always messed up the drive order and I always had to manually change all of the drive orders to get them back in the right place. Most of the Microsoft drive gimmicks locked the disks into one machine and you lost the data if the board failed.

Sad to say Win7 64 bit uses a different NTFS to Win XP / 2000 so it sits with 4 x 1 tb drives that cannot be swapped with any of the other machines.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: NTFS junctions
« Reply #8 on: August 22, 2012, 03:13:10 AM »
hopefully, you can stick an XP-formatted drive into the win7 machine
copy the stuff to it
then stick it back in the XP machine   :shock:

sinsi

  • Guest
Re: NTFS junctions
« Reply #9 on: August 23, 2012, 10:04:15 PM »
>I use standard NTFS formatting and absolutely no trickery at all
A junction isn't trickery, it's a standard NTFS thing. Start an administrator command prompt, have a look at the output from "dir c:\ /l/s". Junctions are everywhere.
     Total Files Listed:
               0 File(s)              0 bytes
              63 Dir(s)  58,109,059,072 bytes free


Vortex

  • Member
  • *****
  • Posts: 2283
Re: NTFS junctions
« Reply #10 on: August 24, 2012, 12:53:10 AM »

sinsi

  • Guest
Re: NTFS junctions
« Reply #11 on: August 24, 2012, 01:09:05 AM »
Because so many programs hard code paths, Microsoft thought it best to work around it.
Even Windows 7 has a junction, "documents and settings", as an alias for "users", for those brain dead XP programmers.

Opening "c:\documents and settings\sinsi\blah.txt" actually opens "c:\users\sinsi\blah.txt".
Notepad doesn't know, even Windows (user mode) doesn't know.
Part of NTFS, even Windows will obey.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: NTFS junctions
« Reply #12 on: August 24, 2012, 01:16:38 AM »
yes - but they are all on the same volume
when you go across volumes, you are just asking for headaches

sinsi

  • Guest
Re: NTFS junctions
« Reply #13 on: August 24, 2012, 01:46:43 AM »
yes - but they are all on the same volume
when you go across volumes, you are just asking for headaches
The only restriction is about network drives.

To try it out I created a new user, logged on as that user to create the initial profile, then restarted.
Logged on as my usual account then moved the new user directory to f:
Made a link between c:\users\new and f:\new
Booted to new user no problems, installed stuff OK.

Not just a different volume but a different physical drive.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: NTFS junctions
« Reply #14 on: August 24, 2012, 02:12:13 AM »
that's wonderful
now start moving drives from one machine to another and see what it gets you
the situation may be better under win 7, but under XP, drive letters change and things get all messed up