Now to build a permanent system in the VM.
The first thing is to set up the hard disk.
We need to do several things here:
- Partition the single physical disk into several logical volumes.
Partitioning primarily allows us to use several different kinds of file-systems at once. - Choose which file-systems we'll use on each partition, and create them.
Windows users will be surprised at this; the only file-system most Windows users will ever know is NTFS; and NTFS is a very strong and well-featured file-system. For us, though, it's more interesting than that.
The fundamental fact is, different file-systems are designed for different use-cases.
For example, ext3 is very robust and simple and supported by just about everything; it is a good choice for a boot partition.
Another example: Reiser-FS is optimized for high speed when dealing with lots and lots of tiny files. This makes it a good choice for a swap-file or temporary-file partition. - Install the operating-system.
This step is actually pretty simple, so long as you have a working Internet connection. - Configure the bootloader.
The bootloader is a small program that is automatically executed every time the computer is powered on. It's responsible for allowing the user to select which system to boot into, determining where the system files are, and starting the system correctly.
So, without further ado ...
Partitioning
We're going to break our hard-disk up into several partitions:
- /boot -- ext3
Contains boot-level files and programs, including the bootloader. - swap -- swap
The swap-file is used by Linux to hold "pages" of memory when they're not immediately needed in RAM. Making a dedicated partition for this gives better performance. - /var -- ReiserFS
Contains "various" things: cached files, log-files, certain temporary files ... - /home -- ext4
Contains users' profiles and personal files.
We're making this a separate partition so that an overacquisitive user won't be able to crash the system by taking space away from Linux. - / -- ext4
That is -- everything not mentioned here will be on the fourth and final partition.
First, you'll need to confirm the hard-disk's device-name.
Execute: fdisk -l
This uses the disk-format utility to list all detected disks.
Here, the hard-disk is called /dev/sda.
Now, we need to format (partition) it.
Execute: cfdisk /dev/sda
Now we're free to start creating partitions.
Let's create the boot partition first.
Create a New partition.
Let's go ahead and make it a Primary partition.
The boot partition only needs to hold a few files; so we needn't make it very big at all. 32 MB will more than suffice.
We're using a VM, and so it makes no difference where we place partitions. However, on spinning disks, the beginning of the disk generally makes for faster reads/writes than the end.
This boot partition is a special case, however. Because it's a primary partition, we need to place it at the beginning of the disk.
Finally, there's only one more step. Because this is the boot partition, we need to flag it as bootable.
So scroll down to highlight the new partition, highlight the "Bootable" command, and press Enter.
And that defines the boot partition!
Using the same steps, define the other (logical) partitions:
- swap -- Size this at (RAM x 2) = 1024 MB. Place at the beginning of the disk.
- /var -- Make this a sizeable 2048 MB. Place it anywhere you like.
- /home -- Let this be a middling 1024 MB.
- / -- Give it everything else.
Mark swap as a swap partition.
Select the partition and execute Type.
You'll see a big list of available types to assign. Note which type is "Linux swap/Solaris" (here, 82).
On the next page, simply enter the type number and press Enter.
You can see that swap now has the correct type assigned.
Now you need to Write your partitions, to save them to the hard-disk.
Don't freak -- you don't have any data on this hard-disk anyway, so go ahead and "write the partition table to disk".
Great success, high five!
Now it's on to creating the file-systems -- but that'll have to wait til Part the Third.
Now it's on to creating the file-systems -- but that'll have to wait til Part the Third.
No comments:
Post a Comment