Move WSL files to another Drive | + NEW METHOD | FAST | Keep ALL files

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
troubleshoot and welcome back to another video in this quick video I'll be showing you how you can move the windows subsystem for Linux virtual drive from one physical drive to another by default it's stored in percentage Local app data percentage I simply hit start R to openness percentage app percentage Local app data percentage okay then inside of your app data local folder we're going to packages and inside of here we're looking for the operating system that you have installed under WSL or even Ultra bomb canonical group limited Ubuntu is what I'm using and inside of here in the local state folder we have this absolutely massive chonco file 86 gigabytes of virtual hard drive now this isn't too much of an issue for me as I've just upgraded to a much bigger C drive but previously I moved it to a different Drive there's two ways of doing this and one way you'll be told about on the Internet is the only way to do it and I'm here to tell you that it's definitely definitely not the quote unquote only way you'll find how to do it on the Internet is by running a few commands that's these commands here essentially you'll change to whatever drive it is that you want to move it to make a WSL folder and go into it then you'll be exporting a copy of your WSL so it'll back up everything copy it and paste it onto another drive then you'll unregister it make a new folder and you'll import that backup that we just created into that new folder so essentially we're copying everything once then we're copying them again this time to the same disks it will have two copies of it just for us to move from one drive to another that's one two copy operations this one over here will be a lot slower on hard drives because you're reading from OneDrive and writing to the same drive so the head will have to move around a lot more this can be incredibly slow and there's a much much faster way to do it consider this a forbidden troubleshoot trick but you're gonna learn about it here now a program that I absolutely love is the link shell extension essentially you can head across to this link in the description down below but you can download the link shell extension by clicking download up here then scrolling down a little looking for all windows 64 and clicking this download over here then installing it when it's done downloading you'll also need to restart your Explorer I think it is but that's really quick anyways when the installation is done you can practically right click any file on your PC or even folder for that matter and you'll have a new Option called pick link Source when you do it'll create a note of where this file is physically located then we can right click anywhere else in any other folder on any other Drive drop as and we can choose between hard link and symbolic link for files which are some link types and for folders We can choose hard link clone symbolink Junction Etc there's a whole bunch of options essentially we can make a link to a physical file somewhere on our PC and it'll appear to every program at least certain types when we drop as will appear to programs the exact same same way normal files do but could be physically located in another drive that's exactly what I'm gonna do here essentially all we have to do is go back a folder so here's my big virtual hard drive I'll go back and I'll essentially cut the local state folder here and paste it onto another drive for this I'll open up my H drive here and I'll paste it in just like that it's now copying 80 gigabytes of file from one drive to another this is an nvme to an nvme some 80 gigs at 1.5 ish gigabytes a second isn't too bad but we just need to wait for this to finish now that we've moved this entire folder from one drive to another all we need to do is right click the folder click pick link Source now that it's located physically on a different drive and inside of our packages folder here right click and drop as then Junction there's many options here symbolic smart copy mirror DeLorean copy symbolic link clone we're using Junction here this is the simplest kind of simlink at least with holders whenever the program tries to open this folder here then local state these files are presented as if they exist on this disk where instead they're located on a different desk if you unplug this on the disk Windows is going to get very confused and unhappy at you so make sure you don't unplug this disk while WSL is running it's like pulling out your C drive while Windows is running don't do it anyways now all we have to do is fire up Ubuntu or whatever this is in my case it's Ubuntu as you can see here it'll load and just like that we're dropped into the main menu here if I LS you can see all of my programs are still here everything's intact it's perfectly exactly the way it was in my other drive now it's just physically located somewhere else so whenever it talks about this file it points here instead so to move it back I'll simply just delete the local state folder cut my folder here and paste it here instead when we're deleting that Junction it doesn't actually touch any of the original files it only touches the pointer to the original files and it should show as roundabouts one kilobyte or 0 bytes even two file managers and things like that it's quite literally just a pointer saying these files here should be pointed to here that's all it does that's all that Junction link does so if we delete the junction link it leaves all of our files intact on whatever Drive they're physically located however if we open that Junction and we delete files within it it's telling Windows to delete files and see this location see this location points to my other drive so files are deleted just an important note to keep in mind anyways moving it from my other drive back to my C drive here you'll see that the file now appears as it does normally that's the file inside of it if I type in Ubuntu and open it up once more after a quick boot up of WSL you should very shortly see that everything's gone back to normal LS there's all of my files and here it is located on my C drive super simple that's really about it for this quick video I hope you do enjoy my forbidden technique of doing this I don't know why other people don't do it this way is probably some long-winded explanation of why you should just move everything in that case just move the entire packages fold him and some link that anyways my name has been technoby here for troubleshoot thank you all for watching and I'll see you all next time ciao
Info
Channel: TroubleChute
Views: 23,341
Rating: undefined out of 5
Keywords: move wsl to another drive, migrate wsl to another disk, migrate wsl, move wsl, move wsl vhdx, migrate wsl vhdx, backup wsl, back up wsl, backup wsl vhdx, move wsl location, vhdx wsl location, reloacte wsl, wsl, vhdx wsl 2 location, kali location wsl 2, kali wsl 2 location help, linux files location wsl 2, wsl 2 home directory location, move wsl image file, how to install wsl 2, multiple wsl, windows susbsytem home directory location, how to use wsl, wsl 2 install
Id: 13jo3ppi7a0
Channel Id: undefined
Length: 6min 22sec (382 seconds)
Published: Tue Oct 11 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.