Redirect

Prepare Disks Whether you have used the internet-connected Linux distro or the Gentoo minimal installation CD way to get to here, yo...

Prepare Disk Gentoo


Prepare Disks

Whether you have used the internet-connected Linux distro or the Gentoo minimal installation CD way to get to here, you’re all set. At this step, you have to setup a space for Gentoo to sit in in your hard disk. Preparing/partitioning disks is a big topic and I’m gonna summarize it here. Your disk is divided into sections called partitions. Each partition have a size and a filesystem. The filesystem is a way to organize folders and files in a way the OS can understand. There are alot filesystems out there like ext2, ext3, HFS, HFS+, NTFS, FAT, …, etc. (If you don’t know these names, it’s ok, don’t panic). In order to install an operating system into the hard disk, you have to allocate a space for it in the disk. That is, you have to make a partition for the OS to write itself into and use. If you want learn more about disks and partitions I recommend searching for a good tutorial rather than reading my summary because it’s a long and interesting topic.
Ok, now you understand why we need to partition the disk for Gentoo to use. To partition your disk you have to use a partition editor program like ‘Partition Magic’ on Windows or ‘gparted’ on Linux. Or use the most basic partition editing tool ‘fdisk’ (but it lacks the ability to move partitions). You need to create what every Linux distro needs from the disk. A root partition and a swap partition (Although some guys reported to me that using Linux in the huge memory age [this age], there’s no need for a swap partition). You can create a separate boot partition, home files partition or anything you like. Most Linux users set one root partition along with a swap partition. You have to sit and decide your partitioning design then carry on. Once, you’ve prepared your disk for Gentoo you can continue installing Gentoo. I’ll use ‘fdisk’ to create three partitions boot, root and swap partition (assuming my disk name is /dev/sda):
(WARNING: don’t do this blindly. You will lose all of your information. I’m assuming you don’t need any of your files and partitioning the whole /dev/sda disk for Gentoo).
fdisk /dev/sda
Command (m for help):
First delete all of your exiting partitions:
Command (m for help): d
Partition number (1-4): 1
Keep on deleting the partitions until there’s no any. Second, Create the boot partition (following the Gentoo Handbook, boot partition will be 32 MB):
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3876, default 1): 
(Hit Enter)
Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): +32M
(notice the +32M that means I want the boot partition to be of size: 32 MB).
Then, toggle the bootable flag by:
Command (m for help): a
Then, create the swap partition:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (56-3876, default 56): (Hit enter)
Last cylinder or +size or +sizeM or +sizeK (65-3876, default 3876): +512M
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
And now swap is created. Root partition is left:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1-3876, default 1): (Hit Enter)
Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): (Hit Enter)
(NOTE: hitting enter the ‘Last cylinder’ prompt makes the partition take the rest of the disk).
And last, we have to save our work and write the partition table to physical disk:
Command (m for help): w
At this stage, you have setup your disk and is ready for Gentoo installation. Comming up in Part 2…

References

0 comments: