Tag/tag.png

Duplicate Article
This article covers the same material as another article. More info...

If you are running Windows and would like to install Linux on your system, you will need to make some free space on your hard drive for it. Changing the layout of your hard drive is called partitioning.

The ubuntu installer's partitioner is one of the safest ways to partition a hard disk. This is not an excuse for not making backups of your important files.

The default setting for the ubuntu partitioner is to delete everything on the first hard drive and start from scratch. If you want to preserve your Windows system, this is not what you want to do. What you need to do is create some free space.

Boot the installer.

Make your way to the partitioner.

Instead of taking the default, select manual editing of the partition table.

Select the partition that you want to resize. Hit enter.

Select the size. Enter a smaller size and hit enter. Say yes when asked if you want to change the partition table. You will be shown some free space when the new partition table is displayed.

From this point, you can select guided partitioning and the installer will calculate everything else for you.

If, when you are trying to shrink your partition, you are not given the option to enter a smaller size, it is because the installer does not feel it is able to resize the partition. Possibly because it thinks it is full, is corrupt, or has some other problems that it cannot solve.

Partitioning an NTFS (windows) partition is usually easy and straightforward. The Warty installer did not have this functionality, but the Hoary installer does.

Discussion

  • Considering that this is such a vital and dangerous stage of installing Ubuntu, I think this topic is a bit blasé. It needs a lot more detail and clarification, for instance:

1) It says "Select the partition that you want to resize". Most users will want to create a new partition, not resize one. I assume the process might be resize existing partition, then use free space to create another, but it's not obvious at all.

2) How do they know which partition they want to install on? Partitions seem to be only identifiable by their size.

3) If the user has to create a new partition (as most would do), should they select "New partition table" (on what i gather is the physical drive), or "Edit partition" (on what looks like existing partitions)?

4) Most importantly: Exactly which files will be destroyed if the user does dare to create a new partition table / edit a partition? Will undo really work, restoring deleted files?

Until this critical aspect of installation is clarified, I won't be installing Ubuntu anytime soon, and I'm a lot geekier than the average. I know any normal user would _never_ get through that partitioning wizard. I reckon the only people getting through this wizard are experienced partitioners and people with a completely blank drive. That's not a lot of people.

REPLY: Thanks for pointing that out, partitioning is a little complicated to explain, but I'll have a try at answering your questions.
1)Most computers come with Windows pre-installed and most often have Windows in one partition, occupying the entire disk.
When that is the situation then it is relatively simple to resize the Windows partition smaller and install Ubuntu after it, just as the above instructions say.

Other computers come with a recovery partition first on the hard disk with the Windows partition next.
Some also might have a data storage partition as well.
In a situation like that the user may need to be aware of the partitioning rules for hard discs with the dos type of partition table.
We can have between zero and four primary partitions, or between zero and three primary partitions plus one called an extended partition.
An extended partition can contain a number of logical partitions, providing they are contiguous (arranged in series).

The use of an extended partition with logical partitions inside it allows us to divide the hard disc into many partitions instead of just four.

A recovery partition is normally a primary one and Windows OS partition will usually be primary too, because Windows will only boot in a primary partition, (except in special circumstances).
It makes no difference to Ubuntu whether it is installed in primary or logical partitions, but the default for the installer is to create a / (root) as primary and a swap area as a logical partition inside and extended partition.
If you find two primary partitions already you should be able to resize and move each of them to make room for Ubuntu and Ubuntu can be in either a primary or a logical partition.

If you find that there are three partitions or more in your hard disk already, you will want to be aware of which are primary and which ones and logical.
If there are already three primary partitions will be forced to make an extended partition and install Ubuntu in logical partitions.

If there are two primary partitions already you can make one more primary partition and then you should make an extended partition if you want to keep the option of making more partitions any time in the future.
Some partitioners create the extended partition automatically when you create a logical partition, but others need the extended partition specified. The Ubuntu installer does it automatically.

If you need to do anything fancy or complicated such as resizing more than one partition and moving partitions around in order to make enough free space for Ubuntu then it will be easier to use Gnome Partition Editor in the Ubuntu 'Desktop' Live CD or GParted Live CD to prepare your partitions before you begin the installation.

A small number of people build their own computers or buy a separate hard disk and fit it into their computer case or have that done for them.
If you have a whole hard disk to install Ubuntu in, you will just need to have the installer create new partitions in that hard disk to install Ubuntu in.
In that situation, partitioning is normally simple enough.

2)If you don't already know what partitions you have in your computer, you can use the Ubuntu Desktop Live CD to take a look with Gnome Partition Editor or with the command 'sudo fdisk -lu' in a terminal.

3) I'll check how to create a new partition in free space with the latest Ubuntu Desktop Live CD and edit this when I'm certain I have the right information.
Setting a new partition table, or disc label will zero the existing partition table and erase the information about the partitions you have now from the hard disk.
If someone did that by accident or from lack of knowledge then they would need special software to restore their partition table again regain access to any data that was stored in any partition.
That's one of the reasons why we always make a full backup of all our data before starting any work with any hard disk partitioning software.
Although the software is as safe as it can be made, humans make mistakes.
An invisible grain of dust or oily film on an optical drive lens or a scratch on a CD can cause errors that can cause a partition table to be corrupted.
Sometimes, there can be a pre-existing glitch in the partition table left behind by an incompatible previous partitioning program. Normally the Ubuntu installer will sense a partition table that has something in it that the partition editor doesn't agree with or understand and refuse to partition the disc in order to fail on the safe side.

4) No files are destroyed when someone sets a new (empty) partition table. Access to the files in the way that you are accustomed to is temporarily impossible though.
The partition table's code which contains information about the partitions starting and ending sectors and other information will be erased, so the computer won't be able to find the file system information anymore.
The file system information after the first sectors of each partition contains information in turn , which leads to the exact location of each file.
The program TestDisk is an excellent program for rebuilding a corrupted or deleted partition table.
TestDisk scans the hard disc for the starting sectors of partitions and can rebuild the partition table from that information.
TestDisk is available in the Ubuntu repositories and installable in the Ubuntu Live CD.
It can also be found in the Ubuntu Rescue Remix Live CD, GParted, System Rescue CD and Knoppix, and many others.
In most cases TestDisk can fix the partition table and thus recover all your data.
If something worse has gone wrong (unlikely), and even the starting sectors of the partitions can't all be found, (maybe they got overwritten somehow by accident), then another program that comes with TestDisk called PhotoRec can be used to scan the hard disk to recover the files only.
There are more good data recovery programs in the Ubuntu Rescue Remix CD, it would be wise to ask for help in Ubuntu Web Forums and read all documentation well before using file recovery software. Hopefully you'll never need it anyway.

I hope that helps clear up a few doubts people have about partitioning. If you're still not sure then it would be a good idea to ask for help in Ubuntu Web Forums.

Here are a couple of links to external sites that may be helpful:
Plan Partitions by aysiu
Help on Partitioning by Herman


forum/installation/Partitioning (last edited 2009-08-15 04:13:07 by rocket2dmn)