直接掛載時出現:
mount –t ntfs /dev/sdb1 /mnt/usb
mount: unknown filesystem type 'ntfs'
這是因為 CentOS 5.3 無法辨識 NTFS 格式的分區。之所以會遇到這狀況,是因為要拷貝單檔大於 4GB 的檔案,在 Windows 上只能先格式化成 NTFS,再把硬碟插到伺服器。
前往 https://www.tuxera.com/community/ntfs-3g-download/ 下載最新穩定版(當時為 ntfs-3g-2010.8.8.tgz),放到 CentOS 後編譯安裝:
# ./configure
# make
# make install # 或 sudo make install
# fdisk -l
Disk /dev/sda: 154.7 GB, 154750418432 bytes
255 heads, 63 sectors/track, 18814 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 18814 151019032+ 8e Linux LVM
Disk /dev/sdb: 500.1 GB, 500107861504 bytes
255 heads, 62 sectors/track, 61781 cylinders
Units = cylinders of 15810 * 512 = 8094720 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 61782 488384000+ 7 HPFS/NTFS
可以看到 /dev/sdb1 就是那顆 NTFS 硬碟。
# mount –t ntfs-3g /dev/sdb1 /mnt/usb
關鍵在於把檔案系統類型寫成 ntfs-3g,而不是 ntfs。
# umount –l /mnt/usb
-l 是 lazy umount,當裝置仍被占用時特別好用;若系統沒有忙碌程序,直接 umount /mnt/usb 即可。