Sunday, March 1, 2009

Installing and partitioning

Partitioning 

Partitioning Demystified


After going through this project, I learned a ton about partitioning. There are 3 types of partitions which are Primary, Logical, and Extended. Think of it broken up into two separate groups. Primary partitions and then Logical/Extended. A primary partition is the partition tables way of saying create a partition with a certain amount of space and separate it from other drives physically. You can have a max of 4 primary partitions on a disc (3 if you are using 1 extended partition) From my experience, most operating systems work best when installed on a primary partition which is what we will be doing. Logical/Extended is the other half of the spectrum. It's the partition tables way of saying "hey, I'm not a physical partition but I'm going to trick the computer into thinking it's a partition via software. So you can create 1 extended partition and then inside the extended partition you can create logical partitions. That way, if you are like me you can have 8 + partitions on one hard drive. It will make more sense when you boot up GParted LiveCD. 

NOTE: I am not the original author of this article, so I could be wrong 

Without realizing it, the original author of this article made a number of assumptions/decisions that ensured that the entire process would work. Here I try to explain what some of these are. 

Most operating systems may work best from a primary partition, but this doesn't seem to be an issue with Linux. You can see from the SUSE Guide on Grub that Linux is just placed in a logical partition, as is done in this quad-booting article. 

This article assumes that your PC's BIOS is new enough that it supports the LBA necessary to overcome the BIOS 1024-cylinder limit as explained in this dual-booting guide. This article also relies on Linux's GRUB boot manager which supports LBA out-of-the-box. If your BIOS didn't support LBA or if you didn't use a LBA-enabled boot manager, you would have to create a /boot partition near the beginning of your disk, which means you would most likely waste a primary partition on Linux. If you waste a primary partition on Linux, you will only have 2 primary partitions left for your other OS's (remember that we need an extended, which is always also primary, partition to hold the logical partitions for Linux's swap and optionally Linux's root and other data). This would have resulted in a paltry triple-boot rather than the intended quad-boot :) 

All these restrictions on primary partitions can probably be rendered moot by using an advanced boot manager such as Acronis Boot Manager; see the forums. 

NOTE ON PARTITION TABLES: Having attempted to use this tutorial myself, I found one of the assumptions made is that your partition table is already set up. Knowing next to nothing about partitions in anything other than Windows, I didn't know that I needed to create/set any particular type of partition table. I had just bought 2 500gig disks for use as RAID-1. Through various trials and tribulations, I found I had to create a new partition table on the non-working disk, with "gpt" ( = GUID Partition Table!) as the type. You could probably use "mac" also. Note -- these two types do not allow extended/logical partitions, as they do not need them. You can create more than 4 primary partitions, unlike when using an "msdos" partition table. . . 

Getting Started

1) Boot into the GParted CD. 
You should have a bunch of unallocated space. 

2) Create partitions in the following order: 
1 NTFS Primary Partition, (for WinXP) 
1 NTFS Primary Partition, (for Vista) 
1 FAT32 Primary Partition, (for OSx86) 
1 Extended Partition (with the rest of the unallocated space on the drive), 

The rest of the partitions will be within the Extended Partition 
1 ReiserFS Logical Partition (for Linux install) 

Then the rest of your partitions as logical partitions. I have one for games, one for programs, one for video, etc.

Installing Vista

Install this to the second NTFS Primary Partition. Should be a straightforward install. Plop in the disc and let r' rip! 

NOTE: If you install Vista after another OS without doing the above steps, Vista will automatically install it's new boot loader which is a pain! You do not want Vista's boot loader installed for this tutorial! 

After it's installed do the following: 

1) Boot the Gparted CD again 

2) Right click on your second NTFS Primary Partition and click on "manage  
  flags". Uncheck "boot" 

3) Right click on your first NTFS Primary Partition and click on "manage flags". 
  Uncheck "hidden"

Installing Windows 98 SE

After you partition and format your hard disk, you can install Windows 98:

1. Insert the Windows 98 Startup disk in the floppy disk drive, and then restart your computer.
2. When the Windows 98 Startup menu is displayed, choose the Start computer with CD-ROM support option, and then press ENTER.
3. If CD-ROM support is provided by the generic drivers on the Startup disk, you receive one of the following messages, where X is the drive letter that is assigned to your CD-ROM drive:

        Drive X: = Driver MSCD001
        Drive X: = Driver OEMCD001

NOTE: If your CD-ROM drive is not available after you boot from the Windows 98 Startup disk, install the CD-ROM drivers that are included with your CD-ROM drive. For information about how to obtain and install the most current driver for your CD-ROM drive, view the documentation that is included with your device, or contact your hardware manufacturer.

4. Insert the Windows 98 CD-ROM in the CD-ROM drive, type the following command at a command prompt, and then press ENTER

            X:\setup

       where X is the drive letter that is assigned to your CD-ROM drive.

5. When you receive the following message, press ENTER, and then follow the instructions on the screen to complete the Setup procedure:

         Please wait while the Setup initializes. Setup is now going to perform a routine check on          your system. To continue press Enter.

Installing WinXP SP3

1. Reboot the computer (This is the operating system equivalent of starting the day with a good     breakfast.)
2. The computer must be on AC Power: SP3 will not install on systems powered solely by        batteries.
3. Download SP3 from Microsoft's Windows Update (You can skip this time-consuming step if      you install SP3 from a CD)
4. Disconnect the network: This will minimize your computer's vulnerability when its security      programs are disabled.
5. Shut down your software firewall (ZoneAlarm)
6. Disable your antivirus program and any other utility that continuously monitors your system       (this includes some anti-spyware programs).
7. The installation of SP3 is a major event in the life of your operating system, so make sure that      no applications are running during the installation. Do not interrupt or interfere with the       installation.
8. Install Service Pack 3 from downloaded code or CD*
9. Reboot twice and confirm that your previously-disabled programs are working (you may      think this is one reboot too many)
10. Connect to the network
11. Rerun Windows Update (to verify that all of the high-priority updates have been installed)
12. Download and install any remaining high-priority updates
13. Reboot
14. Defragment the hard drive

    * If a problem occurs any time after starting the installation, contact Microsoft for free      technical support

     Service Pack 3 will install any missing critical updates issued prior to May 2008. The new     features improve security and should not result in noticeable changes in functionality.


Installing Linux Distros

1. The first thing you will have to do is copy the ISO file(s) of the Linux to your hard disk (ofcourse, you already have it). Make sure that the partition is FAT32 unless the distro you are installing has native NTFS read/write support. Some distros require you to copy the ISO file(s) to the root of the partition. If you keep it inside a folder, the setup might not be able to detect it.

2. Use Winrar to open the ISO file (you need not need to extract it). Now you will have to extract the two files I talked about earlier. The files are usually found inside a directory called isolinux. Different distros might place the files in different location; you just have to search for it, but it isn't hard to locate. These two files are also named differently in different distros. The files that you will need to search and extract are: (the kernel file is shown in green and the Ram disk is shown in red)

Fedora: vmlinuz and initrd.img

Suse: linux and initrd

Mandriva: vmlinuz and all.rdz

Ubuntu: vmlinuz and initrd.gz

Gentoo: gentoo and gentoo.igz

Knoppix: vmlinuz and initrd.img

Slackware: bzImage and initrd.img

Debian: vmlinuz and initrd.gz

3. After you have extracted the two files, copy them to c:\boot (you will need to create the folder "boot")

4. Now download the file called grub4dos from here. (Note: the new versions of grub4dos i.e. 0.4.2 and 0.4.3 does not work. So download the earlier version 0.4.1. Direct download link) Extract the folder "boot" and the file "grldr" from the downloaded zip file. Inside the folder "boot" is another folder called "grub"; copy the folder "grub" to c:\boot. Copy the file "grldr" to c:\

5. Open c:\boot\grub\menu.lst and add these following lines. (Notice that hd0 refers to the first hard drive. If you have more than one hard drive, they will be named hd1, hd2 etc. Replace hd0 with the proper hard drive number incase you have windows installed on another drive.) Replace Linux_kernel and Ram_disk with the appropriate file names below. (the ones you copied to c:\boot)


title Install Linux
kernel (hd0,0)/boot/Linux_kernel
initrd (hd0,0)/boot/Ram_disk




6. Now you have to add grub to your c:\boot.ini file. You can open boot.ini by clicking on Start>Run and typing c:\boot.ini. If Windows does not allow the file to be modified, then go to Control Panel>System and click on the Advanced tab. Now under Startup and Recovery click Settings and then under System Startup click Edit. Open boot.ini and add this line in the end.

C:\grldr=”Start GRUB”

7. You are now ready to install Linux. Restart your PC and from the boot screen select "Start GRUB". This will load GRUB. From the grub screen select "Install Linux". During the setup you will be asked the source of installation. Choose hard disk and then select the hard drive partition where you copied the ISO files. Sometimes you might have to type the whole path of the partition and the exact name of the ISO. So write it down before you begin.

I have personally tested this with Fedora, Suse and Mandriva and it works without problem. I have no doubt it will work for others too.

Update: dougfractal adds that this is possible from Linux too. The method as he describes is:

From the terminal enter these commands

sudo mkdir /distro
sudo chmod `whoami`:`whoami`
cp MYLINUX.iso /distro/distro.iso

Now extract Linux_kernel & Ram_disk to /distro#

Open /boot/grub/menu.lst

#ADD NEW ENTRY#
title Install Linux
root (hdX,X)
kernel /distro/Linux_kernel
initrd /distro/Ram_disk

Reboot and select "Install Linux" from grub.













No comments:

Post a Comment