Mount NTFS Partitions

Mount NTFS PartitionsMountNTFSPartitions18January2007Windowsusesadifferentfilesystem(NTFS)tostorefiles.InorderforFedoratoreadthatfilesystem,yourequireNTFSsupportinyourkernel.Youcaneither

大家好,又见面了,我是你们的朋友全栈君。

Mount NTFS Partitions

18 January 2007

Windows uses a different filesystem (NTFS) to store files. In order for Fedora to read that filesystem, you require NTFS support in your kernel. You can either recompile your kernel for NTFS read support -OR- obtain the proper kernel module.

NOTE: For users who upgraded from FC5 please first read the known bugs and problems.

To setup NTFS access you must (1) install NTFS support, (2) check how many partitions you have, (3) create mount points, (4) mount partitions, and (5) update fstab to mount at next boot.

NOTE: Previously Livna was recommended. However that solution has been known to be problematic in that it may update your kernel, which is normal behaviour. It is recommended to use NTFS-3G instead as it is supported in Fedora Extras and does NOT require kernel updates/upgrades. NTFS-3G also provides safe read-write access. (However SELinux may cause some problems for NTFS-3G.)

1. Install NTFS Support

For yum users:

[mirandam@charon ~]$ sudo yum install fuse fuse-libs ntfs-3g ntfsprogs ntfsprogs-gnomevfs

Users without yum, download fuse, fuse-lib and ntfs-3g (ntfsprogs and ntfsprogs-gnomevfs are optional) from Fedora Extras. Save them to a separate directory (ntfs). They are less than 1MB download.

[mirandam@charon downloads]$ cd ntfs
[mirandam@charon ntfs]$ sudo rpm -ivh fuse* ntfs*

No kernel version checking is required, so long as you are using a FC6 kernel.

2. Check Your Partitions

Use fdisk to list partitions. Most ATA hard drives will be /dev/hda. Drives may also show up as /dev/hdb, /dev/sda depending on your configuration.

[mirandam@charon ~]$ sudo /sbin/fdisk -lu /dev/hda | grep NTFS
/dev/hda1 * 63 33559784 16779861 7 HPFS/NTFS
/dev/hda2 33559785 67119569 16779892+ 7 HPFS/NTFS
/dev/hda3 67119570 100679354 16779892+ 7 HPFS/NTFS

Usually the first will be a drive “letter”: C drive, next D, etc. Hence /dev/hda1 is my C:/ drive used by Windows.

3. Create Mount Points

For every partition in step 2 that you wish to access, you will need a “mount point”. A mount point is just a directory. Common directories are: /media/ and /mnt/. Use whichever, but be consistent.

[mirandam@charon ~]$ cd /media/
[mirandam@charon media]$ sudo mkdir c_drive d_drive e_drive

You do not have to use these names, if you prefer to create folders such as movies, documents, or winxp, any name will work (without spaces).

4. Mount Partitions

Using the above kernel module, we can only mount the NTFS partition read-only and we set the permissions so all users can read the contents of each partition.

[mirandam@charon ~]$ sudo mount /dev/hda1 /media/c_drive -t ntfs-3g -r -o umask=0222
[mirandam@charon ~]$ sudo mount /dev/hda2 /media/d_drive -t ntfs-3g -r -o umask=0222
[mirandam@charon ~]$ sudo mount /dev/hda3 /media/e_drive -t ntfs-3g -r -o umask=0222

Read/Write Access: The above is for read-only access. In order to mount read/write, you must use the -rw -o umask=0000. Example:

[mirandam@charon ~]$ sudo mount /dev/hda1 /media/c_drive -t ntfs-3g -rw -o umask=0000

HIGHLY RECOMMENDED: Please run man mount to understand what umask= does.

5. Update /etc/fstab

Every time Fedora boots, the partitions must be mounted. To automatically mount, you must edit /etc/fstab.

Open /etc/fstab in an editor: (use nano instead of gedit if you do not have a GUI)

[mirandam@charon ~]$ sudo gedit /etc/fstab

Add these lines to the END of the file:

/dev/hda1   /media/c_drive     ntfs-3g    ro,defaults,umask=0222 0 0
/dev/hda2 /media/d_drive ntfs-3g ro,defaults,umask=0222 0 0
/dev/hda3 /media/e_drive ntfs-3g ro,defaults,umask=0222 0 0

Read/Write Access: The above is for read-only access. In order to mount read/write, you must use the rw,defaults,umask=0000. Example:

/dev/hda1   /media/c_drive     ntfs-3g    rw,defaults,umask=0000 0 0

Done!

NOTE: SELinux Problems

Users of SELinux will fix Fedora blocks the automounting of ntfs partitions when using NTFS-3G. This is a Fedora/SELinux bug, not NTFS-3G. Some support can be found on the NTFS-3G support page.. However for now users can mount everything when they log in by running:

[mirandam@charon ~]$ sudo mount -a

NOTE for FAT32 users

If you have FAT32 or FAT16 partitions, instead of ntfs-3g above you can use vfat to mount your partitions. No extra modules or downloads are required, this is built into the kernel. Just replace vfat for every place we have ntfs-3g when mounting and when editting /etc/fstab.

FAT32/FAT16 read and write is supported. If you wish to mount read/write, then use: '-rw' for Step 4. Mounting Partitions, and 'rw,defaults,umask=0000 0 0' for Step 5. Updating /etc/fstab.

NOTE for Livna NTFS Modules

The Livna NTFS modules are read-only access. I do not recommend using them due to the kernel dependancy. If you require them or NTFS-3G will not work then first setup the Livna repository. Then you can install them:

[mirandam@charon ~]$ sudo yum install kmod-ntfs

For all the above changes you should use ntfs instead of ntfs-3g.

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/153312.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • R语言绘制火山图_r语言画曲线图

    R语言绘制火山图_r语言画曲线图基因表达差异火山图提到差异火山图,相信很多同学肯定不陌生。因为形似火山(喷发),所以称为火山图。差异火山图最常见于转录组数据的分析中,在基因表达层面,用于展示两组间表达量上调和下调的基因。常规的火山图中主要包含了两个重要信息,差异表达倍数(FoldChange值,简称FC,作图时会对FC进行log转化,根据logFC值的正负判断这些基因的表达量是上调了还是下调了)以及统计学显著性p值(p-value,通常是FDR校正后的p值,根据校正后p值判断基因表达量上调或下调是否具有显著性)。因此在判..

    2022年10月19日
  • Activiti工作流使用之流程结构介绍[通俗易懂]

    Activiti工作流使用之流程结构介绍[通俗易懂]Activiti工作流使用之流程结构介绍文章目录Activiti工作流使用之流程结构介绍一、工作流介绍1.1概述1.2常见工作流二、工作流术语2.1工作流引2.2BPM2.3BPMN2.4流对象三、Activiti结构3.1Activiti系统服务结构图3.2Activiti数据库结构四、流程步骤4.1部署Activiti4.2流程定义4.3流程定义部署4.4启动一个流程实例4.5用户查询代办任务(Task)4.6用户已办任务历史记录4.6用户已办任务历史记录一、工作流介绍

  • 二级java程序设计--Java SDK6.0的下载和操作[通俗易懂]

    二级java程序设计--Java SDK6.0的下载和操作[通俗易懂]二级java程序设计--JavaSDK6.0的下载和操作

  • Python 列表元素字符串转浮点

    Python 列表元素字符串转浮点在网络爬虫或者读取文件中的数据时,很多时候读取出来的数值是字符串形式的,这些字符串形式的数据并不能用来作计算或者更深入的操作,因此我们需要把他们转换为数值的形式。简单粗暴的for循环假设,这里有一个以字符串形式存储数值的列表,具体如下:a=[‘2′,’3.5′,’10’,’88’,’32.66′]我们需要将其转换为浮点的形式,最简单粗暴直接的方法,可以使用…

  • 按位取反怎么运算_按位取反运算

    按位取反怎么运算_按位取反运算读本文前请首先搞懂“反码”,“取反”,“按位取反(~)”,这3个概念是不一样的。取反:0变1,1变0反码:正数的反码是其本身,对于负数其符号位不变其它各位取反(0变1,1变0)按位取反(~):这将是下面要讨论的。“~”运算符在c、c++、java、c#中都有,之前一直没有遇到这个运算符。要弄懂这个运算符的计算方法,首先必须明白二进制数在内存中的存放形式,二

  • 基于阿里DDNS的ipv6 for windows版软件

    基于阿里DDNS的ipv6 for windows版软件基于阿里DDNS的ipv6forwindows版软件会搜到这篇帖子的同学,应该和我一样,满世界为自己的虚拟主机找寻ipv6的动态ddns程序吧?下面我先说说我的折腾故事:因为买了群晖,然后发现需要公网ip,但公网ip现在电信要钱了,开口100元一个月,挺黑的。没办法尝试了各种内网穿透,这类帖子网上很多,就不细说了,总之是各种折腾,各种不爽,最终选择了零遁伴侣做内网穿透还算稳定,速度也不错。…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号