下载地址: # tar –zxvf _ntfsprogs-2012.1.15.gz # cd _ntfsprogs-2012.1.15 #./configure #make #make install 挂载:mount -t /dev/sdb1 /mnt/windows 这个软件没必要用RPM包,源码安装就很方便
挂载移动硬盘
1、安装gcc编译器
# yum install gcc
中间执行过程中,会问你yes or no,输入:y,回车即可。
2、安装ntfs-3g
# cd /home
# wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz <=下载压缩包
# tar zxvf ntfs-3g_ntfsprogs-2011.4.12.tgz <=解压
# cd ntfs-3g_ntfsprogs-2011.4.12 <=进入解压后的目录
# ./configure <=编译
# make <=安装
# make install <=安装
3、将移动硬盘接入,然后查看文件系统
# fdisk -l
显示结果如下:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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: 0xd10cd10c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 2637 20971520 83 Linux
/dev/sda3 2637 3290 5242880 83 Linux
/dev/sda4 3290 19458 129869824 5 Extended
/dev/sda5 3290 3812 4194304 82 Linux swap / Solaris
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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: 0xcb52b238
Device Boot Start End Blocks Id System
/dev/sdb1 1 19457 156288321 f W95 Ext'd (LBA)
/dev/sdb5 1 5223 41953684+ 7 HPFS/NTFS
/dev/sdb6 5224 11752 52444161 7 HPFS/NTFS
/dev/sdb7 11753 19457 61890381 7 HPFS/NTFS
可以看出,我的/dev/sdb5、/dev/sdb6、/dev/sdb7都是ntfs文件系统
4、挂载分区
# cd /mnt
# mkdir winc
# mount -t ntfs-3g /dev/sdb5 /mnt/winc
5、进入分区查看内容并进行其他操作
# cd winc
# ls
说明:当时我第一次把/dev/sdb5挂载完成后,进行操作时,还出了一点小状况:
# cd winc
# ls
# cd tools
# ls
进行如上操作时,突然提示:
ls: 正在读取目录.: 输入/输出错误
即便是回到winc目录执行再执行ls命令也提示类似错误
回到mnt目录执行ls -l命令,类似:
?--------- ? ? ? ? ? winc
这里的权限、用户、用户组、大小、时间等等信息都变成问号了
后来又执行fdisk -l命令,结果发现:
……以上省略……
Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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: 0xcb52b238
Device Boot Start End Blocks Id System
/dev/sdc1 1 19457 156288321 f W95 Ext'd (LBA)
/dev/sdc5 1 5223 41953684+ 7 HPFS/NTFS
/dev/sdc6 5224 11752 52444161 7 HPFS/NTFS
/dev/sdc7 11753 19457 61890381 7 HPFS/NTFS
NTFS文件系统的设备名从sdb统统变成了sdc,不知是不是因为我不小心碰到移动硬盘还算怎么回事,不管,先将winc卸载,再重新挂载:
# umount /mnt/winc
# mount -t ntfs-3g /dev/sdc5 /mnt/winc
# cd /mnt/winc
# ls
然后一切又都OK了。