特殊:Badtitle/NS100:MountNtfsOnBoot:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第15行: | 第15行: | ||
Use the output of this command to learn where your NTFS partition is | Use the output of this command to learn where your NTFS partition is | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo fdisk -l | sudo fdisk -l | ||
</nowiki></pre> | </nowiki></pre> | ||
/!\ Please be careful as fdisk is a dangerous tool | /!\ Please be careful as fdisk is a dangerous tool | ||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconExample48.png | ||
In the following example, /dev/hda2 is an NTFS partition: | In the following example, /dev/hda2 is an NTFS partition: | ||
<pre><nowiki> | <pre><nowiki> | ||
/dev/hda2 2612 6527 31455270 7 HPFS/NTFS | /dev/hda2 2612 6527 31455270 7 HPFS/NTFS | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Prepare the Mount Directory and fstab entry === | === Prepare the Mount Directory and fstab entry === | ||
Once you locate your NTFS partition: | Once you locate your NTFS partition: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo mkdir /mnt/ntfs1 | sudo mkdir /mnt/ntfs1 | ||
</nowiki></pre> | </nowiki></pre> | ||
this will create a new directory called ntfs1 (1 is number one) under /mnt (the standard directory for mounting filesystems). | this will create a new directory called ntfs1 (1 is number one) under /mnt (the standard directory for mounting filesystems). | ||
then: | then: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo cp /etc/fstab /etc/fstab_backup1 | sudo cp /etc/fstab /etc/fstab_backup1 | ||
</nowiki></pre> | </nowiki></pre> | ||
this will back up your fstab (a configuration file Linux uses to mount filesystems on boot) as fstab_backup1 (1 is number one). | this will back up your fstab (a configuration file Linux uses to mount filesystems on boot) as fstab_backup1 (1 is number one). | ||
then: | then: | ||
<pre><nowiki> | <pre><nowiki> | ||
gksudo gedit /etc/fstab | gksudo gedit /etc/fstab | ||
</nowiki></pre> | </nowiki></pre> | ||
this will open the fstab file. | this will open the fstab file. | ||
Goto the end of the file, copy paste this as one line: | Goto the end of the file, copy paste this as one line: | ||
<pre><nowiki> | <pre><nowiki> | ||
/dev/hda2 /mnt/ntfs1 ntfs ro,nls=utf8,umask=0222 0 0 | /dev/hda2 /mnt/ntfs1 ntfs ro,nls=utf8,umask=0222 0 0 | ||
</nowiki></pre> | </nowiki></pre> | ||
and change '''/dev/hda2''' with your own ntfs partition. Save and close the file. | and change '''/dev/hda2''' with your own ntfs partition. Save and close the file. | ||
==== About fstab backup ==== | ==== About fstab backup ==== | ||
If you need to recover your backup file, use: | If you need to recover your backup file, use: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo rm /etc/fstab | sudo rm /etc/fstab | ||
sudo cp /etc/fstab_backup1 /etc/fstab | sudo cp /etc/fstab_backup1 /etc/fstab | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Mounting === | === Mounting === | ||
Finish the process with: | Finish the process with: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo mount -a | sudo mount -a | ||
</nowiki></pre> | </nowiki></pre> | ||
which will mount every unmounted entry in the fstab. | which will mount every unmounted entry in the fstab. | ||
You can check which partitions are mounted after this with: | You can check which partitions are mounted after this with: | ||
<pre><nowiki> | <pre><nowiki> | ||
mount | mount | ||
</nowiki></pre> | </nowiki></pre> | ||
which will give you a list of mounted filesystem. | which will give you a list of mounted filesystem. | ||
After following these steps, if <code><nowiki> mount -a </nowiki></code> mounted your ntfs partition, it will automatically be mounted on every boot. | After following these steps, if <code><nowiki> mount -a </nowiki></code> mounted your ntfs partition, it will automatically be mounted on every boot. | ||
第69行: | 第69行: | ||
If something goes wrong, go for help at http://ubuntuforums.org. Please post exactly what you did (copy-paste) and the errors along with the output of: | If something goes wrong, go for help at http://ubuntuforums.org. Please post exactly what you did (copy-paste) and the errors along with the output of: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo fdisk -l | sudo fdisk -l | ||
cat /etc/fstab | cat /etc/fstab | ||
mount | sort | mount | sort | ||
</nowiki></pre> | </nowiki></pre> | ||
---- | ---- | ||
[[category:CategoryDocumentation]] [[category:CategoryCleanup]] | [[category:CategoryDocumentation]] [[category:CategoryCleanup]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年12月6日 (四) 10:43的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/MountNtfsOnBoot }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/af | • {{#if: UbuntuHelp:MountNtfsOnBoot|Afrikaans| [[::MountNtfsOnBoot/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ar | • {{#if: UbuntuHelp:MountNtfsOnBoot|العربية| [[::MountNtfsOnBoot/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/az | • {{#if: UbuntuHelp:MountNtfsOnBoot|azərbaycanca| [[::MountNtfsOnBoot/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/bcc | • {{#if: UbuntuHelp:MountNtfsOnBoot|جهلسری بلوچی| [[::MountNtfsOnBoot/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/bg | • {{#if: UbuntuHelp:MountNtfsOnBoot|български| [[::MountNtfsOnBoot/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/br | • {{#if: UbuntuHelp:MountNtfsOnBoot|brezhoneg| [[::MountNtfsOnBoot/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ca | • {{#if: UbuntuHelp:MountNtfsOnBoot|català| [[::MountNtfsOnBoot/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/cs | • {{#if: UbuntuHelp:MountNtfsOnBoot|čeština| [[::MountNtfsOnBoot/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/de | • {{#if: UbuntuHelp:MountNtfsOnBoot|Deutsch| [[::MountNtfsOnBoot/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/el | • {{#if: UbuntuHelp:MountNtfsOnBoot|Ελληνικά| [[::MountNtfsOnBoot/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/es | • {{#if: UbuntuHelp:MountNtfsOnBoot|español| [[::MountNtfsOnBoot/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/fa | • {{#if: UbuntuHelp:MountNtfsOnBoot|فارسی| [[::MountNtfsOnBoot/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/fi | • {{#if: UbuntuHelp:MountNtfsOnBoot|suomi| [[::MountNtfsOnBoot/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/fr | • {{#if: UbuntuHelp:MountNtfsOnBoot|français| [[::MountNtfsOnBoot/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/gu | • {{#if: UbuntuHelp:MountNtfsOnBoot|ગુજરાતી| [[::MountNtfsOnBoot/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/he | • {{#if: UbuntuHelp:MountNtfsOnBoot|עברית| [[::MountNtfsOnBoot/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/hu | • {{#if: UbuntuHelp:MountNtfsOnBoot|magyar| [[::MountNtfsOnBoot/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/id | • {{#if: UbuntuHelp:MountNtfsOnBoot|Bahasa Indonesia| [[::MountNtfsOnBoot/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/it | • {{#if: UbuntuHelp:MountNtfsOnBoot|italiano| [[::MountNtfsOnBoot/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ja | • {{#if: UbuntuHelp:MountNtfsOnBoot|日本語| [[::MountNtfsOnBoot/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ko | • {{#if: UbuntuHelp:MountNtfsOnBoot|한국어| [[::MountNtfsOnBoot/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ksh | • {{#if: UbuntuHelp:MountNtfsOnBoot|Ripoarisch| [[::MountNtfsOnBoot/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/mr | • {{#if: UbuntuHelp:MountNtfsOnBoot|मराठी| [[::MountNtfsOnBoot/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ms | • {{#if: UbuntuHelp:MountNtfsOnBoot|Bahasa Melayu| [[::MountNtfsOnBoot/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/nl | • {{#if: UbuntuHelp:MountNtfsOnBoot|Nederlands| [[::MountNtfsOnBoot/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/no | • {{#if: UbuntuHelp:MountNtfsOnBoot|norsk| [[::MountNtfsOnBoot/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/oc | • {{#if: UbuntuHelp:MountNtfsOnBoot|occitan| [[::MountNtfsOnBoot/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/pl | • {{#if: UbuntuHelp:MountNtfsOnBoot|polski| [[::MountNtfsOnBoot/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/pt | • {{#if: UbuntuHelp:MountNtfsOnBoot|português| [[::MountNtfsOnBoot/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ro | • {{#if: UbuntuHelp:MountNtfsOnBoot|română| [[::MountNtfsOnBoot/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/ru | • {{#if: UbuntuHelp:MountNtfsOnBoot|русский| [[::MountNtfsOnBoot/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/si | • {{#if: UbuntuHelp:MountNtfsOnBoot|සිංහල| [[::MountNtfsOnBoot/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/sq | • {{#if: UbuntuHelp:MountNtfsOnBoot|shqip| [[::MountNtfsOnBoot/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/sr | • {{#if: UbuntuHelp:MountNtfsOnBoot|српски / srpski| [[::MountNtfsOnBoot/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/sv | • {{#if: UbuntuHelp:MountNtfsOnBoot|svenska| [[::MountNtfsOnBoot/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/th | • {{#if: UbuntuHelp:MountNtfsOnBoot|ไทย| [[::MountNtfsOnBoot/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/tr | • {{#if: UbuntuHelp:MountNtfsOnBoot|Türkçe| [[::MountNtfsOnBoot/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/vi | • {{#if: UbuntuHelp:MountNtfsOnBoot|Tiếng Việt| [[::MountNtfsOnBoot/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/yue | • {{#if: UbuntuHelp:MountNtfsOnBoot|粵語| [[::MountNtfsOnBoot/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/zh | • {{#if: UbuntuHelp:MountNtfsOnBoot|中文| [[::MountNtfsOnBoot/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/zh-hans | • {{#if: UbuntuHelp:MountNtfsOnBoot|中文(简体)| [[::MountNtfsOnBoot/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot}}/zh-hant | • {{#if: UbuntuHelp:MountNtfsOnBoot|中文(繁體)| [[::MountNtfsOnBoot/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:MountNtfsOnBoot|:MountNtfsOnBoot|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :MountNtfsOnBoot/zh | | {{#ifexist: MountNtfsOnBoot/zh | | {{#ifeq: {{#titleparts:MountNtfsOnBoot|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:MountNtfsOnBoot|1|-1|}} | zh | | }}
12.28.2005: This page needs review and clean up, be careful while implementing steps!
Introduction
This page describes how to automatically mount an MS Windows partition in Linux on boot. It is written for NTFS only because
- Linux does not support writing to an NTFS partition yet
2. Most newcomers use NTFS as the basis of their dual booting Windows'ed computers. <!> Please note that you will need to use the terminal and commands to do the steps. Using the command line (CLI) is a nice way to learn linux, at least if you have time and will. I will try to be as descriptive as possible... For more information on the command line see:
- Self:BasicCommands
- Self:AdvancedCommandlineHowto
<!> You can also find a script for this at : Self:AutomaticallyMountPartitions
Mounting an NTFS partition
Where is the partition?
Use the output of this command to learn where your NTFS partition is
sudo fdisk -l
/!\ Please be careful as fdisk is a dangerous tool In the following example, /dev/hda2 is an NTFS partition:
/dev/hda2 2612 6527 31455270 7 HPFS/NTFS
Prepare the Mount Directory and fstab entry
Once you locate your NTFS partition:
sudo mkdir /mnt/ntfs1
this will create a new directory called ntfs1 (1 is number one) under /mnt (the standard directory for mounting filesystems). then:
sudo cp /etc/fstab /etc/fstab_backup1
this will back up your fstab (a configuration file Linux uses to mount filesystems on boot) as fstab_backup1 (1 is number one). then:
gksudo gedit /etc/fstab
this will open the fstab file. Goto the end of the file, copy paste this as one line:
/dev/hda2 /mnt/ntfs1 ntfs ro,nls=utf8,umask=0222 0 0
and change /dev/hda2 with your own ntfs partition. Save and close the file.
About fstab backup
If you need to recover your backup file, use:
sudo rm /etc/fstab sudo cp /etc/fstab_backup1 /etc/fstab
Mounting
Finish the process with:
sudo mount -a
which will mount every unmounted entry in the fstab. You can check which partitions are mounted after this with:
mount
which will give you a list of mounted filesystem.
After following these steps, if mount -a
mounted your ntfs partition, it will automatically be mounted on every boot.
Writing to NTFS
Your ntfs partition is under /mnt/ntfs1 but it can only be read-only (i.e. you will not be able to change anything in it) because linux does not support writing to this filesystem (except experimentally, which means dangerous). But Linux can write to FAT32, so you can use a flash drive or similar (a FAT32 formatted partition) as an intermediary between Linux and MS Windows.
Go for help
If something goes wrong, go for help at http://ubuntuforums.org. Please post exactly what you did (copy-paste) and the errors along with the output of:
sudo fdisk -l cat /etc/fstab mount | sort