Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 掛載 FAT/NTFS 分區完美顯示中文檔名指南

編輯:Linux 教學

Red Hat 系列發行版預設掛載 Windows 分區 (FAT32/NTFS) 時,中文檔名常顯示為亂碼。本文提供兩種經驗證有效的解決方案,核心在於指定正確的 iocharset 與 codepage 參數。

方案一:使用 linuxconf 圖形化設定 (適用舊版 Red Hat)

  1. 安裝 linuxconf:rpm -ivh linuxconf-*.rpm
  2. 終端執行 linuxconf → File systems → Access local drive
  3. 新增分區:Partition: /dev/hda1、Type: vfat、Mount: /mnt/c
  4. 關鍵參數 Other options 填入:iocharset=gb2312,codepage=936
  5. 其餘欄位 (Dump frequency、Fsck priority、default permission) 填 0
  6. 確定並重啟系統

方案二:直接編輯 /etc/fstab (通用、推薦)

以 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:指定磁碟上儲存編碼 (簡體中文代碼頁)
  • 若系統為 UTF-8 環境,可改用 iocharset=utf8
  • NTFS 分區將 vfat 改為 ntfs 或 ntfs-3g

驗證與注意事項

  1. 掛載前確保掛載點目錄已建立:mkdir -p /mnt/c
  2. 執行 mount -a 測試無誤後重啟
  3. 若已掛載,先 umount 再重新掛載生效
  4. XMMS 等播放器即可正常顯示中文歌單

總結

核心在於 iocharset + codepage 雙參數匹配。現代發布版 (Ubuntu/CentOS 7+) 多預設 UTF-8,通常只需 iocharset=utf8 即可;舊版中文環境則用 gb2312/936 組合。編輯 /etc/fstab 為一次設定永久生效的最佳實踐。

Copyright © Windows教程網 All Rights Reserved