This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
other:win10wsl [2022/08/31 12:42] jypeter Finished moving the backup section |
other:win10wsl [2022/08/31 12:50] jypeter [Creating a backup] Improved |
||
---|---|---|---|
Line 1013: | Line 1013: | ||
Detailed steps: | Detailed steps: | ||
- | * Determine the name of the current Linux installation used in WSL (and see if it is running, and using //WSL 1// or //WSL 2//) | + | * Determine the name of the current Linux installation(s) used in WSL |
* <code>> wsl --list --verbose | * <code>> wsl --list --verbose | ||
NAME STATE VERSION | NAME STATE VERSION | ||
Line 1024: | Line 1024: | ||
* Ubuntu Stopped 2</code> | * Ubuntu Stopped 2</code> | ||
* Export the specified Linux installation to a //tar// file: | * Export the specified Linux installation to a //tar// file: | ||
- | * You should export to a directory or external disk where you have //enough// space\\ e.g. The tar file for a [[other:win10wsl#base_installation|newly installed and updated]] //Ubuntu 20.04.5 LTS// is ~1.G Gb | + | * You should export to a directory or external disk where you have //enough// space\\ e.g. The tar file for a [[other:win10wsl#base_installation|newly installed and updated]] //Ubuntu 20.04.5 LTS// is ~1.4 Gb |
* You should use a detailed enough file name for the tar file\\ e.g. WSL_<Linux_Distribution>_<Distribution_Version>_<User>_<Date>.tar | * You should use a detailed enough file name for the tar file\\ e.g. WSL_<Linux_Distribution>_<Distribution_Version>_<User>_<Date>.tar | ||
- | * Example: ''wsl --export Ubuntu C:\Scratch\<your_login>\WSL\WSL_Ubuntu_20.04.5_LTS_stdu_22-08-29.tar'' | + | * Example: ''%%wsl --export Ubuntu C:\Scratch\<your_login>\WSL\WSL_Ubuntu_20.04.5_LTS_stdu_22-08-29.tar%%'' |
* If you are not going to use the backup tar file right away, you can optionally compress it in order to save some space | * If you are not going to use the backup tar file right away, you can optionally compress it in order to save some space | ||
* <code>Add compression example here</code> | * <code>Add compression example here</code> | ||
- | === Other types of backup === | + | === Backup of specific directories === |
You can also just create backups of specific directories: | You can also just create backups of specific directories: | ||
- | * Your Linux //home// directory (''/home/<your_login>/''), or some specific sub-directories of the //Ubuntu// running in WSL (sub-directories of ''/''): the best way to save them is probably to **create a tar file from Linux**, and put this tar file in a specific Windows //WSL backup folder// (we will use below the directory ''/mnt/c/Scratch/<your_login>'' or ''c:\Scratch\<your_login>'') | + | * Your Linux //home// directory (''/home/<your_login>/''), or some specific sub-directories of the //Ubuntu// running in WSL (sub-directories of ''/''): the best way to save them is probably to **create a //tar// file from Linux**, and put this //tar// file in a specific Windows //WSL backup folder// (we will use below the directory ''/mnt/c/Scratch/<your_login>'' or ''c:\Scratch\<your_login>'') |
* <code bash>$ cd /home | * <code bash>$ cd /home | ||
Line 1052: | Line 1052: | ||
* Regular Windows folders where you store data used by WSL: you can use ''tar'' in a Linux terminal, as above, or use any usual way of backing up Windows files (drag and drop, some specific [[other:win10apps#backup_software|backup software]]) | * Regular Windows folders where you store data used by WSL: you can use ''tar'' in a Linux terminal, as above, or use any usual way of backing up Windows files (drag and drop, some specific [[other:win10apps#backup_software|backup software]]) | ||
- | * WARNING: there should not be performance issues using ''tar'' (from Linux) to make a backup of Windows files with WSL 1, but **WSL 2 is significantly slower than WSL 1 to access Windows files** ([[https://docs.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2|Exceptions for using WSL 1 rather than WSL 2]] | + | * WARNING: there should not be performance issues using ''tar'' (from Linux) to make a backup of Windows files with WSL 1, but **WSL 2 is significantly slower than WSL 1 to access Windows files** ([[https://docs.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2|Exceptions for using WSL 1 rather than WSL 2]]) |