个人工具

“UbuntuHelp:MountingWindowsPartitions”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/MountingWindowsPartitions}}
 
{{From|https://help.ubuntu.com/community/MountingWindowsPartitions}}
 
{{Languages|UbuntuHelp:MountingWindowsPartitions}}
 
{{Languages|UbuntuHelp:MountingWindowsPartitions}}
== Accessing the Files on Your Windows Partition ==
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconSambaShares.png%7D%7D Ubuntu is capable of reading and writing files stored on Windows formatted partitions. These partitions are normally formatted with NTFS, but are sometimes formatted with FAT32.  You will also see FAT16 on other devices.
Ubuntu can read and write files on your Windows partition. Windows partitions are normally formatted as NTFS (the default for Windows Vista, XP and 2000) or, rarely, FAT32. If unsure, you can find out which format  your Windows partition uses by right-clicking the partition in Windows Explorer and selecting '''Properties'''.  
+
== File System Differences ==
=== For NTFS partitions ===
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png%7D%7D For a more in depth analysis, see [[LinuxFilesystemsExplained]], but here are some basics:
Ubuntu '''7.10''' comes with an NTFS driver and mounts NTFS partitions by default.
+
* Windows Vista, XP, 2000, older NT systems, and Windows Server 2003 and 2008 are formatted with NTFS.
Ubuntu '''7.04''' can read and write files on the NTFS drives commonly used by Windows. It is necessary to install the NTFS 3G driver [https://bugs.launchpad.net/ubuntu/+bug/108980 Reference]. Follow the steps below.
+
* Older versions of Windows like Windows ME, 98, and 95 are formatted with FAT32.
Ubuntu '''6.06 LTS''' and '''6.10''' came with older, beta versions of the NTFS 3G driver. These worked well for many users but were not guaranteed to be stable. Use Ubuntu 7.04 for stable access to NTFS partitions. Alternatively, a stable version of NTFS 3G for older versions of Ubuntu can be obtained from a third-party software repository - see [[UbuntuHelp:MountingWindowsPartitions/ThirdPartyNTFS3G|using a third-party NTFS 3G]].
+
* Flash drives, like your USB thumb drive or your camera's flash card are typically formatted as FAT16.
'''Installing NTFS 3G Driver'''
+
In Windows, you can check what your partition is formatted as by right-clicking the partition in Windows Explorer and selecting Properties. In Ubuntu, run from [[UsingTheTerminal| terminal]]:
* Enable the universe repository and install the '''ntfs-config''' package. See [[UbuntuHelp:InstallingSoftware|Installing Software]].
+
<pre><nowiki>
* Click '''Applications''' → '''System Tools''' → '''NTFS Configuration Tool'''
+
sudo fdisk -l</nowiki></pre>
* The upcoming tool will detect NTFS partitions on your system. Check each partition you wish to access, and, if you wish to, click the mount directory to change it.  When finished, click '''Apply'''.
+
== Using Windows File Systems ==
* On the next screen '''Enable write support for internal device''' will be selected by default. Click '''OK'''.
+
=== For NTFS Partitions ===
Your NTFS drive will be now be available in the mount point you selected.
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDisks.png%7D%7D The '''ntfs-3g''' driver is used in linux to read and write NTFS partitions. Since using it varies between Ubuntu releases, there is a separate page explaining how to use '''ntfs-3g''' in your release version. Please see [[MountingWindowsPartitions/ThirdPartyNTFS3G]].
=== For FAT32 partitions  ===
+
=== For FAT32 and FAT16 Partitions ===
 
+
The '''vfat''' driver is used in linux to read and write FAT32 and FAT16 partitions.
Linux uses a driver called 'vfat' to support FAT32 partitions.  
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png%7D%7D To mount a FAT partition from terminal, first locate the device you want to mount using the <code><nowiki>fdisk</nowiki></code> command above, create the mount point, then use the <code><nowiki>mount</nowiki></code> command.
 
+
==== Generic Template ====
Create a folder where the partition will be accessed (or mounted). Default for Ubuntu is to create all filesystem mount points in the /media directory.
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=example.png%7D%7D Here is the format for mounting a FAT formatted device:
<pre>mkdir /media/windows</pre>
+
<pre><nowiki>
*To automatically mount partitions at boot-up, you will need to edit the filesystem table, /etc/fstab. This is a configuration file that contains the information about all filesystems on your computer. Open the file with this command:
+
sudo mkdir <mount_point>
<pre>gksudo gedit /etc/fstab
+
sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 <device> <mount_point></nowiki></pre>
</pre>
+
==== Solid Example ====
and add the following line for each FAT32 partition:
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png%7D%7D Let's say that using the <code><nowiki>fdisk</nowiki></code> command reveals that you want to mount '''/dev/sdb1''' - run:
<pre>/dev/hda1 /media/windows vfat iocharset=utf8,umask=000 0 0</pre>
+
<pre><nowiki>
*Two additional parameters are "shortname=mixed" and "user=user,group=group". The first will take care that all-caps short filenames show up in all-caps instead of in small characters. The second will take care that you are the owner of all files on the vfat partition, this will allow you to maintain file modification date/time when copying files to the FAT32 partition.  
+
sudo mkdir /media/fat_partition
*Then run
+
sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 /dev/sdb1 /media/fat_partition</nowiki></pre>
<pre>sudo mount -a
+
=== Mounting at Boot ===
</pre>
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconComputer.png%7D%7D To mount a partition automatically at boot time, you will need to add an entry to <code><nowiki>/etc/fstab</nowiki></code> - for more information on that, see [[Fstab]].  For an example of adding a FAT partition, see '''Section 2.1: "More Examples of Entries"''' on that page.  The first example there uses the same options as above, and tends to work best for most users.  That page has information on '''Editing fstab''', so you just want to add a new line for your FAT partition if an entry does not already exist.
to mount all the partitions.
+
Don't forget to mount all the entries in <code><nowiki>/etc/fstab</nowiki></code> after you edit the file, save and close it. This can be achieved simply by running:
 
+
<pre><nowiki>
Your FAT32 drive will be now be available in the mount point you selected.
+
sudo mount -a</nowiki></pre>
 
+
== Other Resources ==
 +
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBook-small.png%7D%7D
 +
* [[MountingWindowsPartitions/ThirdPartyNTFS3G]]
 +
* [[Fstab]]
 +
* [[LinuxFilesystemsExplained]]
 +
* [[http://ubuntuforums.org/showthread.php?t=283131|How to fstab]]
 
----
 
----
 +
[[category:CategoryDocumentation]]
  
[[Category:CategoryDocumentation]] [[Category:CategoryCleanup]] [[Category:UbuntuHelp]]
+
[[category:UbuntuHelp]]

2008年10月19日 (日) 12:56的版本


{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconSambaShares.png%7D%7D Ubuntu is capable of reading and writing files stored on Windows formatted partitions. These partitions are normally formatted with NTFS, but are sometimes formatted with FAT32. You will also see FAT16 on other devices.

File System Differences

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png%7D%7D For a more in depth analysis, see LinuxFilesystemsExplained, but here are some basics:

  • Windows Vista, XP, 2000, older NT systems, and Windows Server 2003 and 2008 are formatted with NTFS.
  • Older versions of Windows like Windows ME, 98, and 95 are formatted with FAT32.
  • Flash drives, like your USB thumb drive or your camera's flash card are typically formatted as FAT16.

In Windows, you can check what your partition is formatted as by right-clicking the partition in Windows Explorer and selecting Properties. In Ubuntu, run from terminal:

 sudo fdisk -l

Using Windows File Systems

For NTFS Partitions

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDisks.png%7D%7D The ntfs-3g driver is used in linux to read and write NTFS partitions. Since using it varies between Ubuntu releases, there is a separate page explaining how to use ntfs-3g in your release version. Please see MountingWindowsPartitions/ThirdPartyNTFS3G.

For FAT32 and FAT16 Partitions

The vfat driver is used in linux to read and write FAT32 and FAT16 partitions. {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png%7D%7D To mount a FAT partition from terminal, first locate the device you want to mount using the fdisk command above, create the mount point, then use the mount command.

Generic Template

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=example.png%7D%7D Here is the format for mounting a FAT formatted device:

 sudo mkdir <mount_point>
 sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 <device> <mount_point>

Solid Example

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png%7D%7D Let's say that using the fdisk command reveals that you want to mount /dev/sdb1 - run:

 sudo mkdir /media/fat_partition
 sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 /dev/sdb1 /media/fat_partition

Mounting at Boot

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconComputer.png%7D%7D To mount a partition automatically at boot time, you will need to add an entry to /etc/fstab - for more information on that, see Fstab. For an example of adding a FAT partition, see Section 2.1: "More Examples of Entries" on that page. The first example there uses the same options as above, and tends to work best for most users. That page has information on Editing fstab, so you just want to add a new line for your FAT partition if an entry does not already exist. Don't forget to mount all the entries in /etc/fstab after you edit the file, save and close it. This can be achieved simply by running:

 sudo mount -a

Other Resources

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBook-small.png%7D%7D