Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Linux

วิธี Uninstall Ubuntu ในระบบ Windows 10 Dual-Boot

ทำอย่างไรถ้าคุณติดตั้ง Ubuntu บน PC พร้อม Windows แต่ไม่อยากใช้ Linux อีกแล้ว? ตอนนี้คุณมี Linux partition บน hard drive ใช้พื้นที่ที่คุณอยากใช้สำหรับ Windows folders และ files

บทความนี้จะแสดงวิธี uninstall Ubuntu ใน Windows 10 dual boot อย่างปลอดภัย โดยไม่สูญเสียข้อมูลหรือแอปพลิเคชัน

ส่วนแรกคือลบ Linux operating system จำไว้ว่านี้จะลบ Ubuntu data และ system files ทั้งหมด backup อะไรที่ไม่อยากลบไว้ที่อื่นก่อน ส่วนที่สองคือเปลี่ยน Windows boot loader

ก่อนทำการเปลี่ยนแปลง คุณควร backup ไฟล์เสมอ แม้ใช้ Linux ไม่กี่วัน ก็คงมีข้อมูลอยากเก็บ

Backup critical data จาก Windows partition ด้วย external hard drive, cloud storage, หรือ DVDs เพื่อไม่สูญเสียข้อมูล

เตรียม USB หรือ DVD ของ Windows ดาวน์โหลด Windows 10 จาก Microsoft ได้

ลบ Linux Partition ใน Windows

  • เริ่มด้วย login เข้า Windows กด Windows key + R พิมพ์ diskmgmt.msc เปิด Windows disk management tool

Linux partitions แตกต่างจาก Windows เพราะไม่มี drive number และ file system

Windows partitions ระบุได้จาก drive label เช่น C, D, E และมักเป็น FAT หรือ NTFS files

  • ลบ Linux partitions: right-click แต่ละตัว เลือก Delete Volume
  • Warning จะโผล่บอกว่าพยายามลบ partition ที่ไม่ได้สร้างโดย Windows ถามว่าต้องการลบหรือไม่ เลือก Yes

การลบ partitions จะคืนพื้นที่บน drive

  • ถ้ามี Linux partitions อื่น ลบแบบเดียวกัน Right-click Free space เลือก Delete Partition แล้ว Yes เมื่อ dialog box โผล่
  • ตอนนี้ free space กลายเป็น unallocated space ขยาย Windows partition ให้ครอบครองพื้นที่ว่าง: right-click Unallocated space เลือก Extend Volume จาก dropdown
  • Extend Volume Wizard จะเปิด คลิก Next > Next > Finish

จบกระบวนการ จะเห็น volume เดียว หมายถึงคุณ claim disk space กลับมาเป็นของ Windows แล้ว

หลังลบ Linux partitions แล้ว boot loader ของ Ubuntu ยังอยู่ ต้องลบด้วย มีหลายวิธี

ลบ Grub Bootloader

  1. ไปที่ Windows Start menu คลิก power icon กดค้าง Shift และเลือก Restart
  2. ค้าง Shift จนเห็นหน้าจอ Choose an option
  3. เลือก Troubleshoot > Advanced options > Command Prompt เลือก user account จาก Command Prompt options ใส่ password
  4. จะเปิด command-line terminal พิมพ์ bootrec /fixmbr กด Enter ดูข้อความ operation completed successfully
  5. ต่อพิมพ์ bootrec /fixboot > Enter ดูข้อความเดียวกัน พิมพ์ bootrec /scanos > Enter คำสั่งสแกนทุกดิสก์ดู instances ของ Windows OS เวลาขึ้นอยู่กับ specs และจำนวน/ขนาด disks จบการสแกนจะเห็น Windows installations บน disk
  6. เพื่อทำ Windows เป็น primary boot OS พิมพ์ bootrec /rebuildbcd > Enter
  7. ถ้ามี multiple Windows installations จะเห็นรายการทั้งหมดและตำแหน่งบน drive พิมพ์ A > Enter จบกระบวนการ
  8. ปิด terminal พิมพ์ exit > Enter คุณลบทุกอย่างเกี่ยวกับ Ubuntu เรียบร้อย PC จะ boot ตรงเข้ Windows

Overwrite Linux Boot Loader ด้วย Windows Boot Loader

  • Overwrite Linux boot loader: เสียบ USB Windows Installer ที่ดาวน์โหลดมา restart คอมพิวเตอร์
  • หลัง boot จาก USB recovery disk คลิก repair your computer
  • หน้าจอถัดไปเลือก Troubleshoot
  • เลือก Command Prompt จาก Advanced options ถัดไป
  • จาก command prompt window ใส่ bootrec.exe /fixmbr จะ fix Windows boot loader
  • Restart ตอนนี้จะ boot จาก hard drive Windows ทำงานปกติ Linux จะไม่เหลือในระบบ

ถ้าไม่มี Windows Installation CD หรือ USB?

ยัง uninstall Ubuntu dual boot จาก Windows 10 หรือ Ubuntu ได้ ดังนี้

  • จาก Windows 10 รัน command prompt as Administrator
  • รันคำสั่งด้านล่างเพื่อ set EFI executable ที่ถูกต้องเป็น default boot entry:

bcdedit /set "{bootmgr}" path \efi\microsoft\boot\bootmgfw.efi

  • เช็คว่าคำสั่งข้างบนทำงาน: reboot คอมพิวเตอร์ ถ้าสำเร็จ boot ตรงเข้ Windows
  • ลบ partitions: ทำตามขั้นตอนด้านบน เริ่มจากพิมพ์ diskmgmt.msc (section Delete the Linux Partition in Windows)

เปลี่ยน Boot Order ด้วย UEFI

  • เปลี่ยน UEFI boot order โดยตรงจาก firmware (BIOS) settings เข้าถึง BIOS จาก Windows 10: คลิก Start > Settings > Updates & security
  • คอลัมน์ซ้าย คลิก Recovery ภายใต้ Advanced startup คลิก Restart now
  • เลือก Troubleshoot > Advanced options > UEFI Firmware Settings บนหน้าจอ UEFI Firmware Settings คลิก Restart คอมพิวเตอร์จะ restart และโหลดเข้ BIOS

Uninstall Ubuntu จาก Windows 10 dual boot ไมยาก คุณ follow วิธีด้านบนได้หนึ่งในหลายวิธี โดยไม่สูญเสียข้อมูล