前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ntfs-3g的安装与配置

ntfs-3g的安装与配置

作者头像
py3study
发布2020-01-15 12:48:04
1.8K0
发布2020-01-15 12:48:04
举报
文章被收录于专栏:python3

NTFS分区的创建,挂载,使用

下载NTFS-3G源码包的方式

1,http://www.ntfs-3g.org

2,wget http://www.ntfs-3g.org/ntfs-3g-1.1120.tgz

示例:

将/dev/sda5磁盘分区格式化为NTFS分区,并用ntfs-3g来加载NTFS分区。

步骤:

第一步:解压源码包

tar zxvf ntfs-3g_ntfsprogs-2013.1.13.tgz  -C /usr/src/

第二步:编译安装(注:编译安装之前需要先安装gcc工具)

cd /usr/src/ ntfs-3g_ntfsprogs-2013.1.13/

./configure --prefix=/opt/ntfs

make

make install

第三步:使用fdisk将/dev/sda5的分区类型改为7,即HPFS/NTFS格式并格式化

[root@localhost /]# fdisk /dev/sda

The number of cylinders for this disk is set to 10443.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

  (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): t//t为修改分区类型

Partition number (1-5): 5//sda5为第五个分区

Hex code (type L to list codes): 7//指定为7,如果不知道可输入L查看详细信息

Command (m for help): w//w为保存退出

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@localhost /]# mkfs.ntfs /dev/sda5//将/dev/sda5分区格式化为ntfs格式

[root@localhost /]# fdisk -l /dev/sda | grep NTFS//查看NTFS分区

/dev/sda5            2825        5257    19543041    7  HPFS/NTFS

第四步:临时装载NTFS分区

[root@localhost /]# ntfs-3g /dev/sda5 /data/ntfs///装载ntfs分区,此处胡ntfs-3g就相当于mount

[root@localhost /]# mount | grep sda5

/dev/sda5 on /data/ntfs type fuseblk (rw,allow_other,blksize=4096)

[root@localhost /]#

注:临时挂载成功,这一步位置,已经完成了NTFS的临时挂载。

第五步:如果需要设置开机自动挂载该NTFS分区,需要在/etc/fstab文件里面增加内容

格式为:

[root@localhost /]# cat /etc/fstab | grep sda5

/dev/sda5               /data/ntfs              ntfs-3g defaults        0 0

[root@localhost /]#

第六步:验证

[root@localhost /]# umount /data/ntfs///卸载挂载点

[root@localhost /]# mount | grep sda5//查看是否卸载成功

[root@localhost /]# mount -a//加载所有fstab已配置的文件系统

注:如果用mount -a能够加载/dea/sda5的话,那么重启肯定能加载。

[root@localhost /]# mount | grep sda5//可以看到,挂载成功了!

/dev/sda5 on /data/ntfs type fuseblk (rw,allow_other,blksize=4096)

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/07/10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档