个人工具

“UbuntuHelp:HowToRemoveWindows”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/HowToRemoveWindows}}
 
{{From|https://help.ubuntu.com/community/HowToRemoveWindows}}
 
{{Languages|UbuntuHelp:HowToRemoveWindows}}
 
{{Languages|UbuntuHelp:HowToRemoveWindows}}
=== Read This First ! ===
+
== Before you Start ==
This page is in construction. Do '''*not*''' follow the advice on this page yet. There is a good chance that you will destroy your computer if you do.
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=important.png%7D%7D Before you start fiddling with your partitions, you should make sure that you have '''ALL IMPORTANT data backed up''', preferably on a secondary hard drive (internal or external), a USB flash drive, or a CD-R or DVD-R.  Although it is not common for problems to happen during the partitioning process, it is still possible.  Actually, the primary cause of data loss is ''you''!  Users sometimes get confused and end up deleting the wrong partition, or just forget to backup their family photos and favorite music before they delete partitions.  If at any point during this process you get confused or concerned, '''STOP and ask for help'''. The best place for this is the [[http://ubuntuforums.org|Ubuntu Forums]].
It is the hope that after some work this page will contain information about how to remove Microsoft Windows<sup>TM</sup> from your Ubuntu-computer and add the HD-space of it to your system.
+
This guide is designed primarily for users who have a dual boot that now want to fully escape Windows and go purely Ubuntu.
=== About ===
+
== Using the [[UbuntuHelp:LiveCD|LiveCD]] to Remove the Windows Partition ==
You have on your computer Windows. You discover Ubuntu and install it on your computer also. You have now a dual-boot system with Windows and Ubuntu on it.
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=cd.png%7D%7D There are other partition editors available, but GParted is this documentor's favorite and is already available to you if you have an Ubuntu [[LiveCD]].  You can also use the [[http://gparted-livecd.tuxfamily.org/|GParted LiveCD]].
If everything goes well then you will remember some months later, probably when your hard disk is almost full, that you still have X Gb free on that Windows-partition that you are not using. So why not delete Windows and use those Gigabytes for something else, like adding more space to your Ubuntu installation? Or you still want to keep Windows but reduce the size of the partition?
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png%7D%7D Please note that although you can install GParted inside your Ubuntu installation, you will be unable to resize your root partition without a [[UbuntuHelp:LiveCD|LiveCD]] since you cannot change a partition that is mounted.
On this page we will explain you how to do this. This written for Ubuntu 5.10.
+
=== Boot the Disc ===
If you find other manuals about his lits the here;
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconCDrom.png%7D%7D Place the [[UbuntuHelp:LiveCD|LiveCD]] into your CD/DVD drive, and reboot the computer.  Each computer is different, but you may need to change your BIOS to have the system boot from the CD drive before the hard disk.  Refer to your computer manufacturer's documentation for this.
* http://www.linuxfocus.org/English/July1999/article101.html - From 1999 !
+
=== Run GParted and Locate Windows ===
==== 1.A Removing your Windows partition ====
+
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=navigate.png%7D%7D On the Ubuntu [[UbuntuHelp:LiveCD|LiveCD]], go to System->Administration->Partition Editor.  If you have more than one hard drive on your computer, choose the correct device from the drop down box in the upper right hand corner of the window. Your windows partition will most likely be formatted as NTFS and have a boot flag, which makes it easy to locate. Again, if you are unsure, don't delete it!
''If you like to keep Windows but reduce the partition see 1.B''
+
=== Deleting the Windows Partition ===
.....
+
Select the correct partition, either from the bar graph representation of your disk, or from the list.  Now if you are sure that you want to proceed, press the Delete button at the top with the trash can icon, or right click the partition from the list and choose Delete.  When you are finished, click the Apply button.
==== 1.B Reducing your Windows partition ====
+
You will now be asked if you are sure you want to apply the pending operations.  After reading the suggestion, click Apply.
==== 2. Add the new free space to your Linux-system ====
+
=== Use the Newly Freed Space ===
==== Advice 1 ====
+
Now that you have a section of unallocated space, you can either format it as the filesystem type of your choice to use as a data partition (or something else), or you can resize an adjacent partition to use this space.
To shrink your Windows partition from 40 to 8GB:
+
==== Resizing an Existing Partition ====
1. Boot into Win and defrag your filesystem.                                                                                          
+
Right click the partition that you want to expand into the empty space and select Resize/Move. You can use either the number sizing, or you can graphically drag the arrows on the visualization into the empty space (the numbers will adjust automatically). When you are finished, click the Resize/Move button, then Apply in the GParted windowAgain, read the prompt and click Apply.  The operation may take awhile, depending on the size of the partition - '''DO NOT interrupt this process''', or you risk losing everything on the partition you are resizing.
2. Boot up the Breezy [[UbuntuHelp:LiveCD|LiveCD]] and start up gparted.                                                               
+
==== Creating a New Partition ====
3. Shrink your Windows partition by half.
+
If you choose to simply use the newly freed space as a new partition, select the unallocated space and click the New button (or right click).  Choose which filesystem you want, then click Add, then Apply, and Apply again.
4. Reboot into Windows, let chkdisk run, defrag the drive again.
+
Since you are not using Windows on this system anymore, ext3 is probably the best choice for your new filesystem. If you plan on sharing this drive with Windows (maybe you have Windows on another drive on this computer), NTFS or FAT32 may be easier to share with.
5. Go to 2 repeat as necessary.                                                                               
+
== Reboot ==
 +
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBoot.png%7D%7D You can now reboot your system - go to System->Quit->Restart.  Don't forget to take out the [[UbuntuHelp:LiveCD|LiveCD]] at the beginning of the boot sequence since you can't remove it while the disc is being used and you don't want to load it again.
 +
== Further Operations ==
 +
=== Edit GRUB ===
 +
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDevelopment.png%7D%7D Once back in your install, you will probably want to remove Windows from your GRUB menu. Using root privileges and your favorite text editor, open /boot/grub/menu.lst
 +
In Ubuntu, run:
 +
<pre><nowiki>
 +
gksudo gedit /boot/grub/menu.lst
 +
</nowiki></pre>
 +
In Kubuntu, run:
 +
<pre><nowiki>
 +
kdesu kate /boot/grub/menu.lst
 +
</nowiki></pre>
 +
Or for a terminal interface, run:
 +
<pre><nowiki>
 +
sudo nano /boot/grub/menu.lst
 +
</nowiki></pre>
 +
Now scroll down into the file to where it says something similar to
 +
<pre><nowiki>
  
You can only shrink an NTFS partition by 1/2 each step - there is a MFT mirror in the middle of the partition which limits how much you can shrink it.
+
# This is a divider, added to separate the menu items below from the Debian
You can then repartition the free space or grow your existing partitons to fill.  
+
# ones.
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
+
title Other operating systems:
 +
root
 +
 
 +
 
 +
# This entry automatically added by the Debian installer for a non-linux OS
 +
# on /dev/sda1
 +
title Microsoft Windows XP Professional
 +
root (hd0,0)
 +
savedefault
 +
makeactive
 +
chainloader +1
 +
</nowiki></pre>
 +
You can place a # in front of each line to "comment out" these entries.  If you are comfortable with deleting the entries, you can also do that.  After you you save and close, these entries will no longer be available at the GRUB menu.
 +
=== Edit /etc/fstab ===
 +
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDevelopment.png%7D%7D If you made a data partition, you can have it automatically mount by adding the correct entry to fstab, which you can edit using root privileges.
 +
In Ubuntu, run:
 +
<pre><nowiki>
 +
gksudo gedit /etc/fstab
 +
</nowiki></pre>
 +
In Kubuntu, run:
 +
<pre><nowiki>
 +
kdesu kate /etc/fstab
 +
</nowiki></pre>
 +
Or for a terminal interface, run:
 +
<pre><nowiki>
 +
sudo nano /etc/fstab
 +
</nowiki></pre>
 +
You may also need to change UUIDs in your fstab file if they changed (perhaps due to partition resizing). To see the UUIDs for your partitions, run one of these two commands:
 +
<pre><nowiki>
 +
sudo blkid
 +
sudo ls -l /dev/disk/by-uuid
 +
</nowiki></pre>
 +
For more information regarding fstab, see [[Fstab]].
 +
== Other Resources ==
 +
{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBook-small.png%7D%7D
 +
* [[LiveCD]]
 +
* [[Fstab]]
 +
* [[HowtoPartition]]
 +
----
 +
[[category:CategoryDocumentation]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年10月19日 (日) 05:56的版本

Before you Start

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=important.png%7D%7D Before you start fiddling with your partitions, you should make sure that you have ALL IMPORTANT data backed up, preferably on a secondary hard drive (internal or external), a USB flash drive, or a CD-R or DVD-R. Although it is not common for problems to happen during the partitioning process, it is still possible. Actually, the primary cause of data loss is you! Users sometimes get confused and end up deleting the wrong partition, or just forget to backup their family photos and favorite music before they delete partitions. If at any point during this process you get confused or concerned, STOP and ask for help. The best place for this is the [Forums]. This guide is designed primarily for users who have a dual boot that now want to fully escape Windows and go purely Ubuntu.

Using the LiveCD to Remove the Windows Partition

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=cd.png%7D%7D There are other partition editors available, but GParted is this documentor's favorite and is already available to you if you have an Ubuntu LiveCD. You can also use the [LiveCD]. {{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconNote.png%7D%7D Please note that although you can install GParted inside your Ubuntu installation, you will be unable to resize your root partition without a LiveCD since you cannot change a partition that is mounted.

Boot the Disc

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconCDrom.png%7D%7D Place the LiveCD into your CD/DVD drive, and reboot the computer. Each computer is different, but you may need to change your BIOS to have the system boot from the CD drive before the hard disk. Refer to your computer manufacturer's documentation for this.

Run GParted and Locate Windows

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=navigate.png%7D%7D On the Ubuntu LiveCD, go to System->Administration->Partition Editor. If you have more than one hard drive on your computer, choose the correct device from the drop down box in the upper right hand corner of the window. Your windows partition will most likely be formatted as NTFS and have a boot flag, which makes it easy to locate. Again, if you are unsure, don't delete it!

Deleting the Windows Partition

Select the correct partition, either from the bar graph representation of your disk, or from the list. Now if you are sure that you want to proceed, press the Delete button at the top with the trash can icon, or right click the partition from the list and choose Delete. When you are finished, click the Apply button. You will now be asked if you are sure you want to apply the pending operations. After reading the suggestion, click Apply.

Use the Newly Freed Space

Now that you have a section of unallocated space, you can either format it as the filesystem type of your choice to use as a data partition (or something else), or you can resize an adjacent partition to use this space.

Resizing an Existing Partition

Right click the partition that you want to expand into the empty space and select Resize/Move. You can use either the number sizing, or you can graphically drag the arrows on the visualization into the empty space (the numbers will adjust automatically). When you are finished, click the Resize/Move button, then Apply in the GParted window. Again, read the prompt and click Apply. The operation may take awhile, depending on the size of the partition - DO NOT interrupt this process, or you risk losing everything on the partition you are resizing.

Creating a New Partition

If you choose to simply use the newly freed space as a new partition, select the unallocated space and click the New button (or right click). Choose which filesystem you want, then click Add, then Apply, and Apply again. Since you are not using Windows on this system anymore, ext3 is probably the best choice for your new filesystem. If you plan on sharing this drive with Windows (maybe you have Windows on another drive on this computer), NTFS or FAT32 may be easier to share with.

Reboot

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBoot.png%7D%7D You can now reboot your system - go to System->Quit->Restart. Don't forget to take out the LiveCD at the beginning of the boot sequence since you can't remove it while the disc is being used and you don't want to load it again.

Further Operations

Edit GRUB

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDevelopment.png%7D%7D Once back in your install, you will probably want to remove Windows from your GRUB menu. Using root privileges and your favorite text editor, open /boot/grub/menu.lst In Ubuntu, run:

gksudo gedit /boot/grub/menu.lst

In Kubuntu, run:

kdesu kate /boot/grub/menu.lst

Or for a terminal interface, run:

sudo nano /boot/grub/menu.lst

Now scroll down into the file to where it says something similar to


# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1

You can place a # in front of each line to "comment out" these entries. If you are comfortable with deleting the entries, you can also do that. After you you save and close, these entries will no longer be available at the GRUB menu.

Edit /etc/fstab

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconDevelopment.png%7D%7D If you made a data partition, you can have it automatically mount by adding the correct entry to fstab, which you can edit using root privileges. In Ubuntu, run:

gksudo gedit /etc/fstab

In Kubuntu, run:

kdesu kate /etc/fstab

Or for a terminal interface, run:

sudo nano /etc/fstab

You may also need to change UUIDs in your fstab file if they changed (perhaps due to partition resizing). To see the UUIDs for your partitions, run one of these two commands:

sudo blkid
sudo ls -l /dev/disk/by-uuid

For more information regarding fstab, see Fstab.

Other Resources

{{https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconBook-small.png%7D%7D