多重開機環境下,Linux 與 Windows 互相存取對方分區是剛需。Linux 核心原生支援 FAT12/16/32、NTFS (唯讀/讀寫)、ext2/3/4;Windows 需第三方工具讀取 Linux 分區。本文系統整理雙向存取方案、工具選擇、掛載參數與常見陷阱。
# 查看已編譯支援
grep -i fat /boot/config-$(uname -r)
grep -i ntfs /boot/config-$(uname -r)
# CONFIG_FAT_FS=y, CONFIG_VFAT_FS=m, CONFIG_NTFS_FS=m (或 y)
若為模組 (=m) 需手動載入:modprobe vfat、modprobe ntfs (或 ntfs3 核心 5.15+)。
mkdir /mnt/win_d
mount -t vfat /dev/hda5 /mnt/win_d -o iocharset=utf8,umask=000,codepage=936
# 參數說明:
# iocharset=utf8 檔名編碼轉換 (中文檔名正常顯示)
# codepage=936 碼頁 (簡體中文 CP936)
# umask=000 全部用戶可讀寫執行
# uid=1000,gid=1000 指定擁有者 (避免 root 獨佔)
寫入 /etc/fstab 實現開機自動掛載:
/dev/hda5 /mnt/win_d vfat defaults,iocharset=utf8,codepage=936,umask=000 0 0
核心舊版驅動 (ntfs.ko, 唯讀):
mount -t ntfs /dev/hda1 /mnt/win_c -o ro,iocharset=utf8
現代方案:NTFS-3G (FUSE 用戶空間驅動,完整讀寫):
yum install ntfs-3g # 或 apt-get install ntfs-3g
mount -t ntfs-3g /dev/hda1 /mnt/win_c -o defaults,locale=zh_TW.UTF-8
# fstab
/dev/hda1 /mnt/win_c ntfs-3g defaults,locale=zh_TW.UTF-8 0 0
核心 5.15+ 新驅動 ntfs3:mount -t ntfs3 /dev/hda1 /mnt/win_c (原生讀寫,效能優於 FUSE)。
metadata_csum、64bit 特性,或使用新版 0.69+)。wsl --mount \\.\PHYSICALDRIVE1 --partition 2 --type ext4 掛載實體分區至 WSL。\\wsl$\Ubuntu\mnt\... 路徑在 Windows 檔案總管存取。EXT2 TOOLS (DOS/GCC 編譯、命令列 e2ls, e2cp...)LREAD (DOS 介面 ldir, lread)FSDEXT2 (Win32 唯讀掛載)| 問題 | 原因 | 解決 |
|---|---|---|
| 中文檔名亂碼 | 編碼/碼頁不匹配 | 掛載加 iocharset=utf8,codepage=936 (FAT) 或 locale=zh_TW.UTF-8 (NTFS-3G) |
| NTFS 掛載報錯 "The disk contains an unclean file system" | Windows 快速啟動/休眠未完全關機 | Windows 完整關機 (shutdown /s /t 0) 或關閉快速啟動;或掛載加 remove_hiberfile (ntfs-3g) |
| ext4 掛載失敗 "unknown filesystem type" | 核心缺 ext4 模組 / 特性不支援 | modprobe ext4;工具升級至支援 ext4 新特性版本 |
| 寫入 ext3/4 權限錯誤 | Windows 不理解 Linux 權限位 | Ext2Fsd 設定預設 uid/gid/umask;或 WSL 內操作 |
ro) 最安全。