Skip to content Skip to main navigation Skip to footer

Linux Installation Notes: CentOS

This article is to provide information for BootIt BM users who are installing the CentOS  distribution of Linux.

Latest version tested:  CentOS 7.0 (June 2014 release)

Overall summary: CentOS is a free, enterprise-class distribution of Linux that is largely the same as Red Hat Enterprise Linux (RHEL). The installation media uses a graphical installer, which provides a flexible array of partitioning options, including using existing partitions.

Starting with version 7.0, CentOS is now using the Grub2 boot loader, rather than Grub Legacy. In addition, a new graphical installer has been introduced with significant changes from previous CentOS versions. The new installer is essentially the same as the installer currently used by the Fedora distribution. The primary differences from the previous CentOS installer are that the partitioning screens have changed substantially, and there is no longer an option to install the Grub boot loader to a partition, which is required for it to boot from BootIt BM. The Grub2 choices with the new installer are to install it to the MBR (default), or to not install it at all.

The choice to not install Grub2 at all will result in CentOS not being bootable from BootIt BM after the install (and not bootable under any circumstances, without manual repair steps). The default choice of installing Grub2 to the MBR will result in CentOS being bootable via the MBR, but BootIt BM will be completely overwritten in the process, requiring that it be reinstalled afterwards. In addition, when BootIt BM is overwritten with primaries not limited, this can cause the loss of some primary partitions on HD0.

Since the CentOS installer will not install Grub2 to a partition, the recommended install procedure in this article works around that issue by using the following approach:

  • Before the install, back up the first track of Drive 0 to a UFD with 'dd' from the live CentOS desktop
  • During the install, allow the CentOS installer to install Grub2 to the MBR (the default action)
  • After the install, boot up to CentOS and manually install Grub2 to a partition with 'grub2-install'
  • After the install, restore the first track of Drive 0 from the UFD with 'dd' from CentOS
Warning: Working with partitions and boot loaders while installing any operating system can lead to data loss if mistakes are made. It is therefore highly recommended that all data be backed up before starting an installation.

Additional warning:  There is a significant chance of data loss if you allow the CentOS installer to make any structural partitioning changes while following the recommended steps listed below. This includes creating, deleting, moving, or resizing any partition, or using any of the installer's automatic partitioning modes.  As recommended in the installation procedure below, the safest choice is to create the partitions you need ahead of time in BootIt BM, and then simply choose them during the installation.

Recommended CentOS 7.0 installation steps for BootIt BM users: 

1. This procedure can be best followed by using a "live" version of the CentOS installation media, which means either the GnomeLive or KDELive ISO file. Those ISO files are available from one of the several mirror sites listed when clicking on the CentOS 7 x86_64 link at this web page: http://wiki.centos.org/Download

A live version is used so that a terminal window can be opened to back up the first track of Drive 0 (HD0) to a UFD before starting the actual installation (see steps 12-14). In addition, it is important to be able to use the 'Disks' utility on the live desktop to identify the Linux drive seen as drive 0 (HD0) by BootItBM (see step 10). The GnomeLive and KDELive versions of the installation media were both used to test this procedure. The steps that are different because of using GnomeLive vs KDELive have 'a' and 'b' parts, and are further denoted by inserting a [GnomeLive] or [KDELive] after the step number. These differences affect steps 8, 11, 12, and 15.

If you do prefer to use a non-live version of the installation media (such as the full DVD), that can be done by first using one of the live versions for steps 1 through 15. That takes you through the preliminary steps where the live version is required. Then, use the non-live version to do the actual installation starting at step 16.

2. Important: Before the CentOS install, create a BootIt BM USB flash drive (UFD) with the included Makedisk utility, even if you don't normally use a UFD to install BootIt BM. The reason for this is to provide a known, convenient external drive to use in the procedure below to save/restore the first track backup file to/from (see steps 12-14 and 41-43). Safely remove the UFD for now, until it is called for in the later steps.

3. Important: Before the CentOS install, install BootIt BM first (if not already installed). With BootIt BM installed, make a note of which hard drive BootIt BM sees as Drive 0 (HD0) in Partition Work. Drive 0 will be the drive first displayed when you open Partition Work, and will be identified by number and size in the Drives drop down list in the upper left. In later steps, you will need to identify Drive 0 by size and/or the partitions it contains, in order to determine which drive it is in Linux. Please note that Drive 0 in BootIt BM will usually be /dev/sda in Linux, but there can be exceptions.

4. Important: Before the CentOS install, create the partitions for CentOS with BootIt BM. CentOS requires a root partition and a swap partition at a minimum. All Linux partitions except the swap partition should be created as Linux Native (type 131/83h). The swap partition should be created as Linux Swap (type 130/82h). Do not be concerned with formatting the partitions at this time. This will be done by the CentOS installer during the installation.

4a. Important: Before the CentOS install, highlight the first partition on Drive 0 in Partition Work, and then click Properties. In Properties, note the Start value in the LBA Information box. This value will usually be either 63 or 2048. If it's 63 (or lower), you will need to include this partition in your CentOS boot menu item in step 5 below, otherwise the beginning of the partition will be overwritten by the CentOS installer when it installs the Grub2 boot loader. Including the first partition in the CentOS boot item will make the installer aware that the partition exists, and it will then not overwrite it. Note that this issue can be avoided by using 1MiB alignment (partitions aligned on 1MiB boundaries) when partitioning the drive. In the BootIt BM Settings dialog, 1MiB alignment can be enabled by checking the "Align on 1MiB Boundaries" option in the Global Geometry and Alignment section.

5. Important: Before the CentOS install, create a boot menu item for CentOS in the Boot Edit dialog in BootIt BM. As explained in step 4a, if the first partition on the drive starts at LBA 63 (or lower), it must be included in the boot item, even if it's not a CentOS partition. Be sure to specify the partition to boot from. This will be the /boot partition if you have one, otherwise it will be the root partition. This will be the partition to install Grub2 to in a later step. Also be sure that all partitions created for CentOS are included in the MBR Details section of Boot Edit.

6. Important: Before the CentOS install, attempt to boot from the CentOS boot menu item created in step 5. This boot attempt will fail, but it will set up the partitions correctly in the MBR partition table so that the CentOS installer will see them as you specified in the Boot Edit dialog.

7. Important:  After step 6, reboot the system from the CentOS installation media, without booting from any other boot items in between. When booting from the CentOS installation media, choose the default "Start CentOS 7 Linux Live" item at the first screen.

8a. [GnomeLive Only]: At the Welcome screen, work through the language settings, choose "Next" on the Online Accounts screen, and then choose "Start using CentOS Live" at the Thank You screen. Close the automatically opened Help screen to access the CentOS Live Desktop.

8b. [KDELive Only]: On the live desktop, select Applications - System - Terminal. In the terminal window, type 'su' and press <Enter> to become root. In the terminal window, type 'yum install gnome-disk-utility' and press <Enter> to install the Disks utility. Type 'y' and press <Enter> for each "Is this OK" prompt. From there, the installation of the Disks utility should complete. The terminal window can be left open if desired, since it will be needed again in step 11b.

9. On the live desktop, select Applications - Utilities - Disks to open the Disks utility. The Disks utility will show the hard drives on the system, as well as the partitions on each one. Visible partitions on each disk will be as configured in Boot Edit in step 5.

10. Important: In the Disks utility, click on each Hard Disk in the Disk Drives section on the left. As each drive is highlighted, it's size, Linux drive designation, and partition information will be displayed on the right. Use this information to identify which drive was the one seen as Drive 0 in BootIt BM in step 3 above. This will usually be /dev/sda, but there can be exceptions. The Linux drive designation for Drive 0 will be needed in step 13 below, and again in step 42.

11a. [GnomeLive Only]: On the live desktop, open a terminal window by selecting  Applications - Favorites - Terminal. In the terminal window, type 'su' and then press <Enter> to become root.

11b. [KDELive Only]: On the live desktop, open a terminal window by selecting  Applications - System - Terminal. In the terminal window, type 'su' and then press <Enter> to become root.

12a. Important [GnomeLive Only]: Insert the BootIt BM UFD created in step 2. Once inserted, it will be mounted automatically. Type the command 'df' in the terminal window to display the UFD device and mount path information. For the BootIt BM UFD, the mount path will be "/run/media/liveuser/BOOTITBM". The mount path will be used in the next step.

12b Important [KDELive Only]: Insert the BootIt BM UFD created in step 2. Once inserted, an Available Devices window should pop up in the lower right corner. Under the BOOTITBM device, select "Open with File Manager" to mount the UFD. Type the command 'df' in the terminal window to display the UFD device and mount path information. For the BootIt BM UFD, the mount path will be "/run/media/liveuser/BOOTITBM". The mount path will be used in the next step.

Additional Note for step 12b: If you miss the pop up window, click on the "Most recent device" icon in the taskbar at bottom right. Then click on the BOOTITBM device and select "Open with File Manager" to mount the UFD.

13. Important: Back up the first 63 sectors of BootItBM Drive 0 to the BootIt BM UFD. To do that, carefully type in and execute the 'dd' command shown below in the terminal window. Be sure to replace 'sdX' with the Linux drive designation, as determined to be Drive 0 in step 10 above (e.g. sda, sdb, etc.):

     dd  if=/dev/sdX of=/run/media/liveuser/BOOTITBM/drive0.bin count=63

     (replace 'sdX' above with the Linux drive determined to be Drive 0 in step 10)

An example of the 'dd' command line, and the resulting output that you can expect to see are shown below.:

[root@localhost liveuser]# dd if=/dev/sda of=/run/media/liveuser/BOOTITBM/drive0.bin count=63
63+0 records in
63+0 records out
32256 bytes (32 kB) copied, 0.00200314 s, 16.1 MB/s

After executing the 'dd' command above, check carefully that there are no error messages. If any errors are shown, check for typos, and recheck the mount path determined in step 10. Once the 'dd' command completes without error, verify that the file drive0.bin exists on the UFD, and that it is the correct size. To do that,  run the following command in the terminal window:

     ls  -l  /run/media/liveuser/BOOTITBM/drive0.bin

The file drive0.bin should be listed, and should be 32,256 bytes in size. This file will be used to restore BootIt BM to the first track after the CentOS installation has completed (steps 41-43).

14. Unmount the Bootit BM UFD by running the following command in the terminal window:

     umount  /run/media/liveuser/BOOTITBM

Verify that it has been unmounted by running 'df' again. The line showing the UFD and its mount path should now be gone. The UFD can be safely removed after being unmounted. Note that you can also use the Eject item on the screen, if available, to unmount/eject the UFD.

15a. [GnomeLive Only]: On the live desktop, double click "Install to Hard Drive" to start the CentOS installation. Proceed through the subsequent screens until you get to the Installation Summary screen.

15b. [KDELive Only]: On the live desktop, select Favorites - Install (or Applications - System - Install) to start the CentOS installation. Proceed through the subsequent screens until you get to the Installation Summary screen.

16. On the Installation Summary screen, select "Installation Destination", which will take you to the Installation Destination screen.

17. Important: The Installation Destination screen should show an icon for each hard drive. The first drive should be /dev/sda, the second drive /dev/sdb, etc.  For BootIt BM Drive 0, and for any other drive(s) containing partitions to be included in the CentOS installation, ensure that a check mark exists just below the hard drive icon. If not, click on the drive to get the check mark to appear. Note that clicking on a drive will toggle the check mark on/off for that drive. To clarify: when finished with this step, BootIt BM Drive 0 (as determined in step 10) should be checked, and each additional drive containing partitions to be included in the CentOS installation should also be checked.

18. On the Installation Destination screen, click on "Full disk summary and bootloader" (lower left) to open the Selected Disks dialog. The Selected Disks dialog will list all drives checked in step 17.

19. Important: In the Selected Disks dialog, ensure that BootIt BM Drive 0 (as determined in step 10) is checked as the boot drive in the Boot column. If not, highlight that drive and click on "Set as Boot Device" to set that drive as the one that Grub will be installed to. Click on Close to return to the Installation Destination screen.

20. Important: On the Installation Destination screen, select "I will configure partitioning" in the "Other Storage Options" section. 

21. On the Installation Destination screen click on Done (upper left). This should take you to the Manual Partitioning screen.

22. Important: On the Manual Partitioning screen, select "Standard Partition" from the drop down list on the left.

23. On the Manual Partitioning screen, expand the "Uknown" section of partitions on the left, if not already expanded. In the "Unknown" section, you should see the root and swap partitions (and other CentOS partitions as applicable) that you created in step 4. If you do not see all of the CentOS partitions created in step 4, then you will need to go back and ensure that you followed steps 4 through 7 correctly.

Note: To clarify step 23, the above information is assuming a completely new installation. If one of the drives already contains an existing CentOS installation whose partitions are visible to the CentOS installer (i.e. are loaded in the MBR), there will be another expandable section on the left named "CentOS Linux XX for X86_64" or similar. If you intend to install over the top of the existing installation, then you will need to select your partitions from that section in the steps below, rather than from the "Unknown" section.

24. In the "Uknown" section of partitions, identify and highlight your CentOS root partition. On the right side of the screen, check the Reformat check box.

25. In the File System drop down list, select the file system for the root partition. The ext4 file system is recommended. In the Mount Point box, enter a "/" for root partition. If you want to use a label for the root partition, enter that in the Label box.

26. When satisfied with your selections for the root partition, select Update Settings. That will move the root partition from the "Unknown" section to the "New CentOS Linux 7.0.XXXX Installation" section on the left.

27. Re-expand the "Unknown" section on the left, and then identify and highlight your CentOS swap partition. On the right side of the screen, check the Reformat check box.

28. In the File System drop down list, select "swap" for the file system. If you want to use a label for the swap partition, you can enter that in the Label box.

29. When satisfied with your selections for the swap partition, select Update Settings. That will move the swap partition from the "Unknown" section to the "New CentOS Linux 7.0.XXXX Installation" section on the left.

30. If you are using any additional partitions, such as for /boot or /home, repeat the steps above (i.e. steps 24 through 26) to configure those partitions. Be sure to choose the correct mount points ; i.e. choose /home as the mount point for the /home partition, and /boot as the mount point for the /boot partition. Each additional partition that you configure should end up being listed in the "New CentOS Linux 7.0.XXXX Installation" section on the left of the screen.

31. When finished configuring partitions, carefully review all information on the Manual Partitioning screen. When satisfied with the partition configuration, click on the Done button at the top left of the screen. That will open the Summary of Changes dialog.

32. Carefully review all of the information in the Summary of Changes dialog. If satisfied that all is correct, select Accept Changes to return to the Installation Summary screen. Otherwise, you can select Cancel & Return to return to the Custom Partitioning screen to make changes.

33. If all looks correct on the Installation Summary screen, then select Begin Installation at the bottom right of the screen. That will start the actual installation to the hard drive. You will be prompted to set the root password and create a user while the installation is proceeding. Creating a user at this point is optional, but if creating one, it is suggested that you check the "Make this user administrator" check box. This will enable 'sudo' for that user. If you do not create a user now, you will be prompted to create one on the first boot into CentOS.

34. When installation completes, select Quit at the bottom right. That takes you back to the CentOS Live Desktop. At this point, the Grub2 boot loader has been installed to the MBR, meaning that BootItBM will not appear when you reboot the system. Instead, the system will boot up to the Grub2 menu, from where you can boot into CentOS.

35. Reboot the system up into the new CentOS installation. If the system starts booting from the CentOS installation media again, you will have an opportunity to remove the installation media at the Start CentOS Linux Live screen, and then reboot the system again to boot into the new CentOS installation. On the first boot, you will prompted to create a user (if not already done in step 33), and some other items. If creating a user, it is suggested that you  check the "Make this user administrator" check box. This will enable 'sudo' for that user.

36a. Important [Gnome Desktop Only]: Once logged into the CentOS desktop, the next step is to manually install Grub2 to the root partition, or to the /boot partition if you have one. To do that, open a terminal window by selecting Applications - Favorites - Terminal. In the terminal window, type "su" and then press <Enter> to become root. Enter the root password when prompted to get root privileges.

36b. Important [KDE Desktop Only]: Once logged into the CentOS desktop, the next step is to manually install Grub2 to the root partition, or to the /boot partition if you have one. To do that, open a terminal window by selecting Applications - System - Terminal. In the terminal window, type "su" and then press <Enter> to become root. Enter the root password when prompted to get root privileges.

37. Important: At the prompt, run the 'df' command to list mounted file systems. The list of mounted file systems should include the root partition (/), and the /boot partition (/boot) if you have one. If you don't have a /boot partition, make a note of the partition designation for the root partition, and then continue with step 38. If you do have a /boot partition, then make a note of the partition designation for /boot, and then continue with step 39 instead. Note that the boot loader needs to be installed to same partition that you set up as the partition to boot from in step 5.

38. Important: At the prompt, type the following command to install Grub2 to the root partition. Note that the root partition designation "/dev/sda1" used below is just an example. You will need to know and use your actual root partition designation, as determined in step 37 above.

     grub2-install  --force  /dev/sda1

    (/dev/sda1 above is an example - replace with actual root partition from step 37)

There will be a warning about using blocklists, but as long as you get the message "Installation finished. No error reported" on the last line of the output, that means Grub2 was successfully installed to the partition's boot sector. Skip to step 40 to continue this procedure.

39. Important: At the prompt, type the following command to install Grub2 to the /boot partition. Note that the /boot partition designation "/dev/sda1" used below is just an example. You will need to know and use your actual /boot partition designation, as determined in step 37 above.

     grub2-install  --force  /dev/sda1

     (/dev/sda1 above is an example - replace with actual /boot partition from step 37)

There will be a warning about using blocklists, but as long as you get the message "Installation finished. No error reported" on the last line of the output, that means Grub2 was successfully installed to the partition's boot sector.

40. Important: With the terminal window still open, run the 'grub2-mkconfig' command as shown below to update the grub2 configuration file located at /boot/grub2/grub.cfg.

     grub2-mkconfig  -o  /boot/grub2/grub.cfg

An example of the typical output of this command is shown below for reference:

[root@localhost user]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.10-301.fc20.x86_64
Found initrd image: /boot/initramfs-3.11.10-301.fc20.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-4e3706d5223a489b8a6dca270df4cc73
Found initrd image: /boot/initramfs-0-rescue-4e3706d5223a489b8a6dca270df4cc73.img
done

41a. Important [Gnome Desktop Only]: With the terminal window still open, insert the BootIt BM UFD that you used in steps 12-14. Once inserted, it will be mounted automatically. Type 'df' in the terminal window to display the UFD device and mount path information. For the BootIt BM UFD, the mount path should be "/run/media/<user>/BOOTITBM" where <user> is the user name that you are logged in as. The mount path will be used in the next step.

41b. Important [KDE Desktop Only]: With the terminal window still open, insert the BootIt BM UFD that you used in steps 12-14. Once inserted, an Available Devices window should pop up in the lower right corner. Under the BOOTITBM device, select "Open with File Manager" to mount the UFD. Type the command 'df' in the terminal window to display the UFD device and mount path information. For the BootIt BM UFD, the mount path should be "/run/media/<user>/BOOTITBM" where <user> is the user name that you are logged in as. The mount path will be used in the next step.

Additional Note for step 41b: If you miss the pop up window, click on the "Most recent device" icon in the taskbar at bottom right. Then click on the BOOTITBM device and select "Open with File Manager" to mount the UFD.

42. Important: Restore the first 63 sectors of BootIt BM Drive 0 from the file drive0.bin that was saved to the BootIt BM UFD in step 13. To do that, carefully type in and execute the 'dd' command shown below in the terminal window. Be sure to replace 'sdX' with the Linux drive designation for Drive 0 as determined in step 10 above (e.g. sda, sdb, etc.).

     dd  if=/run/media/<user>/BOOTITBM/drive0.bin of=/dev/sdX count=63

     (replace 'sdX' above with the Linux drive determined to be Drive 0 in step 10)

An example of the 'dd' command line, and the resulting output that you can expect to see are shown below.:

[root@localhost user]# dd if=/run/media/user/BOOTITBM/drive0.bin of=/dev/sda count=63
63+0 records in
63+0 records out
32256 bytes (32 kB) copied, 0.00566892 s, 5.7 MB/s

After executing the 'dd' command above, check carefully that there are no error messages. If any errors are shown, check for typos, and recheck the UFD mount path as determined in step 41. Then run the 'dd' command again, until it completes without any error messages.

43. Unmount the Bootit BM UFD by running the following command in the terminal window:

     umount  /run/media/<user>/BOOTITBM

Verify that it has been unmounted by running 'df' again. The line showing the UFD and its mount path should now be gone. The UFD can be safely removed after being unmounted. Note that you can also use the Eject item on the screen, if available, to unmount/eject the UFD.

44. On the next reboot, BootIt BM should be back, and you should be able to boot normally into CentOS using the boot item created in step 5.

45. If CentOS does not boot from the BootIt BM menu as expected, recheck that the boot item is correctly configured in Boot Edit. Another important item to check is whether or not the partition that you installed Grub2 to in step 38 (root partition), or step 39 (/boot partition) is considered to be bootable by BootIt BM. To determine this, go to Partition Work, highlight the partition, and select Properties. It should say "Bootable: Yes" in the Additional Information section. If not, the Grub2 boot loader did not get installed in step 38 or 39, or may have gotten installed to the wrong partition. This should be correctable by reinstalling Grub2 to the correct partition - see Item 1 under Additional Information below.

Additional Information:

1. If CentOS does not boot from the BootIt BM menu in step 44 above, you most likely can correct that situation by reinstalling Grub2 to the correct partition. Because BootIt BM has now overwritten Grub2 in the MBR, you will need to follow the procedure in the KB article linked to below, which covers how to get booted into CentOS manually from a Grub2 boot disk, so that you can then reinstall Grub2 with the 'grub2-install' command.

Grub Article #4 - How to reinstall Grub2

2. There is a significant chance of data loss if you are not limiting primaries in BootIt BM and you allow the CentOS installer to make any partitioning changes, or to use any of its automatic partitioning methods. The reason for this is that with primaries not limited, the CentOS installer can overwrite partitions that it is not aware of because they are not present in the MBR during the installation. As recommended above, the safest choice is to create the partitions you need ahead of time in BootIt BM, and then assign them during installation.

 

Was This Article Helpful?

0