“UbuntuHelp:MountNtfsOnBoot”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/MountNtfsOnBoot}} | {{From|https://help.ubuntu.com/community/MountNtfsOnBoot}} | ||
{{Languages|UbuntuHelp:MountNtfsOnBoot}} | {{Languages|UbuntuHelp:MountNtfsOnBoot}} | ||
− | |||
− | |||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png | ||
'''12.28.2005: This page needs review and clean up, be careful while implementing steps!''' | '''12.28.2005: This page needs review and clean up, be careful while implementing steps!''' | ||
− | |||
== Introduction == | == Introduction == | ||
This page describes how to automatically mount an MS Windows partition in Linux on boot. It is written for NTFS only because | 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: | <!> 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 | <!> You can also find a script for this at : Self:AutomaticallyMountPartitions | ||
− | |||
− | |||
− | |||
== Mounting an NTFS partition == | == Mounting an NTFS partition == | ||
− | |||
=== Where is the partition? === | === Where is the partition? === | ||
− | |||
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> | ||
第28行: | 第18行: | ||
</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: | ||
第35行: | 第23行: | ||
/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> | ||
第44行: | 第30行: | ||
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 | ||
第50行: | 第35行: | ||
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> | ||
第61行: | 第44行: | ||
</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: | ||
第68行: | 第50行: | ||
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> | ||
第81行: | 第61行: | ||
</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. | ||
− | |||
== Writing to NTFS == | == Writing to NTFS == | ||
− | |||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png | ||
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. | 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 == | == Go for help == | ||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconHelp.png | https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconHelp.png | ||
第97行: | 第73行: | ||
mount | sort | mount | sort | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
---- | ---- | ||
[[category:CategoryDocumentation]] [[category:CategoryCleanup]] | [[category:CategoryDocumentation]] [[category:CategoryCleanup]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年11月30日 (五) 20:21的版本
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