Saturday, September 12, 2009

My Partitioning Strategy

Synopsis


  • Partitioning shall be done with Partition Magic, Acronis Disk Director or GParted. GParted is the preferred tool. However, compatibility of the partition table is important between different partitioning tools.
  • The current and the past partition layout must be kept on an external media at all time. This layout is produced by the command “fdisk -l -u /dev/[sh]d?” in Linux. The resulting file can be read by a text editor.
  • The MBR shall contain the boot code installed by Debian's mbr package.
  • The first primary partition shall be about 96MB in size, formatted FAT16 and installed with SYSLINUX bootloader and FreeDOS.
  • Another primary partition shall host OpenBSD or Windows XP.
  • One extended partition will be reserved to host any number of logical partitions containing OS, swap and data.
  • The first logical partition inside the extended partition will always be Linux swap for hibernation usage. The second logical partition will be Linux swap exclusively.
  • After Linux swap, the order of logical partitions shall be Linux partitions, Windows partitions and FAT16/FAT32 partitions containing personal data.


Limitation of PC partition table


As I expect to install and explore multiple OS on a single hard drive, I realize the difficulties caused by partitioning limitations. The major limitation is that we can only have up to 4 primary partitions. However, we need a single extended partition so that we can have more than 4 partitions — an extended partition can contain an infinite number of logical partitions in itself. Thus, my final partition layout would have 3 primary partitions and one extended partition.



Recovery Partition


Most manufactured computers have Windows pre-installed. The trend today is that PC vendors (HP, Compaq, Dell, Toshiba etc.) provide a system recovery partition so that users can restore their system back to the factory state in problematic occasions. I don't recommend anyone to remove or erase the System Recovery partition for any reason — even if he actually bought an expensive retail box of Microsoft Windows CD/DVD. Thus, with an intact System Recovery partition (which is a primary partition because it must boot up with a custom Windows installer), we can only have up to 2 primary partitions and one extended partition for our own use.



My Hard Drive Partition Layout

The vendor-provided Recovery partition shall never be removed, but it can contain custom boot codes (for example, GRUB). Assuming that the Recovery partition is formatted as FAT filesystem, you can install GRUB into the Recovery partition so that you can have a nice boot menu for you to choose an OS from when you turn on your PC. If the Recovery partition is formatted as NTFS, GRUB for DOS should be installed instead because the original GRUB cannot natively read NTFS. Alternatively, GRUB can be installed into a logical partition.



There's a way to create a custom Windows XP OEM CD from the System Recovery partition, as explained on howtohaven.com. Once you've created a Windows XP OEM CD, you may remove the Recovery partition at your own peril.



Extended Partition Layout

Allocation of Primary Partitions


Now, we have 2 precious primary partitions to allocate to demanding operating systems after we decided to keep one System Recovery partition and one extended partition. Such demanding OS's include Microsoft Windows and *BSD (i.e. NetBSD, OpenBSD, FreeBSD, etc). Since people using *BSD are very hard to find, I assume you'll use both of the two primary partitions for Windows installations, for example, one for Windows 7 and the other for Windows Vista. In my case, I will reserve one primary partition for OpenBSD and another for Windows Vista Home Premium since I use OpenBSD, though not as often as Linux.



My Partition Table

Space reserved for Vista/Win7 Boot Codes


When Vista is installed on a fresh new hard drive, the first NTFS partition is created starting at the 2048th sector. However, to reserve space for Vista boot codes, I will create the first primary partition beginning at the 96390th sector.



Extended Partition


The extended partition can contain an unlimited number of logical partitions. Therefore, inside the extended partition, I am free to install as many OS's as I wish if there's enough space. I can install Windows XP or a variety of Linux distributions on logical partitions. The first logical partition (/dev/sda5) should be a Linux swap partition because it is the place that should rarely change or move.



To Do


  • Write about shared User data partition for multiple Windows OS's
  • Setting up Read-only Linux partition and Changeable Linux partitions with the help of Unionfs

No comments:

Post a Comment

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger