Linux/CentOS 读写windows下的NTFS硬盘
Linux/CentOS 要读写windows下的NTFS硬盘要先下载NFTS-3g工具,直接下载并安装:
[root@localhost media]#wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2013.1.13.tgz
[root@localhost media]#tar xfntfs-3g_ntfsprogs-2013.1.13.tgz
[root@localhost media]#cdntfs-3g_ntfsprogs-2013.1.13
[root@localhost media]#./configure
[root@localhost media]#make
[root@localhost media]#make install
二、使用
查看硬盘信息
[root@localhost media]# fdisk -l
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x56c11457
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20972826 7 HPFS/NTFS
/dev/sda2 2612 19452 135275332+ f W95 Ext'd (LBA)
/dev/sda5 2612 8094 44042166 7 HPFS/NTFS
/dev/sda6 8095 13577 44042166 7 HPFS/NTFS
/dev/sda7 13578 13603 204800 83 Linux
/dev/sda8 13603 13864 2097152 82 Linux swap / Solaris
/dev/sda9 13865 19452 44884992 83 Linux
可以看到NTFS的硬盘号有3个,以读写第一个为例(C盘)
[root@localhost media]# cd /media
[root@localhost media]# mkdir sda1
[root@localhost media]# ntfs-3g /dev/sda1 /media/sda1 (挂载C盘)
[root@localhost media]#cd sda1
[root@localhost media]#ls
这就能看到文件信息了,完成!