Hi Jiabao,

(1) The concepts of primary and logical partitions are due to the limited 
number of partitions that one MBR on a physical harddisk can handle. The MBR 
can only accomodate information for 4 partions. These 4 partitions that are 
recorded in MBR are primary partitions and if any, one extended partition. In 
many cases people want more than 4 partitions. So the extended partition is 
used as a container to harbor more partitions. The partitions residing in the 
extended partition are called logical partitions. 

The structure of a harddisk can be expressed like this:

====Harddisk======================================
MBR ---primary partition 1
     |-primary partition 2
     |-primary partition 3     
     |-extended partition ---logical partition 1
                           |-logical partition 2  
                           |-logical partition 3
                                     ......
                    free space (if any left)

====Harddisk======================================

The primary partitions and logical partitions will be the usable partitions 
that can be used to store data. The extended partion will normally not be used 
to store any data, it is just a container, a "shell", for the logical 
partitions.

If you run diskmgmt.msc under windows, you can see your harddisk's structure. 
You should be able to see 1~3 primary partitions, and maybe(actually, often) 
one extended partition, and some number of logical partions inside the extended 
partition box, meaning they are "daughter" partitions that resides in the 
extended partion.

In linux installation programs, if you choosed "manually partition the 
harddisk" you can also see a similar diagram. The partitions marked as sda1, 
sda2, sda3, are primary partitions, sda4 is the reserved code for the extended 
partition, and sda5, 6, 7,... are all logical partitions. You can see that 
logical partitions are always within the extended partition. 

To most users, logical partitions works quite samely as primary partitions in 
almost every aspect. You should be able to install any modern PC OS on any 
partition.

On early computers, to properly boot an OS from a partition, there used to be 
restrictions about where you have to put your OS partitions(the 1024 cylinder 
rule). But these days (meaning at least the last 5 years), most computer's BIOS 
and most opterating systems are smart enough to allow you to boot from almost 
anywhere on the harddisk - even from the very end. (The only exception is that 
if you have a 500G HD but you want to run early winXP versions that can only 
handle 128G.) Being either a primary partion or a logical partition is not 
relevant at all. Both linux and the Windows NT series, do not require a 
specific location. So you do not need to worry about where to put your 
linux/windows partitions. But I think it is better to put your OS in primary 
partitions because to backup the MBR(which holds the primary partition 
information) is much simpler than to backup the extended paritition table 
chains. (And backing-up MBR is always a good idea, before and after any system 
installation.)

In your case, if you already have 2 primary partitions, which are your windows 
C: and D:, then I suggest you to creat an 8~16G primary partition for your 
linux's "/" partition, this will be sda3. Then you can creat the extended 
partition and make any number of logical partitions as you like for other uses, 
including formating as swap partition.

If your D: is already a logical partition, and your extended partion is already 
using the entire space after C:, then you can simply make some new logical 
partitions for linux. Linux is not picky on this issue at all.

(2) As I explained in (1), there is no restrictions on where to put these 
partitions. Windows does not need to be on partition 1 either. 

Since you are going to play with partitioning and dual booting, one thing you 
might want to know: the MBR holds some booting instructions that are 
OS-specific. If you have installed windows first, and during installation if 
you allow linux to write the linux bootloader to sda/MBR, then the windowsNT 
booting instructions will be removed from MBR, and then the booting of windows 
will be dependent on the linux bootloader. If your linux bootloader corrupts 
one day, or you format your linux "/" partition one day, both system will be 
unable to boot. 

To fix it, you will need a linux installation disk to restore the linux 
bootloader to MBR and have a working "/boot" in your linux. Or if you do not 
want the linux system at all, you can type "fdisk /mbr" under windows command 
line to restore the windows bootloader to the MBR - if you can somehow boot 
your computer to a windowsNT(win98 fdisk will not work, so DOS startup disk 
will not help you) command line or mount your disk to another windows running 
computer.

If you install the linux bootloader to the first sector of the linux / 
partition(for example, sda3, which is mounted as "/" in your fstab, and the 
third primary partion on your harddisk, and hd0,2 in your /boot/GRUB.conf), The 
linux will not boot after installation if you do not tell the windows 
bootloader to boot another OS. To do this, you have to know how to copy the 
first sector of /dev/sda3 to a file, save it under your windows c:\, say, as 
c:\linboot. If you can do this ,then you add the following to your windows 
c:\boot.ini:

c:\linboot="LINUX"

Then your computer will first use the windows bootloader to enter a OS 
selection interface, then if you choose linux, it will take you to the linux 
bootloader's startup interface and then boot linux. This way if you delete the 
linux one day, windows will not be affected (I guess you want windows more than 
linux on a laptop).

(3) The swap partion do not need to be mannually mounted nor to indicate where 
to mount during installation. When you instruct the installation program to 
format a partition with file system format as SWAP, the program will also write 
the mounting information into your linux's /etc/fstab. Linux will automatically 
mount the swap patition when it boots. You can check the fstab file to see what 
the installation program had done for you by typing the following in linux 
shell:
>su
>cd /etc
>cat fstab

During installation, you only need to creat and format a "/" partition, and a 
swap partition(2x your physical memory recommended), and maybe the /home too 
(but remember not to format it the next time). The /root is only the root 
user's home directory, there is no need to make it a partition. The swap's 
format is linux SWAP, the others are all ext3.

For crystallographic programs, you can make a ext3 partition, and mount it as 
/usr/local. Then you can install all your programs to /usr/local. Each time 
before reinstalling linux, you can backup the system scripts that sets your 
environmental variables (/etc/profile, /etc/bashrc, /etc/csh.cshrc) and restore 
them to the new system afterwards. Then hopefully most of your programs will be 
instantly running again.

Zhijie



  ----- Original Message ----- 
  From: Xie Jiabao 
  To: [email protected] 
  Sent: Sunday, January 18, 2009 1:52 AM
  Subject: [ccp4bb] Create a dual boot windows-linux machine


        Dear all,

        My sincere apologies at the outset for a non-ccp4 question. I am trying 
to install ubuntu-8.04.1 (64-bit) linux on my windows xp containing core2 
laptop so as to create a dual boot system. At the moment windows xp is 
installed on a 30GB partition and there is another 20 GB FAT32 partition which 
was created to share data between windows and linux once the latter was 
installed, and 110 GB of free space. I have a few questions which I would like 
addressed before I install linux.

        a)  I would like to create a linux swap partition of 4-6 GB and have 
the rest as an ext3 linux partition. Should these new partitions be primary or 
logical partitions? What is the difference between primary and logical 
partitions?

        b) Should these new partitions be located at the end of my hard disk 
since Windows likes to be next to the first sector (MBR)?

        c) Should the new partitions be mounted as /swap and /root or /home?

        Thanks in advance,

        Xie
       

Reply via email to