参考网页:
https://wiki.centos.org/zh/TipsAndTricks/NTFS?highlight=%28ntfs%29#note_for_cplus
http://www.tuxera.com/community/open-source-ntfs-3g/
步骤:
1、下载ntfs-3g源码包
http://www.tuxera.com/community/open-source-ntfs-3g/
下载的包是.tgz格式的;
2、解压:tar xzf xxx;
3、读README文件,学习怎样编译安装:
以root权限依次执行:./configure make make install
4、安装后,centos就可以识别NTFS文件系统的分区,执行fdisk -l命令查看磁盘分区状况,里面应该能显示出NTFS文件系统的分区:能表示成功;
[root@flt media]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xad38ad38
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6528 52436128+ 7 HPFS/NTFS
Partition 1 does not start on physical sector boundary.
/dev/sda2 42823 60801 144416286 7 HPFS/NTFS
Partition 2 does not start on physical sector boundary.
/dev/sda3 6529 20220 109977600 83 Linux
/dev/sda4 20220 42823 181553152 5 Extended
/dev/sda5 20220 22831 20971520 83 Linux
/dev/sda6 22831 23066 1888256 82 Linux swap / Solaris
5、挂载NTFS文件系统所在的分区到centos目录下,通常是/mnt:
(参考:来自http://www.tuxera.com/community/open-source-ntfs-3g/
挂载:If there was no error during installation then the NTFS volume can be mounted in read-write mode for everybody as follows. Unmount the volume if it had already
been mounted, replace /dev/sda1 and /mnt/windows, if needed.
mount -t ntfs-3g /dev/sda1 /mnt/windows
Please see the NTFS-3G Manual for more options and examples.
或系统启动时自动挂载:You can also make NTFS to be mounted during boot by adding the following line to the end of the /etc/fstab file:
/dev/sda1 /mnt/windows ntfs-3g defaults 0 0
)
第4步显示有两个NTFS文件系统的分区,在我的笔记本上这两个分区实际上一个是我的windows xp的C盘(/dev/sda1),一个是F盘(/dev/sda2):
5.1 创建/mnt/winC,挂载/dev/sda1分区: mkdir /mnt/winC , mount -t ntfs-3g /dev/sda1 /mnt/winC
5.2 创建/mnt/winF,挂载/dev/sda2分区: mkdir /mnt/winF , mount -t ntfs-3g /dev/sda2 /mnt/winF
5.3 实现系统启动时两个NTFS文件系统自动挂载:
在/etc/fstab文件末尾添加下面一行: /dev/sda1 /mnt/windows ntfs-3g defaults 0 0