个人工具

UbuntuHelp:MountingWindowsPartitions/ThirdPartyNTFS3G

来自Ubuntu中文

Wikibot讨论 | 贡献2009年5月14日 (四) 16:54的版本

跳转至: 导航, 搜索

Discuss this page IconsPage?action=AttachFile&do=get&target=IconSambaShares.png NTFS (New Technology File System) is a file system developed by Microsoft and used by Windows computers (Windows 2000 and later). Until 2007, linux was not able to write to this type of filesystem, it could only read from it. The stable ntfs-3g driver now allows linux systems to read and write NTFS formatted partitions.

Installation

Ubuntu 8.10 (Intrepid Ibex) and Ubuntu 8.04 LTS (Hardy Heron)

The ntfs-3g packages comes pre-installed with the newest versions of Ubuntu, but you still need to install ntfs-config if you want the GUI configuration tool. You can search for "ntfs-config" in Synaptic or install via terminal:

sudo apt-get install ntfs-config

You may now continue to the Configuration section.

Ubuntu 7.10 (Gutsy Gibbon)

In Feisty, the ntfs-3g and ntfs-config packages are in the universe repository. In Gutsy, the ntfs-config packages is in universe and ntfs-3g is in the main repository. You can search for "ntfs-config" (which has "ntfs-3g" as a dependency) in Synaptic or install via terminal:

sudo apt-get install ntfs-config

You may now continue to the Configuration section.

Ubuntu 6.06 LTS (Dapper Drake)

First you need to add the following repository:

 
deb http://flomertens.free.fr/ubuntu/ dapper main main-all

Authorizing the Repository: Packages are authenticated with a gpg key. To use it, you should execute the the following command:

wget http://flomertens.free.fr/ubuntu/givre_key.asc -O- | sudo apt-key add -

Be sure to reload the package configuration and update your system before continuing:

sudo apt-get update
sudo apt-get upgrade

It is advised to reboot now, so the hal changes can take effect. You can now search for "ntfs-config" (which has "ntfs-3g" as a dependency) in Synaptic or install via terminal:

sudo apt-get install ntfs-config

Configuration

Now you have the choice between an automatic configuration using ntfs-config or a manual configuration.

The Automatic Way

IconsPage?action=AttachFile&do=get&target=navigate.png Launch NTFS Configuration Tool from Applications->System Tools, or via the terminal:

gksudo ntfs-config

ThirdPartyNTFS3G?action=AttachFile&do=get&target=ntfs-config.png If you have at least one internal NTFS partition, it will allow you to check both boxes, otherwise you can only check the box for external devices. If your NTFS partition(s) are not yet configured, it will ask you to choose a name that will be used as the mount point (please no spaces). Then enable write support for internal and/or external devices.

The Manual Way

IconsPage?action=AttachFile&do=get&target=IconGNOMETerminal.png First you need to find the device location of the NTFS partition(s) you want to mount. In terminal, run:

sudo fdisk -l | grep NTFS | awk '{print $1}'

The name of each partition should be something like /dev/hdxn or /dev/sdxn, where x is an alphabetical letter (ranges from a to z) and n is a number (e.g. /dev/hda1). If the drive is internal, you will now need to edit your file systems table configuration file, /etc/fstab. If the drive is an external USB or firewire drive, hal should automount it. Now, be sure to save a backup of fstab first, then open the file for editing:

sudo cp /etc/fstab /etc/fstab.orig
gksudo gedit /etc/fstab

After entering your password, find the line that matches the device location you just found and change it to the following. If there is no entry yet, add a new line like the following:

<your partition> /media/<mount point> ntfs-3g defaults,locale=en_US.utf8 0 0

NOTE: If it displays your NTFS partition with a UUID, you can check the relevant device location by running one of the following commands. It is OK (and even advisable) to keep the UUID setup if that is what already exists.

sudo blkid
ls -l /dev/disk/by-uuid/

Replace <your partition> with the name of the partition you identified earlier. Replace <mount point> with the location you would like the partition to be mounted at, so you have something like /media/windows or /media/documents for that column. Note: you can also change your locale option (ex: locale=fr_FR.utf8). Execute locale -a in a terminal to know which ones are supported on your system. Save and close the file. You will now need to create the mount point for each NTFS partition before you can actually mount them:

sudo mkdir -p /media/<mount point>

Now remount each partition with

sudo umount <your partition>
sudo mount -a

If you have a problem

If you want to revert to your previous configuration, run:

sudo mv /etc/fstab.orig /etc/fstab
sudo umount /media/<mount point>

Known Issues

IconsPage?action=AttachFile&do=get&target=stop.png The present limitations of this driver are:

  • writing files encrypted or compressed at the filesystem level (does not include .zip, .gz, .rar files since they are compressed on the file, not the file system level)
  • changing NTFS file ownership and access rights

Separate /usr partition work-around

It is unknown if this issue still exists. Please remove this line if you can confirm that it does. Bug report: https://bugs.launchpad.net/ubuntu/+bug/120643 This is only needed if you have installed ubuntu with a separate /usr partition. Before running the Applications->System Tools->NTFS Configuration Tool provided with the installation, you will need to backup and edit your fstab file:

sudo cp /etc/fstab /etc/fstab.pre_ntfs3g_workaround
gksudo gedit /etc/fstab

Now, carefully look through the file for all references of your ntfs partitions (this is taken from part of my fstab file and is ONLY for example, yours WILL be different).

# Entry for /dev/sda9 :
UUID=98451ab9-d323-4a09-96a2-91b5ea58035c / ext3 defaults,errors=remount-ro 0 1
# Entry for /dev/sda3 :
UUID=09f8e063-64d5-4b20-a97b-26cfb7b08989 /boot ext3 defaults 0 2
# Entry for /dev/sda11 :
UUID=7b0fce56-2eb6-4e39-b428-4fe45eef5f21 /home ext3 defaults 0 2
# Entry for /dev/sda1 :
UUID=68084A9E084A6B60 /media/sda1 ntfs defaults,locale=en_GB.UTF-8 0 1
# Entry for /dev/sda12 :
UUID=28FEE8554059CE0D /media/sda12 ntfs defaults,locale=en_GB.UTF-8 0 1
# Entry for /dev/sda13 :
UUID=ec8a8c6e-f9fb-4af6-839e-4ed5da28cd92 /tmp ext3 defaults 0 2
# Entry for /dev/sda14 :
UUID=6763b394-2cd8-4830-8cb7-a4cd4b45fa41 /usr ext3 defaults 0 2
# Entry for /dev/sda15 :
UUID=e53c0925-18a0-415c-8786-615b3b195c8f /var ext3 defaults 0 2
# Entry for /dev/sdb1 :
UUID=582a25db-c088-427c-9279-48af84695c7b none swap sw 0 0

the lines

# Entry for /dev/sda1 :
UUID=68084A9E084A6B60 /media/sda1 ntfs defaults,locale=en_GB.UTF-8 0 1
# Entry for /dev/sda12 :
UUID=28FEE8554059CE0D /media/sda12 ntfs defaults,locale=en_GB.UTF-8 0 1

need to be cut and then pasted below the /var partition entry to read:

# Entry for /dev/sda9 :
UUID=98451ab9-d323-4a09-96a2-91b5ea58035c / ext3 defaults,errors=remount-ro 0 1
# Entry for /dev/sda3 :
UUID=09f8e063-64d5-4b20-a97b-26cfb7b08989 /boot ext3 defaults 0 2
# Entry for /dev/sda11 :
UUID=7b0fce56-2eb6-4e39-b428-4fe45eef5f21 /home ext3 defaults 0 2
# Entry for /dev/sda13 :
UUID=ec8a8c6e-f9fb-4af6-839e-4ed5da28cd92 /tmp ext3 defaults 0 2
# Entry for /dev/sda14 :
UUID=6763b394-2cd8-4830-8cb7-a4cd4b45fa41 /usr ext3 defaults 0 2
# Entry for /dev/sda15 :
UUID=e53c0925-18a0-415c-8786-615b3b195c8f /var ext3 defaults 0 2
# Entry for /dev/sda1 :
UUID=68084A9E084A6B60 /media/sda1 ntfs defaults,locale=en_GB.UTF-8 0 1
# Entry for /dev/sda12 :
UUID=28FEE8554059CE0D /media/sda12 ntfs defaults,locale=en_GB.UTF-8 0 1
# Entry for /dev/sdb1 :
UUID=582a25db-c088-427c-9279-48af84695c7b none swap sw 0 0

Remember - these are ONLY given as an example, do not copy and paste - your fstab WILL BE DIFFERENT. Save your fstab file and close. Now you can continue on with either the 'automatic' or 'manual' configuration as per the instructions above.

Custom Kernel

It is unknown if this issue still exists. Please remove this line if you can confirm that it does. If you compiled your own kernel, you probably will not have fuse installed. You can get the source with

sudo apt-get install fuse-source

and have a look at /usr/share/doc/fuse-source/README.Debian for instructions on how to compile it.

See also

External links

IconsPage?action=AttachFile&do=get&target=IconBook-small.png