Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การแก้ไขปัญหา >> ข้อผิดพลาด Windows

แก้ไข "An error occurred mounting one of your file systems" บน WSL

ผู้ใช้ Windows Subsystem for Linux (WSL) บางคนเจอข้อความ "An error occurred mounting one of your file systems. Please run 'dmesg' for details" เมื่อรัน Linux Distribution ที่ติดตั้งไว้ ข้อผิดพลาดนี้เกิดเมื่อ Distribution หรือ WSL ไม่สามารถ Mount ไดรฟ์ Windows ได้ แม้ดูรุนแรง แต่แก้ไขได้ไม่ยาก มีหลายวิธีดังนี้:

แก้ไข  An error occurred mounting one of your file systems  บน WSL

WSL เป็นฟีเจอร์ที่เปลี่ยนเล่นเกมสำหรับนักพัฒนาบน Windows ติดตั้งง่ายด้วยคำสั่งเดียว ผู้ใช้ส่วนใหญ่ที่เจอปัญหานี้ใช้ Docker และมักเกิดเมื่อ Distribution ไม่ได้ถูกตั้งเป็น Default OS

1. อัปเดต Linux Kernel หรือ WSL

ลองอัปเดต WSL (ซึ่งจะอัปเดต Linux Kernel ด้วย) รายงานว่าวิธีนี้แก้ปัญหาได้หลายคน:

  1. เปิด Command Prompt as Administrator (Start > cmd > Run as administrator)
  2. หรือใช้ PowerShell Admin ก็ได้
  3. พิมพ์: wsl --update กด Enter
  4. รออัปเดตเสร็จ รัน WSL ใหม่ดูว่าปัญหาหายหรือยัง

แก้ไข  An error occurred mounting one of your file systems  บน WSL
แก้ไข  An error occurred mounting one of your file systems  บน WSL

2. ตรวจสอบ Default Distribution

หากติดตั้ง Docker บน WSL การเริ่มต้น Distribution อาจล้มเหลวเพราะไม่ได้เป็น Default Distro นอกจากนี้ หากมีแค่ docker และ docker-desktop-data ตัวหลังอาจถูกตั้งเป็น Default ทำให้เกิดปัญหา วิธีแก้:

  1. เปิด CMD as Administrator
  2. ตรวจสอบ Distro ที่ติดตั้งและ Default: wsl --list
  3. หาก Default ผิด ให้เปลี่ยน: wsl -s distroName (แทน distroName ด้วยชื่อจากรายการ)
  4. ทดสอบอีกครั้ง

3. ติดตั้ง Windows Updates

WSL เป็นส่วนหนึ่งของ Windows อาจได้รับผลกระทบจาก Windows Updates ผู้ใช้รายงานว่า KB5005191 แก้ปัญหานี้ได้:

  1. เปิด Windows Settings (Windows + I)
  2. ไป Windows Update
  3. คลิก Check for updates ดาวน์โหลดและติดตั้ง
  4. รีบูทแล้วตรวจสอบ

แก้ไข  An error occurred mounting one of your file systems  บน WSL
แก้ไข  An error occurred mounting one of your file systems  บน WSL

4. ถอนการติดตั้ง Windows Hypervisor Platform

หากวิธีข้างต้นไม่ได้ผล ลองถอน Windows Hypervisor Platform Feature ผู้ใช้รายงานว่าแก้ปัญหาได้ตอนติดตั้ง/ตั้งค่า Ubuntu บน WSL 2:

  1. เปิด Control Panel (ค้นหาใน Start)
  2. ไป Programs
  3. คลิก Turn Windows features on or off
  4. เลื่อนหา Windows Hypervisor Platform
  5. ยกเลิกติ๊ก > OK
  6. รอถอนติดตั้งเสร็จ (ไม่ต้องรีบูท) ทดสอบทันที

แก้ไข  An error occurred mounting one of your file systems  บน WSL
แก้ไข  An error occurred mounting one of your file systems  บน WSL
แก้ไข  An error occurred mounting one of your file systems  บน WSL
แก้ไข  An error occurred mounting one of your file systems  บน WSL