﻿---
title: WSL迁移至其它盘符
date: 2024-05-31
excerpt: 将WSL迁移至其它盘符
tags:
  - Linux
  - WSL
  - OS
cover: https://assets.vluv.space/cover/ToolChain/wsl_migrate.webp
---

## Stpes

```shell
# 查看已安装的 WSL 发行版
$ wsl -l -v
  NAME                   STATE           VERSION
* docker-desktop-data    Stopped         2
  Ubuntu-24.04           Running         2
  docker-desktop         Stopped         2
  Arch                   Running         2

# 导出当前发行版
$ wsl --export Arch E:\wsl\Arch.tar
Export in progress, this may take a few minutes.
The operation completed successfully.

# 注销原发行版
$ wsl --unregister Arch
Unregistering.
The operation completed successfully.

# 导入到新位置
$ wsl --import Arch e:\wsl\Arch e:\wsl\Arch.tar
Import in progress, this may take a few minutes.
The operation completed successfully.

# 设置默认用户, Arch启动
$ Arch config --default-user efterklang
$ wsl -d Arch fastfetch

                            gjx@Efterklang
 OS             ➜   Arch Linux 20240101.0.204074 x86_64
│ ├ Kernel      ➜   Linux 5.15.146.1-microsoft-standard-WSL2
│ ├󰏖 Packages    ➜   190 (pacman)
│ └ Shell       ➜   fish 3.7.1
󰧨 LM             ➜   login (TTY)
│ ├ Terminal    ➜   WezTerm 20240203-110809-5046fc22
 PC             ➜   Windows Subsystem for Linux - Arch
│ ├ CPU         ➜   AMD Ryzen 7 5800H (16) @ 3.19 GHz
│ ├󰍛 GPU         ➜   NVIDIA GeForce RTX 3060 Laptop GPU (5.87 GiB) [Discrete]
│ ├󰍛 GPU         ➜   AMD Radeon(TM) Graphics (1.98 GiB) [Integrated]
│ ├󰋊 Disk        ➜   2.09 GiB / 1006.85 GiB (0%) - ext4
│ ├󰋊 Disk        ➜   165.95 GiB / 200.00 GiB (83%) - 9p
│ ├󰋊 Disk        ➜   101.74 GiB / 275.69 GiB (37%) - 9p
│ ├󰋊 Disk        ➜   166.97 GiB / 475.45 GiB (35%) - 9p
│ ├ Memory      ➜   793.43 MiB / 6.71 GiB (12%)
│ ├󰓡 Swap        ➜   0 B / 2.00 GiB (0%)
│ ├󰅐 Uptime      ➜   7 seconds
󰩟 Local IP       ➜   113.54.240.64/19
󰩟 Public IP      ➜   89.116.88.203 (Tokyo, JP)
```
