<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
  <card id="article" title="Triple booting on an old PC, part 1: partitioning and Windows XP">
    <p mode="wrap"><a href="#menu">Menu</a></p>
	<p><b>Partitioning</b></p>
	<p>The motherboard supports SATA - no need to deal with IDE adapters. Let's check which disk was detected as sda:</p>
	<pre>
# fdisk -l /dev/sda</pre>
	<p>It will print out info about the disk (size, BIOS name) and its partition table:</p>
	<pre>
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x52bf38d7</pre>
	<p>For me, sda is the SSD, just as I expected. This might be different for you - sda is the 1st disk, sdb is the 2nd disk, sdc is the 3rd and so on. Try different drive letters with "fdisk -l" until you find the disk you're going to multi boot on. </p>
	<p>Having found the correct disk, now we can run:</p>
	<pre>
# fdisk /dev/sda</pre>
	<p>to partition it with the command line. There are TUI/GUI tools too like cfdisk and gparted, but I know Linux fdisk like the back of my hand so that's what I will be using. 1 GB of RAM generally should be enough to boot a live CD with GUI but it'll likely be slow.</p>
	<p>I already backed up everything on this SSD, so I'll create a new <strong>MBR</strong> partition table by typing "o" (without quotes).</p>
	<p>The partition sizes I decided to make are:</p>
	<p>- Windows XP - 100 GB (NTFS)</p>
    <p>- DOS - 200 GB (FAT32)</p>
    <p>- OpenBSD - 100 GB (FFS)</p>
	<p>That leaves half of the SSD unused, which lets its controller wear the flash memory more evenly.</p>
	<p>A disk can have up to 4 primary partitions, and I'm installing 3 systems, so I'm going to make all their partitions primary. The 4th partition could later become an extended partition, which can house a lot more logical partitions.</p>
	<p>To create a primary partition with fdisk, we need to type "n", then select primary with "p" when it asks, then accept the default start position with Enter and finally type size: 100 GB is +100G.</p>
	<pre>
Command (m for help): n
Partition type
p   primary (3 primary, 0 extended, 1 free)
e   extended (container for logical partitions)
Select (default e): p
Selected partition 4
First sector (838862848-1953525167, default 838862848): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (838862848-1953525167, default 1953525167): +100g
Created a new partition 4 of type 'Linux' and of size 100 GiB.</pre>
	<p>After creating the partitions, let's check if they are the right size with "p":</p>
	<pre>
Device     Boot     Start        End   Sectors  Size Id Type
/dev/sda1            2048  209717247 209715200  100G 83 Linux
/dev/sda2       209717248  629147647 419430400  200G 83 Linux
/dev/sda3       629147648  838862847 209715200  100G 83 Linux</pre>
	<p>Now we have to set partition types, so the computer knows if it's meant for NTFS, FAT32 and so on. It's similar to creating them, but this time we use "t":</p>
	<pre>
Command (m for help): t
Partition number (1-3, default 4): 1
Hex code or alias (type L to list all): 07
Changed type of partition 'Linux' to 'HPFS/NTFS/exFAT'.</pre>
	<p>The hex type numbers may seem daunting, but typing L will show you all the codes you can use! The codes we need in this setup are 07 for NTFS (which we use on the Windows partition), 0C for FAT32 and A6 for the OpenBSD partition.</p>
	<p><a href="quadb1_3.wml">Page 3</a></p>
	<p><a href="quadboot.wml">Page 1</a></p>
    <p><a href="#article">Top</a></p>
    <p><a href="#menu">Menu</a></p>
  </card>
  <card id="menu" title="crimson_phoneme's website">
    <p mode="wrap"><img src="../gfx/about.wbmp" alt="" /><a href="../index.wml#about">About</a></p>
    <p><img src="../gfx/blog.wbmp" alt="" /><a href="../index.wml#blog">Blog</a></p>
	<p><img src="../gfx/comp.wbmp" alt="" /><a href="../comp.wml">My computers</a></p>
	<p><img src="../gfx/links.wbmp" alt="" /><a href="../links.wml">Links</a></p>
  </card>
</wml>

