Tuesday, July 03, 2007

24. Notebook and PC Partitioning Guide

by mujtaba
From Notebookreview

This guide attempts to help users on how to partition their hard-drives,however there are some Model specific guides, for example the HP-Compaq forum has a guide for that, please check your laptop's forum for specific instructions.

Note : I give no warranty with this guide not about the hardware nor the data and software, proceed at your own risk.

The hard drive is split into several partitions.
There are two main kinds of partitions :

1 - Primary partitions : The main difference between the Primary and Extended partitions is the fact that MS-DOS and older Windows versions can boot only from a primary partition.The limit for primary partitions is usually 4 for each hard driver.
2 - Extended partitions : The Extended partitions split into logical drives.Linux and newer versions of Windows like WinXP and Win2K can boot from them.
If the format of the partition (e.g. NTFS,FAT32,ext3) is recognizable in Windows,the Primary Partitions and the logical drives will show-up in My Computer.
Note : If you have purchased an copy of Windows with your Notebook/PC,you would have a hidden partition for the recovery purposes.The recovery partition would usually be either on the beginning(like ASUS notebooks) or at the very end (like some of HP laptops).If you have not been given a recovery cd,make sure to take the best care you can of this partition.

The data about the position and size of the partitions,Also the indicator of the partition type is recorded in a small block at the beginning of the drive.This data is called the partition table.
At many times,only the partition table gets damaged,so if you back-up the partition-table before doing risky operations.

The Recovery partition is usually a FAT32 drive.With some kind of Windows installed on it.The boot partition (the drive from which the bios tries to boot) is the recovery partition,it waits for the special key (e.g. F9 on my ASUS),if the key is pressed the recovery partition brings up the recovery menu,if not after a few seconds it proceeds to booting from the first partition.

Recovery CD's not working :
Sometimes the MBR(Master boot record) gets changed for some reason(usually when newbies try to install linux).At this point trying to use the Windows recovery CD's will be useless.It'll give some errors or crash half-way installing linux.
At this point, you should change the MBR.You can do it in these ways :
(note these two ways only help you to re-install windows or use recovery CD's if you want to revive your dead linux, search for "Reinstalling Grub" rescue guides)
a) If you have a Windows XP Installation disk which is able to bring the recovery console :
Type in : fixmbr.
b) If you don't have such CD's.Find a DOS-based boot CD like this one : www.ultimatebootcd.com
Then boot from the CD.Type : "fdisk /mbr"
(Note some of the boot CD's might not have fdisk,you'll have to download it : like this one and burn it to the same CD)

Which partition format to use :
There are two main kinds of partition that Windows can make use of : FAT32,NTFS (FAT16/12 is outdated, and because it's size limit you are always forced to make FAT32 - and also some features like long file names).
NTFS replaced Microsoft's previous FAT file system, used in MS-DOS and early versions of Windows. NTFS has several improvements over FAT such as improved support for metadata and the use of advanced data structures to improve performance, reliability, and disk space utilization plus additional extensions such as security access control lists and file system journaling. The exact specification is a trade secret of Microsoft.

NTFS has five versions:

* v1.0
* v1.1
* v1.2 found in NT 3.51 and NT 4
* v3.0 found in Windows 2000
* v3.1 found in Windows XP, Windows Server 2003, and Windows Vista
source : wikipedia
But there are some problems, not many utilities can work with NTFS, linux cannot work with NTFS (I think it'll only be read-only and to be able to write to it you need to patch the kernel - a real pain).

Doing Partition from scratch :
If you are doing partition from a completely blank hard-drive,I personally suggest Ranish Partition manager it's complete,free and runs under DOS.
Another option is to do the partition using Linux,but remember,the vfat partition done by the Linux installer are not completely recognized by Windows so you might be forced to reformat them.
You can also install Windows XP/2K on the empty drive and let it do the partitioning.If it,by some reason,formatted the whole drive into a single-large partition,you can resize it by the steps below.
Some people might like to have their drives to exactly have 1,500,000 Kilobytes or something,this is usually impossible (except some special numbers),because this size depends on the number cylinders on the disk (the size of the cylinders is unchangeable)

How to Resize,Merge Partition :
If you delete/make files too much (don't worry,Windows does it all the time) the data gets fragmented,if you want to know how your hard-drive looks like do this : bring up the run window (windows key+R) or from the start menu,and type in : "dfrg.msc",select one of your drives and press the analyze button.
If you try to resize a partition using newer software like partition magic,you see that even if 10% of your drive is used (90% free disk space) you only can diminish the size to (for example 30%),if you do defragmentation,you will be able to do it.
Merging partitions,this sometimes proves to be a risky one,sometimes some partition software/OS makes little changes to the drives/partitions,so trying to merge the two drives simply fails and makes the second drive unusable.Once when I was trying to merge two partitions,Partition Magic mumbled something about wrong size or something,failing in the middle of the operation and thus destroying the second drive.
So,you might want to back-up your second drive somewhere if the data is important.

How to avoid partition-disaster :
1 - Do not use every partition software you can reach,some utils like the ancient MS-DOS partitioning ones,like the old FDISK might not recognize your "large" hard-drive.
2 - If no CD has been supplied with the notebook,burn to recovery partition to a CDs/DVDs at once.This can be done with Norton Ghost or similar software.At some notebooks like a friend's HP Pavilion,at some place the laptop itself suggests this thing to do(refer to your user manuals to find out how to do it).
3 - Use good software to do the partitioning,Paragon Partition manager is good,runs under Windows and user friendly.

What to do after a Partition-disaster :
Edit : 0 - Partition Recovery software is also available,it tried to find the volumes themselves without consulting the partition table.there are also free edition available,sadly,when I once came to use one of them,it was too late.(Partition Magic had made sure of that).There is also an extremely useful utility called "PC Inspector".Apart form detecting deleted partitions, it can also search for file signatures and magic id's and recovery them.
1 - Healing the damage : Before you go wiping all the data you have,the good thing will be to try to revive the data.On many cases the only damaged data is the partition table.
For example many users including me,had their partition table messed up after Trying to Install Fedora Core 2,the problem arises from doing the first partitioning using that ancient MS-DOS FDISK.For this particular problem a very easy solution can be found by google...
(Instead of fixing the partition table in 3-minutes, I proceeded with step 3)
2 - Trying to contact some of the support/crisis centers,they know how to do stuff...
3 - Sometimes the partition table has been completely messed up.In these cases even linux's FDISK,Ranish partition manager and any software I tried,get's confused and failes to edit the hard-drives.If the data is not crucial,you might want to try "Killdisk",the most brutal way to clean a drive.This thing starts setting every single bit of the data on the hard-disk to zero.I tried it once,let it wipe 6~8% of the hard-disk,skipped the rest,then started partitioning...

Converting Partitions
Conversion can be done by many utilis and by Windows itself.
Important notice : You cannot convert NTFS to FAT32 so easily.For example Kaspersky antivirus has some protective utility that adds some data for later lookup not as files but as some internal data.This feature only works with NTFS.So if you convert the drives.It'll be annoying.You first have to make Kaspersky delete these data before proceeding to conversion.

MBR, bootsector, what are they ?
If the BIOS finds a bootable device, it loads and executes its boot sector. In the case of a hard drive, this is referred to as the master boot record (MBR) and is often not operating system specific. Usually, the MBR code checks the partition table for an active partition. If one is found, the MBR code loads that partition's boot sector and executes it. The boot sector is often operating system specific, however in most operating systems its main function is to load and execute a kernel, which continues startup. If there is no active partition or the active partition's boot sector is invalid, the MBR may load a secondary boot loader and pass control to it and this secondary boot loader will select a partition (often via user input) and load its boot sector, which usually loads the corresponding operating system Kernel.

WARNING : From the recent posts here and on the internet, it seems that Partition Magic cannot edit the partitions of Vista laptops correctly, leading to loss of data.

Some partitioning software :
-PC Inspector : An extremely useful and free partition/file recovery program.It can recover both partitions and find the files that were in deleted partitions (obviously the space that belongs to the partition shouldn't have undergone a full format) [Thanks to Sesshomaru for point this out )
-Paragon Partition : A partition manager I tried (suggested by a friend), this one is extremely good.I have much better experience with it that Partition Magic.
-Newer Versions of FDISK.
-PowerQuest (now Norton) Partition Magic : On of the most famous partition software,though I have some bad experience from it.Also under Windows.
-Ranish Partition Manager : A very good software,under dos,but very intelligent.
-Linux's FDISK : A good software - 100% user enemy but powerful - but as I pointed out,the vfat drives are not recognized too good under Windows.
-Disk Druid : The partition software running on Linux setup on many distributions (e.g. Fedora Core 5)
-QTParted and GParted : The partitioning utilities coming with KDE and GNOME.
-KILLDISK : The most brutal way to clean a drive.This thing starts setting every single bit of the data on the hard-disk to zero.

No comments: