【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>
  • 然后点开就能用了:
相关推荐
DIY机器人工房几秒前
关于LVGL中文输入法的设置步骤:
服务器·前端·数据库·stm32·嵌入式硬件·嵌入式·diy机器人工房
艺杯羹3 分钟前
MyBatis 之分页四式传参与聚合、主键操作全解
java·开发语言·maven·mybatis
MC皮蛋侠客20 分钟前
Python与MongoDB深度整合:异步操作与GridFS实战指南
开发语言·python·mongodb
仟濹26 分钟前
【数据结构】「栈」(顺序栈、共享栈、链栈)
c语言·数据结构·算法
不知疲倦的仄仄38 分钟前
网络编程/Java面试/TCP&UDP区别
java·开发语言·websocket·网络协议·tcp/ip·https·信息与通信
爱骑行的Coder1 小时前
深入理解-Java-线程池:原理、动态调整与监控实践
java·开发语言
向左转, 向右走ˉ1 小时前
Python函数全解析
开发语言·python
浮 幽1 小时前
JAVA进阶--JVM
java·开发语言·jvm
枫叶丹41 小时前
【Qt开发】Qt的背景介绍(二)-> 搭建Qt开发环境
开发语言·qt·qt creator
ん贤1 小时前
JWT基础详解
开发语言·go·jwt