HOWTO: Install Sabayon with GRUB2 and GPT on a New System

From Sabayon Wiki
Revision as of 10:52, 27 October 2012 by Hatalar205 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
i18n: en tr

A. A Little Background:

In terms of HDD formatting and booting, the world of computing is in the middle of an interesting yet confusing phase. Both the transition from MBR to GPT partition schemes and the new GRUB bootloader, which is not backwards compatible, introduce a learning curve where geeks haven't had one in a long time.

The Goal:

  • A flexible and extensible, forward compatible 64-bit Linux-based system
  • Sabayon will be the primary OS, with partitions for 2 more distros
  • The ability to easily erase and reallocate partitions if desired
  • Separate partitions for swap, /data, and /boot to be shared between all distros

Hardware and Software used:
  • A newly built system with modern components
         o 2.8GHz Hex-Core AMD CPU
         o AM3 Socket MoBo with new BIOS that recognizes all hardware
         o 4GB DDR3 RAM
         o 1TB HDD
         o Samsung DVD/CD optical drive 


MBR, or Master Boot Record, is a partition table format that has been around for over 30 years. It has served us well, but it is quickly becoming obsolete. It is still, by far at the time of writing, the most deployed and most compatible way of doing it for desktop PC's. If you've ever partitioned you know that there are annoying quirks that it has. The two most confronting are that it only allows for 4 primary partitions and the device it is used on cannot exceed 2TB.

GUID Partition Table, or GPT, is the next generation solution for sorting HDD's and SSD's. GPT pushes the device limit all the way out to 9.44 billion TB's, allows for seemingly unlimited primary partitions, and even allows you to attach a short label to each, so they may be easily be identified when unmounted. Eliminating the primary-logical volume distinction allows for simpler, more flexible partitioning. Finally, GPT is a bit more reliable, in that it writes the partition table to the drive redundantly, making your system easier to recover should that precious sector happen to be the one to go bad first.This is the scheme we want for today and the next few years.

GPT is still not as broadly compatible as MBR setups, especially when it comes to aging hardware and OS's. It needs 3 GPT-aware components to make it work:

  • Bootloader
  • All installed OS's (Most recent Linux distros have this feature)
  • Partitioning Tools (GParted and parted win again)

GRUB2 vs. GRUB1 (Legacy)

GRUB2 is a more efficient, more capable version of its predecessor. Still, there is no shortage of complaining, whining, and cry for help on any number of forums about the progressive changeover thereto. The structure is different and it is not backwards compatible with its predecessor, meaning that all distros you use with a GRUB2 system must use GRUB2 instead of GRUB Legacy. Simply put, the new version is better, but it involves adaptation of the user, and the OS or combination thereof that you may wish to use with it may not yet be compatible as is. Unlike GRUB Legacy, GRUB2 supports GPT disks. Sabayon, Ubuntu and its derivatives, and several others have made the jump, so GRUB2 is the way to go.

Make sure all your OS's are compatible with both GPT and GRUB2 before proceeding.

B. Partitioning:

The steps contained in this section will erase all the contents of your entire hard drive.

1. Make sure your optical drive is set as the first boot device in your BIOS. Place the GParted Live disk in the tray and reboot.
Choose your graphics configuration, keymap and language preference accordingly.

2. Choose 'Create Partition Table' from the Device menu in GParted.
Click the arrow to expand the Advanced options. Select 'gpt' and click 'Apply.'
When this finishes, you will have blank hard drive ready for new partitions.

3. Select the empty gray area representing your hard drive, then click 'New' to begin creating partitions.

4. The FIRST partition on your drive should NEEDS to be a small one for the system to store your partition table and GRUB2's 'boot.img' file. This should be a FAT32 partition of minimum size, like 32MB's. This is a slightly more transparent way of doing what MBR used to do in the first sector of your HDD all along. Yes, you must do this or your system will not work. Click 'Apply'. Right click on the partition and choose 'Manage Flags', then select "bios_grub". Close the window and right click on the partition again, this time choosing 'Label.' Enter "BOOT_GRUB."
Apply it.

5. The SECOND partition NEEDS to be your /boot partition. This is where GRUB2 will store its configuration files and links to your OS partitions. You need both this and the above BOOT_GRUB partitions for this to work. Be generous, make this a 1GB partition in ext2 format. Flag it "boot" and label it "GRUB_FILES".

6. Create a Linux swap partition, 1-2 times the size of your RAM, in linux-swap format. No label or flag is necessary on this one.

7. On to the OS partitions. I want 3 of them and I like to have plenty of space, flexibility for all sorts of things, including source-based distros, so I went with 60GB each (61440 MB). I like to put these at the end of the space, so create the 60GB allocations in ext4 and slide the box to the far right until there is zero space following it. Do this for as few or as many as you would like and label them in a manner that will assist you in figuring out which is which. I labeled the partition on which I intended to install Sabayon as.... "SABAYON".

8. Last, but not least is where I am going to put all my goodies, the /data partition. This should take up the remainder of the HDD space, be formatted to ext4, and labeled "DATA". I have found this is the best way to do it on a multi-boot system. You can store your files and key folders there, such as your Firefox and Thunderbird profiles, and symlink the dot files from within the /home folder of each distro, respectively, without getting too jumbled up.

9. Be sure to click 'Apply.' Sketch out a quick map of your partition table, to include the /sda#'s and what goes where.

It should look something like:

(Screenshot of Partition Table needed here.)

Exit GParted Live and select Reboot. When it ejects the disc, place your Sabayon DVD in the tray, close it, and hit enter.

C. Install Sabayon

Sabayon's new installer, Anaconda, is really easy and quite fast. I should know, I did this about a dozen times in a day and a half figuring this out. :oops: I really appreciate the devs work on streamlining it. It really is self-explanatory. There are only a few things to pay mind:

1. If you are multi-booting and using the /data method that I recommend above, be sure to use the same username in each distro. This will save you headaches in accessing it. Once you get Sabayon installed, you will probably have to change the ownership and permissions on the partition within Sabayon.

2. When you get to the partitioning setup, choose the option to do a Custom Layout. Make it match the relevant parts as you partitioned them with GParted and choose the appropriate mount points.

It should look something like this:

Partition Filesystem Label Mount Point
/sda1FAT32BOOT_GRUB<---Don't touch
/sda3linux-swap<---Don't touch
/sda5,6ext4OS2,OS3<---Don't touch (other distros)

3. When the installer asks you if and where you want to install the bootloader, choose to do it and leave the default setting of MBR on /sda and move forward.
This is where it will mess with you, if you look at the options, because you know that there now is no MBR on your disk and it should write it to the first partition of the HDD, which is an alternate option provided. GPT is intuitive and provides for attempts to write to the MBR and defers them to the BOOT_GRUB partition that you gave it as a present in proper fashion. Let it do its thing, it works better that way. 3 installs on that little snag, folks, trust me on this one.

4. When the installer finishes, reboot, making certain to remove the Sabayon Live Disc by pressing your drives button as soon as you see the BIOS graphic. You should soon see the GRUB menu and then your new Sabayon begin to load. As I mentioned before, you may have to change the ownership of your /data partition to your username instead of the root account to get to it easily and be able to write to it. This can be done graphically as root or in a terminal using a 'chown -R' command.

I haven't tried to install other distros yet, but I like the idea of having Sabayon be the GRUB2 host, as it runs the latest version and has GUI tools to manipulate the grub.cfg. I'll let you know how that goes when I get into it.