Wednesday, October 16, 2024

Today's Obscure Windows Question

 My laptop came with a 1TB SSD.  Within a year or two, that was not enough.  (I have more PDFs of antique American statute books than you can imagine.)  I did not want to risk fauilure to copy over from my old drive C to my new drive, so I made my new drive D and told the BIOS to boot from the new drive.  

Now, I have drive C with 160GB free, and drive D with all my files and programs installed on it.  I would like to be able to clear drive C and map various directories (Pictures, Documents, Videos, Downloads) to drive C.  Perhaps map all the non-programs to drive C.

In Linux, assuming that my memory of how symbolic links work is correct, you would create a symbolic link so that D:\Users\clayt\Documents actually points to C:\Documents so all references will actually turn into C:\Documents.  

It appeears that a directory junction ("mklink /J link destinationfolder") does what is required.

I created a junction link 

mklink /j "D:\users\clayt\testlink" C:\testlink

Then I copied files into D:\Users\clayt\testlink.  They appeared in C:\testlink.  If I deleted a file in D:\Users\clayt\testlink, it disappeared in C:\testlink.

6 comments:

  1. You don't want /j, you want /d.

    mklink /d "linkLocation" "sourceDir"

    mklink /d "c:\Docs" "d:\Users\clayt\Documents"

    ReplyDelete
    Replies
    1. /d is symbolic link; /j is directory junction which I think in Linux would be a hard link.

      Delete
    2. try it. it works. unless i'm totally misreading your (unstated!) question.

      /j is still a symlink. I've tried /j over the years but it had subtle problems and doesn't work the same as expected in linux - because the paradigm isn't exactly the same. they both should work but have some differences between them. one is that /j works if accessing a linked folder from a different box since a junction processed at the server and /d is done from the client but i've never worried about that.

      Delete
  2. You are playing with Fire when you do this without a backup. I would buy a second drive that is 2TB and use Clonezilla to make a duplicate image of the drive first on the second drive. If you then install the second drive and either expand the current boot partition or you create a Data drive G: and move all the real data that you don't want on the boot drive.

    ReplyDelete
  3. If you really have that many files and growing, unless you need to take them with you, you might consider a NAS (network attached storage) that does raid. You still want an off-site backup option, but raid is a way to know you don't have to worry about 1 failed drive. You still have to worry about fires, burglars, lightning strikes, etc.

    The other option is a USB external drive. There are various 1 TB versions for 50 or 60 bucks, 2 TB will be about 80 or 90. Seagate has an 8 terabyte USB SSD that retails for around $150. (I don't know how good or fast it is, but 8TB for less than 200 bucks is amazing)

    ReplyDelete
    Replies
    1. I have an external USB drive and an NAS for backups. Actually two USB drives. Even one backup failure makes you leary of a single backup. I am trying to make use of this otherwise unused space. I guess a 3TB SSD would have been a better choice than what I bought.

      Delete