特殊:Badtitle/NS100:MountNtfsOnBoot/zh:修订间差异
第35行: | 第35行: | ||
</nowiki></pre> | </nowiki></pre> | ||
=== | === 准备挂载目录并修改 fstab === | ||
一旦你找到你的NTFS分区: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo mkdir /mnt/ntfs1 | sudo mkdir /mnt/ntfs1 | ||
</nowiki></pre> | </nowiki></pre> | ||
这里将建立一个目录 ntfs1 (1 是数字1 ) 在/mnt下面。(这是挂载文件的标准目录). | |||
然后: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo cp /etc/fstab /etc/fstab_backup1 | sudo cp /etc/fstab /etc/fstab_backup1 | ||
</nowiki></pre> | </nowiki></pre> | ||
这里将备份你的 fstab 文件(这是一个在启动时候挂载文件系统的配置文件) 为fstab_backup1 (1是数字1). | |||
然后: | |||
<pre><nowiki> | <pre><nowiki> | ||
gksudo gedit /etc/fstab | gksudo gedit /etc/fstab | ||
</nowiki></pre> | </nowiki></pre> | ||
打开fstab文件. | |||
在文件的最后一行,粘贴下面一行文字: | |||
<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> | ||
修改'''/dev/hda2''' 为你自己的NTFS分区. 保存并关闭它. | |||
==== | ==== 关于fstab备份==== | ||
如果你需要还原你的fstab备份,使用下面的命令: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo rm /etc/fstab | sudo rm /etc/fstab |
2007年6月13日 (三) 09:05的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/MountNtfsOnBoot }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/af | • {{#if: UbuntuHelp:MountNtfsOnBoot|Afrikaans| [[::MountNtfsOnBoot/zh/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ar | • {{#if: UbuntuHelp:MountNtfsOnBoot|العربية| [[::MountNtfsOnBoot/zh/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/az | • {{#if: UbuntuHelp:MountNtfsOnBoot|azərbaycanca| [[::MountNtfsOnBoot/zh/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/bcc | • {{#if: UbuntuHelp:MountNtfsOnBoot|جهلسری بلوچی| [[::MountNtfsOnBoot/zh/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/bg | • {{#if: UbuntuHelp:MountNtfsOnBoot|български| [[::MountNtfsOnBoot/zh/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/br | • {{#if: UbuntuHelp:MountNtfsOnBoot|brezhoneg| [[::MountNtfsOnBoot/zh/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ca | • {{#if: UbuntuHelp:MountNtfsOnBoot|català| [[::MountNtfsOnBoot/zh/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/cs | • {{#if: UbuntuHelp:MountNtfsOnBoot|čeština| [[::MountNtfsOnBoot/zh/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/de | • {{#if: UbuntuHelp:MountNtfsOnBoot|Deutsch| [[::MountNtfsOnBoot/zh/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/el | • {{#if: UbuntuHelp:MountNtfsOnBoot|Ελληνικά| [[::MountNtfsOnBoot/zh/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/es | • {{#if: UbuntuHelp:MountNtfsOnBoot|español| [[::MountNtfsOnBoot/zh/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/fa | • {{#if: UbuntuHelp:MountNtfsOnBoot|فارسی| [[::MountNtfsOnBoot/zh/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/fi | • {{#if: UbuntuHelp:MountNtfsOnBoot|suomi| [[::MountNtfsOnBoot/zh/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/fr | • {{#if: UbuntuHelp:MountNtfsOnBoot|français| [[::MountNtfsOnBoot/zh/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/gu | • {{#if: UbuntuHelp:MountNtfsOnBoot|ગુજરાતી| [[::MountNtfsOnBoot/zh/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/he | • {{#if: UbuntuHelp:MountNtfsOnBoot|עברית| [[::MountNtfsOnBoot/zh/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/hu | • {{#if: UbuntuHelp:MountNtfsOnBoot|magyar| [[::MountNtfsOnBoot/zh/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/id | • {{#if: UbuntuHelp:MountNtfsOnBoot|Bahasa Indonesia| [[::MountNtfsOnBoot/zh/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/it | • {{#if: UbuntuHelp:MountNtfsOnBoot|italiano| [[::MountNtfsOnBoot/zh/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ja | • {{#if: UbuntuHelp:MountNtfsOnBoot|日本語| [[::MountNtfsOnBoot/zh/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ko | • {{#if: UbuntuHelp:MountNtfsOnBoot|한국어| [[::MountNtfsOnBoot/zh/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ksh | • {{#if: UbuntuHelp:MountNtfsOnBoot|Ripoarisch| [[::MountNtfsOnBoot/zh/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/mr | • {{#if: UbuntuHelp:MountNtfsOnBoot|मराठी| [[::MountNtfsOnBoot/zh/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ms | • {{#if: UbuntuHelp:MountNtfsOnBoot|Bahasa Melayu| [[::MountNtfsOnBoot/zh/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/nl | • {{#if: UbuntuHelp:MountNtfsOnBoot|Nederlands| [[::MountNtfsOnBoot/zh/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/no | • {{#if: UbuntuHelp:MountNtfsOnBoot|norsk| [[::MountNtfsOnBoot/zh/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/oc | • {{#if: UbuntuHelp:MountNtfsOnBoot|occitan| [[::MountNtfsOnBoot/zh/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/pl | • {{#if: UbuntuHelp:MountNtfsOnBoot|polski| [[::MountNtfsOnBoot/zh/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/pt | • {{#if: UbuntuHelp:MountNtfsOnBoot|português| [[::MountNtfsOnBoot/zh/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ro | • {{#if: UbuntuHelp:MountNtfsOnBoot|română| [[::MountNtfsOnBoot/zh/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/ru | • {{#if: UbuntuHelp:MountNtfsOnBoot|русский| [[::MountNtfsOnBoot/zh/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/si | • {{#if: UbuntuHelp:MountNtfsOnBoot|සිංහල| [[::MountNtfsOnBoot/zh/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/sq | • {{#if: UbuntuHelp:MountNtfsOnBoot|shqip| [[::MountNtfsOnBoot/zh/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/sr | • {{#if: UbuntuHelp:MountNtfsOnBoot|српски / srpski| [[::MountNtfsOnBoot/zh/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/sv | • {{#if: UbuntuHelp:MountNtfsOnBoot|svenska| [[::MountNtfsOnBoot/zh/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/th | • {{#if: UbuntuHelp:MountNtfsOnBoot|ไทย| [[::MountNtfsOnBoot/zh/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/tr | • {{#if: UbuntuHelp:MountNtfsOnBoot|Türkçe| [[::MountNtfsOnBoot/zh/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/vi | • {{#if: UbuntuHelp:MountNtfsOnBoot|Tiếng Việt| [[::MountNtfsOnBoot/zh/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/yue | • {{#if: UbuntuHelp:MountNtfsOnBoot|粵語| [[::MountNtfsOnBoot/zh/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/zh | • {{#if: UbuntuHelp:MountNtfsOnBoot|中文| [[::MountNtfsOnBoot/zh/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/zh-hans | • {{#if: UbuntuHelp:MountNtfsOnBoot|中文(简体)| [[::MountNtfsOnBoot/zh/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MountNtfsOnBoot | UbuntuHelp:MountNtfsOnBoot | {{#if: | :}}MountNtfsOnBoot/zh}}/zh-hant | • {{#if: UbuntuHelp:MountNtfsOnBoot|中文(繁體)| [[::MountNtfsOnBoot/zh/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:MountNtfsOnBoot|:MountNtfsOnBoot/zh|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :MountNtfsOnBoot/zh/zh | | {{#ifexist: MountNtfsOnBoot/zh/zh | | {{#ifeq: {{#titleparts:MountNtfsOnBoot/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:MountNtfsOnBoot/zh|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
- 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:AutomaticallyMountMSWindowsPartitions
挂载NTFS分区
它在那里?
使用命令行命令查看分区
sudo fdisk -l
/!\ 注意 fdisk是个危险的工具。
在下面的例子里 /dev/hda2是一个NTFS分区:
/dev/hda2 2612 6527 31455270 7 HPFS/NTFS
准备挂载目录并修改 fstab
一旦你找到你的NTFS分区:
sudo mkdir /mnt/ntfs1
这里将建立一个目录 ntfs1 (1 是数字1 ) 在/mnt下面。(这是挂载文件的标准目录). 然后:
sudo cp /etc/fstab /etc/fstab_backup1
这里将备份你的 fstab 文件(这是一个在启动时候挂载文件系统的配置文件) 为fstab_backup1 (1是数字1). 然后:
gksudo gedit /etc/fstab
打开fstab文件.
在文件的最后一行,粘贴下面一行文字:
/dev/hda2 /mnt/ntfs1 ntfs ro,nls=utf8,umask=0222 0 0
修改/dev/hda2 为你自己的NTFS分区. 保存并关闭它.
关于fstab备份
如果你需要还原你的fstab备份,使用下面的命令:
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