【wsl2】从C盘迁移到G盘

C盘的ubuntu22.04 非常大,高达30g+

  • 迁移后就只有几百M了:

右键有一个move没有敢尝试


迁移过程

bash 复制代码
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\zhangbin> wsl --shutdown
PS C:\Users\zhangbin> wsl --export ^C
PS C:\Users\zhangbin> wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-22.04    Stopped         2
  CentOS7         Stopped         2
PS C:\Users\zhangbin> wsl -export Ubuntu-22.04 G:\ubuntu2204.tar
Invalid command line argument: -export
Please use 'wsl.exe --help' to get a list of supported arguments.
PS C:\Users\zhangbin> wsl --export Ubuntu-22.04 G:\ubuntu2204.tar
Export in progress, this may take a few minutes.
The operation completed successfully.
PS C:\Users\zhangbin> wsl --unregister Ubuntu-22.04
Unregistering.
The operation completed successfully.
PS C:\Users\zhangbin> wsl -l -v
  NAME       STATE           VERSION
* CentOS7    Stopped         2
PS C:\Users\zhangbin> wsl --input Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04.tar --version 2
Invalid command line argument: --input
Please use 'wsl.exe --help' to get a list of supported arguments.
PS C:\Users\zhangbin> wsl --imput Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04.tar --version 2
Invalid command line argument: --imput
Please use 'wsl.exe --help' to get a list of supported arguments.
PS C:\Users\zhangbin> wsl --import Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04.tar --version 2
The system cannot find the file specified.
Error code: Wsl/ERROR_FILE_NOT_FOUND
PS C:\Users\zhangbin> wsl --import Ubuntu-22.04 G:\WSL-SYS\Ubuntu-22.04 G:\WSL-SYS\ubuntu2204.tar --version 2
Import in progress, this may take a few minutes.
The operation completed successfully.
PS C:\Users\zhangbin>
  • 然后点开就能用了:
相关推荐
避避风港3 分钟前
MySQL 从入门到实战
数据库·mysql
s***4536 分钟前
MSSQL2022的一个错误:未在本地计算机上注册“Microsoft.ACE.OLEDB.16.0”提供程序
数据库·microsoft
学习路上_write6 分钟前
嵌入式系统bringup指南:软硬件调试
c语言·单片机·嵌入式硬件
say_fall8 分钟前
C语言编程实战:每日一题 - day7
c语言·开发语言
LiLiYuan.19 分钟前
【Lombok库常用注解】
java·开发语言·python
小龙报23 分钟前
《算法通关指南数据结构和算法篇(2)--- 链表专题》
c语言·数据结构·c++·算法·链表·学习方法·visual studio
Charles_go39 分钟前
C#中级45、什么是组合优于继承
开发语言·c#
醉颜凉1 小时前
环形房屋如何 “安全劫舍”?动态规划解题逻辑与技巧
c语言·算法·动态规划
能鈺CMS1 小时前
能鈺CMS · 虚拟发货源码
java·大数据·数据库
二川bro1 小时前
数据可视化进阶:Python动态图表制作实战
开发语言·python·信息可视化