【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>
  • 然后点开就能用了:
相关推荐
2501_901200532 分钟前
Golang如何做Clean Architecture_Golang整洁架构教程【详解】
jvm·数据库·python
咖啡里的茶i2 分钟前
实验三 数据完整性实验
数据库·oracle
韶博雅3 分钟前
oracle + parfile(数据泵)
数据库·oracle
weixin_459753945 分钟前
Go 中嵌入类型字段在派生结构体字面量中的初始化规则详解
jvm·数据库·python
CLX05056 分钟前
HTML5中Mediastream实现摄像头画面实时捕获
jvm·数据库·python
Hello.Reader10 分钟前
算法基础(十三)——随机算法为什么有时主动引入随机性
java·数据库·算法
茉莉玫瑰花茶16 分钟前
LangGraph 拓展核心知识点
开发语言·windows·python
iAm_Ike17 分钟前
PHP错误和异常如何处理_PHP错误与异常处理机制详解【详解】
jvm·数据库·python
m0_6315298223 分钟前
宝塔面板安装后无法修改配置文件_处理chattr锁定属性
jvm·数据库·python
NineData27 分钟前
NineData智能数据管理平台新功能发布|2026年4月
数据库·ninedata·玖章算术