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.

 

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

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

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • micropython教程(Python集成开发环境)

    本文旨在通过一个简单的demo,介绍基于Python3、PyQT5的环境下开发桌面应用程序的一种方案,当然开发Python的桌面应用程序不止是PyQT这一种方案,还可以使用Python自带的Tkinter来实现。本文目录:1.安装依赖环境2.安装Eric63.配置Eric4.创建窗口应用4.1创建窗体UI4.2实现代码逻辑参考资料:1.安装依赖环境Eric6官网:htt…

    2022年4月17日
    108
  • C ReadProcessMemory

    C ReadProcessMemoryReadProcessMemory函数用于读取其他进程的数据。BOOLSTDCALLReadProcessMemory( HANDLE hProcess, LPCVOID lpBaseAddress, LPVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead ){ NTSTATUSStatus…

    2022年10月4日
    4
  • java中的static关键字的作用?

    java中的static关键字的作用?是静态修饰符,什么叫静态修饰符呢?大家都知道,在程序中任何变量或者代码都是在编译时由系统自动分配内存来存储的,而所谓静态就是指在编译后所分配的内存会一直存在,直到程序退出内存才会释放这个空间,也就是只要程序在运行,那么这块内存就会一直存在。这样做有什么意义呢?在Java程序里面,所有的东西都是对象,而对象的抽象就是类,对于一个类而言,如果要使用他的成员,那么普通情况下必须先实例化对象后,通过对象

    2022年7月8日
    22
  • 如何解决win7开机提示未能连接一个Windows服务「建议收藏」

    如何解决win7开机提示未能连接一个Windows服务「建议收藏」1.以安全模式打开电脑;2.打开运行菜单,在运行对话框中输入CMD,回车打开命令对话框;3.然后在命令对话框中输入“NETSHWINSOCKRESETCATALOG”命令,点击Enter;4.重启电脑。

    2022年5月15日
    51
  • 泰克|安捷伦|普源|PICO示波器程控软件二次开发NS-Scope

    泰克|安捷伦|普源|PICO示波器程控软件二次开发NS-Scope*主要功能:硬件连接;参数配置;运行参数;数据查询。*程控对象:示波器。*程控接口:兼容市面上所有具有GPIB、USB、RS232、LAN、RS485、TTL任意一种程控接口的示波器。*仪器兼容性:泰克Tektronix、是德科技Keysight、普源Rigol、力科、罗德与施瓦茨R&S等品牌示波器。1.软件概述>>为了解决示波器测试操作流程繁琐、参数配置复杂等问题,Namisoft开发的NS-Scope示波器自动化测试程控软件,通过对示波器的程序控制,…

    2022年10月12日
    3
  • 多线程CreateThread函数的用法

    多线程CreateThread函数的用法CreateThread当使用CreateProcess调用时,系统将创建一个进程和一个主线程。CreateThread将在主线程的基础上创建一个新线程,大致做如下步骤:1在内核对象中分配一个线程标

    2022年7月4日
    34

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

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