【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>
  • 然后点开就能用了:
相关推荐
OceanBase数据库官方博客5 分钟前
滔搏基于OceanBase实现 15TB到0.9TB“无痛切换”与“系统瘦身”
数据库·oceanbase·分布式数据库
冷雨夜中漫步9 分钟前
python反转列表reverse()和[::-1]哪个效率更高
开发语言·python
Jess0710 分钟前
MySQL内置函数
数据库·mysql
OceanBase数据库官方博客11 分钟前
爱奇艺基于OceanBase实现百亿级卡券业务的“单库双擎”架构升级
数据库·架构·oceanbase·分布式数据库
rainbow688911 分钟前
Python面向对象编程与异常处理实战
开发语言·python
weixin1997010801615 分钟前
锦程物流item_get - 获取详情接口对接全攻略:从入门到精通
数据库·python
AC赳赳老秦17 分钟前
DeepSeek 辅助科研项目申报:可行性报告与经费预算框架的智能化撰写指南
数据库·人工智能·科技·mongodb·ui·rabbitmq·deepseek
2501_9277730717 分钟前
Linux系统编程——sqlite数据库
数据库
mahailiang21 分钟前
codeblocks+wxWidgets Projects中引用第三方库(sqlite3)
数据库·sqlite·wxwidgets·codeblocks
你撅嘴真丑33 分钟前
第八章 - 贪心法
开发语言·c++·算法