特殊:Badtitle/NS100:MountingWindowsPartitions:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第1行: 第1行:
{{From|https://help.ubuntu.com/community/MountingWindowsPartitions}}
{{From|https://help.ubuntu.com/community/MountingWindowsPartitions}}
{{Languages|UbuntuHelp:MountingWindowsPartitions}}
{{Languages|UbuntuHelp:MountingWindowsPartitions}}
{{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.
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconSambaShares.png 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 ==
== 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 [[UbuntuHelp:LinuxFilesystemsExplained]], but here are some basics:
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png For a more in depth analysis, see [[UbuntuHelp:LinuxFilesystemsExplained|LinuxFilesystemsExplained]], but here are some basics:
* Windows Vista, XP, 2000, older NT systems, and Windows Server 2003 and 2008 are formatted with NTFS.  
* 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.
* Older versions of Windows like Windows ME, 98, and 95 are formatted with FAT32.
第12行: 第12行:
== Using Windows File Systems ==
== Using Windows File Systems ==
=== For NTFS Partitions ===
=== 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 [[UbuntuHelp:MountingWindowsPartitions/ThirdPartyNTFS3G]].
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDisks.png 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 [[UbuntuHelp:MountingWindowsPartitions/ThirdPartyNTFS3G|MountingWindowsPartitions/ThirdPartyNTFS3G]].
=== For FAT32 and FAT16 Partitions ===
=== For FAT32 and FAT16 Partitions ===
The '''vfat''' driver is used in linux to read and write 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 <code><nowiki>fdisk</nowiki></code> command above, create the mount point, then use the <code><nowiki>mount</nowiki></code> command.
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png 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 ====
==== 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:
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=example.png Here is the format for mounting a FAT formatted device:
<pre><nowiki>
<pre><nowiki>
  sudo mkdir <mount_point>
  sudo mkdir <mount_point>
  sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 <device> <mount_point></nowiki></pre>
  sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 <device> <mount_point></nowiki></pre>
==== Solid Example ====
==== Solid Example ====
{{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:
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png Let's say that using the <code><nowiki>fdisk</nowiki></code> command reveals that you want to mount '''/dev/sdb1''' - run:
<pre><nowiki>
<pre><nowiki>
  sudo mkdir /media/fat_partition
  sudo mkdir /media/fat_partition
  sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 /dev/sdb1 /media/fat_partition</nowiki></pre>
  sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000 /dev/sdb1 /media/fat_partition</nowiki></pre>
=== Mounting at Boot ===
=== 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 <code><nowiki>/etc/fstab</nowiki></code> - for more information on that, see [[UbuntuHelp: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.
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconComputer.png 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 [[UbuntuHelp:Fstab|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 <code><nowiki>/etc/fstab</nowiki></code> after you edit the file, save and close it.  This can be achieved simply by running:
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>
<pre><nowiki>
  sudo mount -a</nowiki></pre>
  sudo mount -a</nowiki></pre>
== Other Resources ==
== Other Resources ==
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBook-small.png%7D%7D
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBook-small.png
* [[UbuntuHelp:MountingWindowsPartitions/ThirdPartyNTFS3G]]
* [[UbuntuHelp:MountingWindowsPartitions/ThirdPartyNTFS3G|MountingWindowsPartitions/ThirdPartyNTFS3G]]
* [[UbuntuHelp:Fstab]]
* [[UbuntuHelp:Fstab|Fstab]]
* [[UbuntuHelp:LinuxFilesystemsExplained]]
* [[UbuntuHelp:LinuxFilesystemsExplained|LinuxFilesystemsExplained]]
* [http://ubuntuforums.org/showthread.php?t=283131 How to fstab]
* [http://ubuntuforums.org/showthread.php?t=283131 How to fstab]
----
----

2008年10月19日 (日) 23:52的版本

{{#ifexist: :MountingWindowsPartitions/zh | | {{#ifexist: MountingWindowsPartitions/zh | | {{#ifeq: {{#titleparts:MountingWindowsPartitions|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:MountingWindowsPartitions|1|-1|}} | zh | | }}

IconsPage?action=AttachFile&do=get&target=IconSambaShares.png 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

IconsPage?action=AttachFile&do=get&target=info.png 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

IconsPage?action=AttachFile&do=get&target=IconDisks.png 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. IconsPage?action=AttachFile&do=get&target=terminal.png 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

IconsPage?action=AttachFile&do=get&target=example.png 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

IconsPage?action=AttachFile&do=get&target=IconExample48.png 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

IconsPage?action=AttachFile&do=get&target=IconComputer.png 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

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