Quantcast
Channel: SQLParty »文件系统
Viewing all articles
Browse latest Browse all 3

Linux下mount NTFS文件系统

$
0
0

在PC上安装了双系统Linux(CentOS 6.3)+XP,但是CentOS下无法访问XP下的NTFS文件系统,咋整呢?

查了下网络,有两种方案,一种是安装内核模块,可到 http://sourceforge.net/projects/linux-ntfs/files/ 下载,需下载与你系统内核想对应的版本,使用uname -a 查看当前内核版本。安装后就可以使用mount -t ntfs /dev/sda1 /mnt 挂载了。这种方法问题在于挂载的ntfs分区是只读的。

这里选择另外一种方案:安装ntfs-3g,使用ntfs-3g挂载的分区就是可读写的了。

具体安装方式如下:

1.下载

下载页面 http://www.tuxera.com/community/ntfs-3g-download/

shell> wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2013.1.13.tgz

ntfs-3g

2.安装

shell> tar -zxvf ntfs-3g_ntfsprogs-2013.1.13.tgz
shell> cd ntfs-3g_ntfsprogs-2013.1.13
shell> ./configure
shell> make
shell> make install  #这步需要root权限

3.使用

查看现有分区情况

shell> fdisk -l

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 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: 0x0fa96ec5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        2618    21029053+   c  W95 FAT32 (LBA)
/dev/sdb2           10573       10636      512000   83  Linux
/dev/sdb3           10636       14594    31788032   8e  Linux LVM
/dev/sdb4            2619       10572    63890505    f  W95 Ext’d (LBA)
/dev/sdb5            2619        7244    37158313+   7  HPFS/NTFS
/dev/sdb6            7245        9870    21086863    7  HPFS/NTFS
/dev/sdb7            9871       10572     5638783+   b  W95 FAT32

创建目录用于挂载

shell> mkdir -p /media/disk1
shell> mount -t ntfs-3g /dev/sdb5 /media/disk1
shell> ls -lrt /media/disk1
总用量 717393
drwxrwxrwx. 1 root root      4096 3月  31 2009 grub4dos-0.4.4
-rwxrwxrwx. 1 root root   1084192 1月  20 2010 wubi.exe
-rwxrwxrwx. 2 root root       226 1月  21 2010 README.diskdefines
-rwxrwxrwx. 1 root root         0 1月  21 2010 ubuntu
-rwxrwxrwx. 1 root root      5338 1月  21 2010 md5sum.txt
drwxrwxrwx. 1 root root      4096 8月   7 2010 System Volume Information

测试读写

shell> cd /media/disk1
shell> cat md5sum.txt
shell> touch newfile

都没问题,OK!

方便起见,开机自动挂载:

在/etc/fstab中添加:

/dev/sdb5 /media/disk1  ntfs-3g default 0 0
/dev/sdb6 /media/disk2  ntfs-3g default 0 0

Done!

参考:
http://ohyeahbbs.blog.51cto.com/1775490/865107

The post Linux下mount NTFS文件系统 appeared first on SQLParty.


Viewing all articles
Browse latest Browse all 3

Trending Articles