Red Hat 系列發行版預設掛載 Windows 分區 (FAT32/NTFS) 時,中文檔名常顯示為亂碼。本文提供兩種經驗證有效的解決方案,核心在於指定正確的 iocharset 與 codepage 參數。
linuxconf:rpm -ivh linuxconf-*.rpmlinuxconf → File systems → Access local drivePartition: /dev/hda1、Type: vfat、Mount: /mnt/cOther options 填入:iocharset=gb2312,codepage=936Dump frequency、Fsck priority、default permission) 填 0以 root 身分編輯 /etc/fstab,新增或修改掛載行:
/dev/hda1 /mnt/c vfat defaults,iocharset=gb2312,codepage=936 0 0
/dev/hda5 /mnt/d vfat defaults,iocharset=gb2312,codepage=936 0 0
/dev/hda6 /mnt/e vfat defaults,iocharset=gb2312,codepage=936 0 0
...
參數說明:
iocharset=gb2312:指定 Linux 端顯示編碼codepage=936:指定磁碟上儲存編碼 (簡體中文代碼頁)iocharset=utf8vfat 改為 ntfs 或 ntfs-3gmkdir -p /mnt/cmount -a 測試無誤後重啟umount 再重新掛載生效核心在於 iocharset + codepage 雙參數匹配。現代發布版 (Ubuntu/CentOS 7+) 多預設 UTF-8,通常只需 iocharset=utf8 即可;舊版中文環境則用 gb2312/936 組合。編輯 /etc/fstab 為一次設定永久生效的最佳實踐。