个人工具

“UbuntuHelp:Partitioning issues”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/Partitioning%20issues}}
 
{{From|https://help.ubuntu.com/community/Partitioning%20issues}}
 
{{Languages|UbuntuHelp:Partitioning%20issues}}
 
{{Languages|UbuntuHelp:Partitioning%20issues}}
There are issues and caveats with regard to choosing a [[UbuntuHelp:Partition table|partition layout]] and choosing a [[UbuntuHelp:Partitioning|tool to create such partitions]] on a new disk, or else to modify partitions on an existing disk. There are three aspects to this process: partitioning, formatting, and reformatting (with second OS installation).
+
Planning is needed when choosing a [[UbuntuHelp:PartitioningSchemes|partitioning scheme]] and a [[UbuntuHelp:PartitioningTools|tool to create such partitions]] on a hard drive disk.
In general, these issues arise only when dealing with [[UbuntuHelp:Windows|Windows]] installations, and how picky Windows installations and [[UbuntuHelp:file system check|file system check]] operations can get when dealing with partitions made with non-Windows partitioning tools. The general rule here is simply '''use the Windows tools for all partitioning operations,''' and '''only use Linux tools to reformat their own specific partitions:'''
+
=== Windows Partitions ===
=== Basic steps ===
+
* Manipulating Windows partitions requires special consideration and tools. See [[UbuntuHelp:HowtoResizeWindowsPartitions|How to Resize Windows Partitions]] for more information. In general, use Windows tools when manipulating existing Windows partitions.
* '''Fully create all partitions and format each with Windows tools''' ("diskpart" and "format" commands, or else the "drive management" gui), using NTFS and FAT32 as placeholder filesystems for Linux partitions, and '''don't use Linux tools to touch''' (and bork) '''the partition table.'''
+
* Format Windows partitions using the NTFS filesystem, in general. However, Windows 98 requires FAT32, and Windows XP will function fine with FAT32. The NTFS filesystem allows greater security (and ability to lock folders), which can be an advantage or disadvantage, depending on your point of view. (Microsoft can administratively lock your folders without your permission in NTFS). Windows Vista and Windows 7 both require NTFS.
* '''Final-format all partitions for Windows with Windows tools,''' and '''use Linux tools''' (GParted) '''for formatting Linux drives/filesystems''' (ext3, ext4, ext2, swap, etc) '''only'''.
+
In general, it is desirable to use Windows tools when formatting Windows partitions, but most current partition managers (such as [[UbuntuHelp:GParted|GParted]]) are able to format the filesystem (NTFS or FAT32) in the partition correctly.
==== In specific terms ====
+
=== Linux and Mac partitions ===
* Use Windows partition tools to '''create all partitions''' for all systems as you want them, including Windows, Linux, Mac, and even Linux [[UbuntuHelp:swap|swap]]. (These will be used later).
+
* Most current partition managers (such as [[UbuntuHelp:GParted|GParted]]) are able to format or reformat any partition to the desired filesystem type (ext3, ext4, swap, hfs+ for Mac OS X, NTFS or FAT32 for Windows). In general, Linux partitions should be ext3 or ext4, but FAT32 and several other options are available as Linux filesystem types.
* Use Windows formatting tools to '''format all partitions''', including what will become Linux partitions. '''Quick format''' Linux partitions as FAT32 or NTFS, if larger than 32 GB. (These will be '''reformatted''' later).
+
=== Install Windows in the first partition ===
* '''Format Windows partitions as NTFS''' - unless you are running Windows 98, which needs FAT32, or else or have some specialized technical issue that requires XP to run on FAT32 or some other configuration.
+
* If Windows exists or will exist on your system, it must occupy the first primary partition. This is necessary because the Windows bootloader is not very capable and always looks for the Windows OS in the first partition. For more information on installing Windows and Ubuntu in separate partitions, see [[UbuntuHelp:WindowsDualBoot|Dual Booting Windows and Ubuntu]].
* '''Use Linux formatting tools''' (commands within the partition editor GParted) '''to reformat''' Windows-created partitions to ext3, ext4, swap, etc. (or hfs+ for Mac OS X).
+
=== Why use multiple partitions? ===
Linux is only adequate* for partitioning the partition table and only ample* for formatting partitions into drives. (Again, do not partition with Linux; unless it is an external drive that you are not going to run Windows from). Formatting FAT32 with Linux is perfectly OK, but use Windows tools to format NTFS partitions.  This produces the best results, and the Linux NTFS-3G driver will be able to do any read/write operations to the NTFS drive.  
+
* When an operating system loads from its own partition, it always runs the fastest. When other alternatives are used, such as running one operating system within another operating system (using a virtual machine or a virtual disk mechanism), it is always slower (due to higher RAM and hard-drive requirements when using these methods).
==== Installing ====
+
* Bootloaders such as GRUB can be used to choose which operating system to load when each operating system occupies its own partition.
* '''install Windows first''' to the '''first primary partition.''' Linux can still be your "primary OS" even when installed to your last partition; just give it lots of drive space.  
+
* The main reason to use separate partitions is for ease of maintenance. When an operating system (OS) occupies its own partition, it can easily be updated without affecting other operating systems or data that might be stored in other partitions.
* When installing Ubuntu and the partition selection tool comes up, use the "specify partitions manually (advanced)" mode and manually select the partition you want. The first "side by side" installation option sounds seductive, but threatens to use dubious processes like automated NTFS resizing, which can bork the Windows partition. Manual selection insures that you are just formatting the already existing partition, and not messing with the partition table, which you should have already finalized with the Windows tools.
+
This is especially useful when certain applications are able to be used by multiple operating systems. A groupware application (such as Kolab), for example, can be placed in its own partition and be used by whichever operating system is booted. It can stay consistent and independent, even when one or more operating systems update themselves. It can then be updated independently of any particular operating system update and in fact be excluded from "automatic updates" by certain operating systems.
* If you want Ubuntu/Linux to be your "main OS," just make sure its at the top of your GRUB boot menu at startup. This is the default Ubuntu GRUB install anyway; using another OS as the top requires editing your /boot/grub/menu.lst with, e.g., nano:
+
The [[UbuntuHelp:LinuxFilesystemTreeOverview|linux filesystem]] can use a separate mount point for any directory, even if the directory exists in its own partition. Here are some examples of directories that are often given their own mount points (often in their own partitions):
<code><nowiki>sudo nano /boot/grub/menu.lst</nowiki></code>
+
* swap  -- Swap partitions allow you to use some of your harddrive space as RAM.  Swap prevents your computer from crashing when you run out of RAM space, and additionally, allows the RAM to be used efficiently. See [[UbuntuHelp:Partitioning_issues/Swap|here]] for much more info on swap.
or some other text editor like vi.
+
* /home  -- The /home mount point is where individual user settings are stored.  By placing this directory in its own partition, they can be shared between multiple OS's and remain constant even when each OS is updated. See [[UbuntuHelp:Partitioning_issues/Home|here]] for more information on /home and a listing of guides for creating a partition for this directory.
With nano, use 'control + k' to cut (multiple lines) and 'control + u' to paste the lines of code in the menu to the order you want.
+
* /boot -- The /boot mount point is where the GRUB bootloader files (needed to boot an OS) are stored. ([[UbuntuHelp:GrubHowto|GRUB]] can also be used to allow multiple OS's to boot.) Having a dedicated /boot partition can make it easier to run and maintain multiple operating systems. See [[UbuntuHelp:Partitioning_issues/Boot|/boot partitions]] for more info.
=== Why partition? ===
+
=== Arguments against partitioning ===
The main issue with partitioning is understanding why it's done: 1) to separate replaceable (and breakable) system files from irreplaceable personal files or business data, 2) to use multiple different operating systems on the same machine and choose which to boot into through a boot loader like [[UbuntuHelp:GRUB|GRUB]], or 3) to create swap space which Linux OSes use as virtual memory (Windows just uses a swap file on its system or otherwise fast and writable drive).
+
* 'Data loss is less frequent with current operating systems.' -- If you believe this one, I have a bridge to sell you.  
But the historical reasons for partitioning itself are not always relevant anymore:  
+
* 'The need to run multi-boot systems is mitigated due to the advent of [[UbuntuHelp:virtualization|virtualization]] and virtualization tools like [[UbuntuHelp:VirtualBox|VirtualBox]] such that running a virtual Windows OS on an Ubuntu system is mostly a breeze.' -- It's not. I've tried it. It runs very slowly on all but the most powerful computers with lots of RAM.
1) Partitioning for sake of separating system from data, once a major issue with malfunctioning OSes, is mitigated by the advent of LiveOSes on removable and easy-access media such as CDs, DVDs, or USB drives. System crashes are a pain, but data recovery is much easier than it was just a few years ago. LiveOSs on media drives are free to download, quick to burn, and can easily mount and access broken system partitions to retrieve wanted files and move them to a backup drive. And attachable (USB) storage drives are likewise ample and easy to use. (It's a good idea for anyone with a computer to have a good [[UbuntuHelp:LiveCD|LiveCD]] and an ample-sized USB drive handy, and to learn how to use them to mount drives and copy files).
+
* 'Partitioning to create swap space is unnecessary since systems are much faster than before, Linux runs more efficiently, and RAM is quite cheap.' -- RAM may be cheap, but not all computer motherboards can expand their RAM capabilities (and therefore still need swap). Further, Linux systems require more RAM these days, not less. Also, it is not the OS that requires plenty of memory, it is the programs that run within the OS that requires memory.  
2) The need to run multi-boot systems is mitigated due to the advent of [[UbuntuHelp:virtualization|virtualization]] and free virtualization tools like Sun's [[UbuntuHelp:VirtualBox|VirtualBox]] such that running a virtual Windows OS on an Ubuntu system is mostly a breeze. The caveat here is that one should limit their usage of Windows to just those applications which absolutely can't run on their Linux system (considering also any similarly-functional Linux applications) or else with Wine emulation.
+
=== Choosing a filesystem for a data partition ===
3) Partitioning to create swap space is unnecessary since systems are much faster than before, Linux runs light and efficiently, and lots of fast RAM is quite cheap.  
+
If you need a 'universally writable' drive so that Win, Mac, and *nix operating systems can share files, consider these issues:
=== Linux is the main OS, even if it isn't ===
+
* NTFS is a consideration, but it is proprietary and Window's peculiar usage of these drives means that Linux doesn't quite work perfectly with it. Further, Microsoft has the capability (and sometimes does) remotely lock NTFS folders. Do you want to take that chance?
Linux installs can work around Windows' peculiarities gracefully and without much difficulty. Its not perfect, but all co-existence with Windows issues are handled in Linux. Ubuntu, and most other [[UbuntuHelp:distributions]] since Xandros ($$) and Knoppix (the first "[[UbuntuHelp:LiveCD|LiveCD]]") use easy to use (graphical, orderly), flexible, and completely functional installers that handle the most important aspects of most installs. ([[UbuntuHelp:Installer issues|Though there is always room for improvement|Installer issues|Though there is always room for improvement]]).
+
* FAT32 was historically a good choice, but its size limitation (32 GB max) makes it quite small for today's standards.
Consider also that Linux, and Ubuntu in particular, can run very well without a Windows partition at all, and if Win32 apps are required, then using [[UbuntuHelp:Wine]] covers ~30% of this need, and a [[UbuntuHelp:Virtualization|virtual installation|Virtualization|virtual installation]] of Windows (from 98 to Win7) can deal with the rest. Virtualization has a few issues, but on current systems (+1.5 ghz, +1.2GB RAM), performance is quite acceptable.
+
* The exfat file system has no size limitation, but it is not commonly used.
=== Access to file systems ===
+
== Other resources ==
A secondary issue deals with Windows' limited access to non-Windows file systems. But this is less an issue due to the usage of FAT32 "transfer" partitions, Linux's ability to read/write NTFS and most other file systems, and free-to-use Win32 utilities for writing to ext2 file systems.
+
* [http://ubuntuguide.org/wiki/Multiple_OS_Installation Ubuntuguide -- Multipe OS Installation]
=== Drive plan ===
+
* [http://www.psychocats.net/ubuntu/partitioning Psychocats -- Partitioning]
Planning a partition setup and getting it right is much easier than a) finding out something is wrong later (like not enough system drive space), b) using Linux partition tools to rework a system partition and finding out Windows does'nt like it, c) and then repartitioning (from scratch) the right way with a Windows tool anyway.
+
* [http://www.users.bigpond.net.au/hermanzone/p17.htm#help_on_partitioning Herman's Help on Partitioning]
In general, separate disks which are used as storage (non-OS) partitions only can be dealt with more "flexibly," and this is still largely true when dealing with just Linux OS partitions. For consideration:
+
* [[UbuntuHelp:DiskSpace|DiskSpace]]
A) '''system drives''' - in accord with what you want your system to do with it (multi-boot, rawdrive virtualization, shared drive, storage partitions). This is particularly true when you are limited on drive space; even a 40GB system drive can adequately house Ubuntu and Windows 7, but less space requires more care.
+
* [https://help.ubuntu.com/8.04/switching/installing-partitioning.html Ubuntu 8.04 Guide -- Partitioning]
B) '''storage drives''' - A storage drive is actually more important than a system drive, because the system drive can simply be reformatted (assuming your /home/* director(ies) are backed up).
+
* [http://www.tuxfiles.org/linuxhelp/fstab.html Tuxfiles -- fstab]
C) '''Too many partitions''' is not quite as useful as someone might think, and you may want to rearrange such drives.
+
* [[UbuntuHelp:forum/installation/Partitioning|Partitioning forum]]
D) '''Rearranging/repartitioning a drive''' usually means backing everything up, which is not easy to do if you are dealing with a large drive with lots of data.
+
* [[UbuntuWiki:UbuntuDownUnder/BOFs/GraphicalPartitioningTool|UbuntuDown|Under -- GraphicalPartitioningTool]]
==== File systems ====
+
----
If you need a 'universally writable' drive so that Win, Mac, and unix can share its files, there are issues
+
[[category:CategoryInstallation]]
1) '''NTFS''' is the main consideration, but its proprietariness and Window's peculiar usage of these drives means that Linux doesn't quite work perfectly with it.  
+
2) '''Reading/writing NTFS''' - The free NTFS-3g driver is a recent development that works with Linux and Mac OS X systems to read and write files on NTFS partitions quite well. It was not long ago that writing to NTFS from Linux was a particularly risky operation.
+
3) '''NTFS tools''' - The major issue is that NTFS partitions run best when created with Windows partition tools (diskpart), and (usually) when created with Windows formatting tools (format). Linux utilities for dealing with NTFS file systems are incredibly flexible, clever, and '''useless'''. They often raise disk errors with Windows, such that running Windows' checkdisk utility (from Windows) is necessary just to make the drive readable again. This is less true with non-system storage partitions, but errors on such drives mean that data may be lost, so care must be taken.
+
4) the '''FAT32 file system''' is the historical choice, but its size limitation (32 GB max) makes it quite small for today's standards. The recently created exfat file system has no such limitation, but is not commonly used.
+
5) '''Repartitioning and resizing''' are particularly important issues, as they involve dealing with partitions that already have data on them. Backing up such drive partitions is highly recommended, but not always a possibility. And in any case, careful advance planning and using the right tools is better than trying to rework a drive's partition table after the fact.  
+
=== Ubuntu partitioning issues ===
+
GParted is a wonderful tool, but it has certain issues. For one, it can take forever to read a large drive, or a drive with a large number of partitions on it. Compare with qtparted (no longer in repository) which can take just a few moments to read all disks, offering a choice of which disk and its partitions to deal with.  
+
Starting GParted from the command line and specifying the disk can help, but it's still slow:
+
sudo gparted /dev/sdx // where x is a drive letter a, b, c, etc.  
+
The second issue deals with Ubuntu's pesky [[UbuntuHelp:automount|automount]] feature: It even kicks in while doing partitioning operations, such that as soon as an operation is performed, it remounts all partitions.  
+
This is pesky, but simply unmounting each of the drives. In Gnome, right click on each of the resurrected drive icons (on desktop or in the [[UbuntuHelp:file manager|file manager]] and selecting "unmount drive." In KDE, use kwikdisk (which loads into the system tray) or kdiskfree and unmount them from there.
+
Even with these issues with GParted and Gnome/Ubuntu, automount is a beautiful thing, and makes the mounting of new drives easier than even Mepis, and almost as good as Windows (though Windows can't really deal well with anything but NTFS and FAT).
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 23:50的最新版本

Planning is needed when choosing a partitioning scheme and a tool to create such partitions on a hard drive disk.

Windows Partitions

  • Manipulating Windows partitions requires special consideration and tools. See How to Resize Windows Partitions for more information. In general, use Windows tools when manipulating existing Windows partitions.
  • Format Windows partitions using the NTFS filesystem, in general. However, Windows 98 requires FAT32, and Windows XP will function fine with FAT32. The NTFS filesystem allows greater security (and ability to lock folders), which can be an advantage or disadvantage, depending on your point of view. (Microsoft can administratively lock your folders without your permission in NTFS). Windows Vista and Windows 7 both require NTFS.

In general, it is desirable to use Windows tools when formatting Windows partitions, but most current partition managers (such as GParted) are able to format the filesystem (NTFS or FAT32) in the partition correctly.

Linux and Mac partitions

  • Most current partition managers (such as GParted) are able to format or reformat any partition to the desired filesystem type (ext3, ext4, swap, hfs+ for Mac OS X, NTFS or FAT32 for Windows). In general, Linux partitions should be ext3 or ext4, but FAT32 and several other options are available as Linux filesystem types.

Install Windows in the first partition

  • If Windows exists or will exist on your system, it must occupy the first primary partition. This is necessary because the Windows bootloader is not very capable and always looks for the Windows OS in the first partition. For more information on installing Windows and Ubuntu in separate partitions, see Dual Booting Windows and Ubuntu.

Why use multiple partitions?

  • When an operating system loads from its own partition, it always runs the fastest. When other alternatives are used, such as running one operating system within another operating system (using a virtual machine or a virtual disk mechanism), it is always slower (due to higher RAM and hard-drive requirements when using these methods).
  • Bootloaders such as GRUB can be used to choose which operating system to load when each operating system occupies its own partition.
  • The main reason to use separate partitions is for ease of maintenance. When an operating system (OS) occupies its own partition, it can easily be updated without affecting other operating systems or data that might be stored in other partitions.

This is especially useful when certain applications are able to be used by multiple operating systems. A groupware application (such as Kolab), for example, can be placed in its own partition and be used by whichever operating system is booted. It can stay consistent and independent, even when one or more operating systems update themselves. It can then be updated independently of any particular operating system update and in fact be excluded from "automatic updates" by certain operating systems. The linux filesystem can use a separate mount point for any directory, even if the directory exists in its own partition. Here are some examples of directories that are often given their own mount points (often in their own partitions):

  • swap -- Swap partitions allow you to use some of your harddrive space as RAM. Swap prevents your computer from crashing when you run out of RAM space, and additionally, allows the RAM to be used efficiently. See here for much more info on swap.
  • /home -- The /home mount point is where individual user settings are stored. By placing this directory in its own partition, they can be shared between multiple OS's and remain constant even when each OS is updated. See here for more information on /home and a listing of guides for creating a partition for this directory.
  • /boot -- The /boot mount point is where the GRUB bootloader files (needed to boot an OS) are stored. (GRUB can also be used to allow multiple OS's to boot.) Having a dedicated /boot partition can make it easier to run and maintain multiple operating systems. See /boot partitions for more info.

Arguments against partitioning

  • 'Data loss is less frequent with current operating systems.' -- If you believe this one, I have a bridge to sell you.
  • 'The need to run multi-boot systems is mitigated due to the advent of virtualization and virtualization tools like VirtualBox such that running a virtual Windows OS on an Ubuntu system is mostly a breeze.' -- It's not. I've tried it. It runs very slowly on all but the most powerful computers with lots of RAM.
  • 'Partitioning to create swap space is unnecessary since systems are much faster than before, Linux runs more efficiently, and RAM is quite cheap.' -- RAM may be cheap, but not all computer motherboards can expand their RAM capabilities (and therefore still need swap). Further, Linux systems require more RAM these days, not less. Also, it is not the OS that requires plenty of memory, it is the programs that run within the OS that requires memory.

Choosing a filesystem for a data partition

If you need a 'universally writable' drive so that Win, Mac, and *nix operating systems can share files, consider these issues:

  • NTFS is a consideration, but it is proprietary and Window's peculiar usage of these drives means that Linux doesn't quite work perfectly with it. Further, Microsoft has the capability (and sometimes does) remotely lock NTFS folders. Do you want to take that chance?
  • FAT32 was historically a good choice, but its size limitation (32 GB max) makes it quite small for today's standards.
  • The exfat file system has no size limitation, but it is not commonly used.

Other resources