让你的Linux支持NTFS文件系统的读写

系统环境默认安装后,不能访问ntfs分区,在安装和配置ntfs-3g以后即可
1.安装ntfs-3g
apt-get -y install ntfs-3g
2.创建挂载的文件夹
我windows下面有三个磁盘.都需要访问。所以在/mnt中新建了三个文件夹,分别是/mnt/C、/mnt/D、/mnt/E
3.挂载分区
首先使用fdisk命令查看目前磁盘情况

debian-hcshangxinli:/home/shang# fdisk -l
 
Disk /dev/sda: 74.7 GB, 74743119872 bytes
240 heads, 21 sectors/track, 28964 cylinders
Units = cylinders of 5040 * 512 = 2580480 bytes
Disk identifier: 0xf0b1ebb0
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        6096    15361909+   7  HPFS/NTFS
/dev/sda2            6097       16796    26964000    f  W95 Ext'd (LBA)
/dev/sda3           16797       28964    30663360    7  HPFS/NTFS
/dev/sda5            6097       16796    26963989+   7  HPFS/NTFS
 
Disk /dev/hda: 10.2 GB, 10242892800 bytes
255 heads, 63 sectors/track, 1245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x6f75ea16
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          31      248976   83  Linux
/dev/hda2              32        1245     9751455   8e  Linux LVM

 大家可以看到,我在80G硬盘上安装了windows的系统,10G的硬盘上安装了debian。
/dev/sda1对应windows中的C盘
/dev/sda2对应windows中的D盘
/dev/sda5对应windows中的E盘
挂在命令如下

mount -t ntfs-3g /dev/sda1 /mnt/C
mount -t ntfs-3g /dev/sda3 /mnt/D
mount -t ntfs-3g /dev/sda5 /mnt/E

4.设置开机自动挂载

把这三条语句增加到/etc/fstab文件中即可
/dev/hdb1 /mnt/C ntfs-3g defaults 0 0
/dev/hdb3 /mnt/D ntfs-3g defaults 0 0
/dev/hdb3 /mnt/E ntfs-3g defaults 0 0

猜你喜欢

转载自hudeyong926.iteye.com/blog/1063369
今日推荐