Welcome 微信登录

首页 / 操作系统 / Linux / 如何使Linux支持NTFS分区

大家都知道Linux默认是不支持NTFS分区类型的,但是如果你的计算机是双系统的话,使Linux支持NTFS分区是不是一件很开心的事!这样就可以轻松问Windows盘上面的资料了也可以在Windows下往Linux磁盘里传资料。其实Linux是可以通过安装相应的软件实现对NTFS分区类型的支持的,下面我就介绍一下该如何实现1,网上下载ntfs-3g_ntfsprogs软件源码包,并解压到桌面[root@localhost Desktop]# lsntfs-3g_ntfsprogs-2013.1.13.tgz[root@localhost Desktop]# tar -zxvfntfs-3g_ntfsprogs-2013.1.13.tgz -C ./2,准备源码包的安装环境[root@localhost ~]#yum install gc* -y……配置gcc、g++开发环境Failed to set locale, defaulting to CLoaded plugins: product-id, security, subscription-managerThis system is not registered to Red Hat SubscriptionManagement. You can use subscription-manager to register.Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package gcc.x86_64 0:4.1.2-54.el5 set to beupdated………………………………………..…………………………….3,进入解压目录,执行配置文件[root@localhost ntfs-3g_ntfsprogs-2013.1.13]#./configure checking build system type...x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type...x86_64-unknown-linux-gnuchecking for a BSD-compatible install.../usr/bin/install –c…………………………………………………………..…….4,编译并安装[root@localhost ntfs-3g_ntfsprogs-2013.1.13]#make&&make install……………………………..……………5,给sda添加一个分区,并指定文件类型[root@localhost ~]# fdisk /dev/sdaThe number of cylinders for this disk is set to10443.There is nothing wrong with that, but this is largerthan 1024,and could in certain setups cause problems with:1) software that runs at boot time (e.g., oldversions of LILO)2) booting and partitioning software from other OSs(e.g., DOSFDISK, OS/2 FDISK)Command (m for help): n……添加一个分区First cylinder (4103-10443, default 4103): Using default value 4103Last cylinder or +size or +sizeM or +sizeK(4103-10443, default 10443): +10G……大小10GCommand(m for help): t…...指定分区类型Partition number (1-6): 6……选择第二块逻辑分区Hex code (type L to list codes): 7……类型号7为NTFSChanged system type of partition 6 to 7 (HPFS/NTFS)Command (m for help): p……查看结果 Disk /dev/sda: 85.8 GB, 85899345920 bytes255 heads, 63 sectors/track, 10443 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDeviceBoot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 2624 20972857+ 83 Linux/dev/sda3 2625 2885 2096482+ 82 Linux swap / Solaris/dev/sda4 2886 10443 60709635 5 Extended/dev/sda5 2886 4102 9775521 83 Linux/dev/sda6 4103 5319 9775521 7 HPFS/NTFSCommand (m for help):w……写入 6,格式化新的分区[root@localhost ~]# partprobe ……重新获取分区信息Warning: Unable to open /dev/sr0 read-write(Read-only file system). /dev/sr0 hasbeen opened read-only.[root@localhost ~]# mkfs.ntfs /dev/sda6……用ntfs类型格式化磁盘Failed to set locale, using default "C".Cluster size has been automatically set to 4096bytes.Initializing device with zeroes: 100% - Done.Creating NTFS volume structures.mkntfs completed successfully. Have a nice day.7,创建/NTFS/文件夹[root@localhost ~]# mkdir -p /NTFS/8,把sda6挂载到新建的NTFS下[root@localhost ~]# mount -tntfs-3g /dev/sda6 /NTFS/ ……挂载指定文件系统为ntfs-3g否则将 不能挂载9,查看挂载信息[root@localhost ~]# df -lTFilesystem Type 1K-blocks Used Available Use% Mounted on/dev/sda2 ext3 20315844 2713692 16553512 15% //dev/sda1 ext3 101086 12200 83667 13% /boot/dev/sda6 fuseblk 9775520 49624 9725896 1% /NTFStmpfs tmpfs 511920 0 511920 0% /dev/shm10,以上挂载在重启后将失效,所以需要配置sda6开机自动挂载[root@localhost ~]# vim /etc/fstab  LABEL=/ / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gid=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0LABEL=SWAP-sda3 swap swap defaults 0 0/dev/sda6 /NTFS ntfs-3g defaults 0 0 fstab中ntfs文件类型指定为ntfs-3g否则将不能开机自动挂载RedHat Linux 5忘记root密码后重置密码Linux开机自动挂载相关资讯      Linux支持NTFS分区  Linux NTFS  本文评论 查看全部评论 (0)
表情: 姓名: 字数