Install Sabayon with GRUB2 and GPT on a New System

Installer Issues via Installer -- Not for global upgrades or upgrading individual packages -- ONLY ISSUES WITH INSTALLATION OF THE OS -- Can't get Sabayon installed, than post here, otherwise use correct forums

Moderator: Moderators

Install Sabayon with GRUB2 and GPT on a New System

Postby epidenimus » Fri Jun 18, 2010 1:35

I built my first new system from scratch and completed it last week, decided on Sabayon to be my primary desktop distro. The hardware was rather easy to get together. The partitioning and boot structure was a little more challenging, so I thought I would share what I learned in the hopes of saving someone the hours and numerous install attempts that I went through to get it right. I do not claim to be an expert and everything that I may know, I learned on the internet. I welcome feedback and guidance.

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.

What I want:
+ A flexible, extensible, forward compatible 64-bit Linux-driven system
+ Sabayon will be the primary OS, with partitions allocated 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

What I had to work with:
  • A newly built system with modern components
    • Hex-core AMD CPU
    • AM3 Socket MoBo with new BIOS that recognizes all hardware
    • 4GB DDR3 RAM
    • 1TB HDD
    • Samsung DVD/CD optical drive
  • Sabayon 5.3 x86-64 KDE DVD
  • Most recent GParted Live Disk
  • Most recent Super Grub Disk (just in case)
  • Printout of guides or 2nd computer to figure things out

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.

B. Partitioning:

1. Make sure your optical drive is set as the first boot device in your BIOS. Put the GParted Live disc in the tray and reboot. Click 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.' **This will erase everything on your hard drive.** When this finishes, you will have blank harddrive ready for new partitions.

3. Select the empty gray area, 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". Apply.

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: (see attachment for spiffy colors)

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:

PartitionFilesystemLabelMount 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 now 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.

Last edited by epidenimus on Fri Jun 18, 2010 13:36, edited 1 time in total.
Baby Hen
Posts: 7
Joined: Sat Jun 12, 2010 23:41

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

Postby Fitzcarraldo » Fri Jun 18, 2010 9:19

Nice explanation. Thanks. I suggest you add it to the SL Wiki (see the post How to create a new article in the Sabayon Linux Wiki).

BTW, according to the GNU GRUB Web site the official name for Grub1 is "GRUB Legacy" rather than "GRUB Classic".
User avatar
Sagely Hen
Posts: 7992
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

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

Postby epidenimus » Fri Jun 18, 2010 20:25

Done and done. Thanks for the tips. I'll tweak it a bit more later, but here is the link to the new Wiki HOWTO.
Baby Hen
Posts: 7
Joined: Sat Jun 12, 2010 23:41

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

Postby koko » Sat Jun 19, 2010 9:17

Very interesting your New System! I have up to 3 OS on my Computer and plan to follow your way. I am used to have a home *partition* for every OS, obviously you have a home *directory* in each OS instead. Can you explain in more detail and perhaps with short examples how you distribute/share the usual contents between 3 home directories and the data partition (subdirectories, files, profiles, dotfiles and symlinks according to your last phrase in paragraph B8)?
I would like to emphasize a 5th point under "What I want": How to restore a whole OS after a disaster. I had used a Gentoo system for 2 years and spent a lot of time to keep it up-to-date, when a hard disk crash happened. I had used DIRVISH for saving, but could not restore the whole system and then dropped Gentoo. DIRVISH is excellent for storing a home directory *incrementally*, but not for a whole OS. For this duty i use CLONEZILLA, but this program can only save and restore whole disks and partitions. Incremental savings are not possible and you cannot restore single files as DIRVISH can. How do you consider the subject of saving and restoring an OS or parts of it in your approach?
Small last question: Which *AM3* socket MoBo do you use? Obviously it works well with Sabayon.
I would like to remain in contact with you.
Cheers Konrad
Baby Hen
Posts: 1
Joined: Sat Jun 19, 2010 8:02

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

Postby epidenimus » Mon Jun 21, 2010 17:44

Can you explain in more detail and perhaps with short examples how you distribute/share the usual contents between 3 home directories and the data partition (subdirectories, files, profiles, dotfiles and symlinks according to your last phrase in paragraph B8)?

As you know, each Linux OS has a /home folder where users are typically isolated. It contains custom configuration settings for the desktop environment as well as settings and preferences per application. Since this is where the user lives, many distros also make it the default for where your music, pics, videos, downloads and other files are stored. Many distros provide tools to backup this folder and some suggest that you create a separate partition for your /home directory. Great way to do things if you only run one distro! This is how I do it with Mint on my laptop.

When you run multiple distros or get into hopping, you will probably want to share a few things between them, but not everything found in the home folder. For example, in addition to my music, I want to have my Firefox and Pidgin profiles be the same on all my desktops, but I may not want my .gnome settings from my KDE-based Sabayon dictating how other GNOME or XFCE distros are configured.

Enter the Data partition.

The partitioning method above details how to allocate a partition called Data. When you install each distro or on first bootup, you need to configure the partition to be mounted at mountpoint /data. Then within the first distro, say Sabayon here, you need to change the ownership from root to the primary user. Upon reboot you should find a /data folder in your root directory, already mounted, where you have read-write permissions.

Now you get to begin setting up the structure you want.

I begin by creating the folders on Data entitled: Music, Music Projects, Videos, Video Projects, Documents, Wallpapers, Downloads and so forth. I like things to be graphically pleasing so I then right click on each and change the icon to the appropriate one for the folder contents; KDE and GNOME both provide these.

Then go to your home folder and create the links.
In Sabayon, right click and choose Create New... ---> 'Basic link to file or directory'.
Enter the path to each folder (e.g. /data/Documents) and label them by the same name.
These links aren't really necessary since you can just access Data directly, but they do make life much easier when so many applications default to the /home/username folder with save, open, import/export dialogs.

Working with the hidden configurations, or dot files is just as easy.
For example:
With FIrefox, open the application and set up the profile correctly in the first distribution. Open and play with Firefox, set up your desired extensions, bookmarks, search engines, etc.
When you are mildly content, open your home folder and hit either Alt-. or Ctrl-H to see your dot files.
Find your .mozilla file and move it to Data.
Go back to your home folder and create a new basic link to the file you just moved to Data and be sure to title the link as .mozilla as well. Now Firefox will open the profile stored on your Data partition by using the link.
In your other distros, just update firefox to the same version, open it once, delete the .mozilla folder in the home partition and link it to the one on Data in the same manner.

Suggested configurations to share:
.mozilla(Firefox), Thunderbird, .purple (Pidgin)

There are others you might choose to share, especially between distros with similar families (e.g. Ubuntu and its derivatives) and Desktop Environments. The great thing about this setup as opposed to a single shared home folder is that you can opt to use the shared configs or stick with a distro's internal version as you choose. Maybe one day I'll get around to writing a script with check boxes to automate this.

The only issue that I have run into with this is with arrangement was one time with fonts in a custom theme. My wicked cool Thunderbird theme, calls for proprietary fonts and leaves only one fallback of Sans Serif. Works fine with most, but Sabayon has the name of that font stored with a filename different by one character, thus the fonts defaulted to something hideous. Duplicate the font and save it with the other naming, edit the CSS of the theme to include both, or install the proprietary fonts it wants. Too easy.

How do you consider the subject of saving and restoring an OS or parts of it in your approach?

Regarding backups and restoration:

1. Use quality hardware, even if you have to install it yourself. If you build your own, this is easy to control, but if you are buying an OEM system, you should know that the one place they almost always skimp is the HDD.

Here's a tip: When you buy a new desktop or laptop, consider the HDD like a stock radio that you will be ripping out to to put in a good stereo. Go for the cheapest option in terms of storage and speed. After you fire it up and confirm that the basics work, remove the HDD and shelf it and the Windoze that is likely on it, then pop a WD Black in there and do as you please. If you go to resell the machine, you have only an easy switch out to perform.

2. If you are really concerned about restoring your entire system, as any source-based distro user would be, consider running a RAID configuration. That solves both your entire OS and your incremental backup problems.

3. One of the things that I love about Sabayon and its present direction is that it is now virtually a rolling release with a binary base--and they release compressed, fully functional images regularly. So if the HDD that your root partition was on goes out, change the part out and install the latest Sabayon in 10 minutes, run updates overnight, install any apps that are missing in a few minutes. You should have very little to compile.

4. The only partition I really worry about losing is my Data. For that, I backup the entire partition routinely. Clonezilla is great initially and that is what I have been using. I acknowledge that this is not the most efficient method and am also open to something else.

Small last question: Which *AM3* socket MoBo do you use? Obviously it works well with Sabayon.

I went with an MSI NF750-G55.
I really did my research on this and found that MSI builds quality products that are both intuitive and tweakable, and they don't deny the existence of Linux or its users. I was able to easily update the BIOS without having to install WIndoze or create DOS boot disks. Somewhat extensible, efficient, AM3 and DDR3 support all for 100USD. I really want something with more SATA ports and USB3, but USB3 is expensive and without many devices right now, so I will upgrade when it's a little more reasonable. The only thing that I have found it lacking (in Sabayon, anyway) is support for suspend to RAM.

I hope this helps.
Baby Hen
Posts: 7
Joined: Sat Jun 12, 2010 23:41

Return to Installer Issues - Calamares **Not for Package Manager Stuff**

Who is online

Users browsing this forum: No registered users and 1 guest