View RSS Feed

James' openSUSE Bash Scripting (and other things) Blog - Your Comments are Welcome!

Creating Partitions During Install for MBR and GPT Hard Disks

Rating: 2 votes, 5.00 average.
Here is some basic information and advice about creating partitions when you install openSUSE:

Master Boot Record Partitioned Hard Disks:

openSUSE does not want to remove anything from your system when you first try to install it and if you want the whole thing to be openSUSE, you might consider downloading the KDE LiveCD or GNOME LiveCD from here:software.opensuse.org: Download openSUSE 12.2, boot from the LiveCD and make sure it works as you wish. Then, you can start the YaST / System / Partitioner and remove all existing partitions on your hard drive. Then, when you decide to install openSUSE, just take the defaults and let it rip. As for SWAP, 2-4 GB is enough, depending on the amount of memory your system has and if big enough, just let it be 4 GB and carry own. If your memory is low, the default may be small as well, but is is OK to use the default. For more info on setting up a SWAP partition, have a look at my blog on the subject here: https://forums.opensuse.org/blogs/jd...-opensuse-114/

By default, during the installation of openSUSE, if it find's any partitions it thinks belongs to another Operating System, it will create a menu option to load that OS when the installation of openSUSE is complete. That is, of course, for any remaining partitions that you do not remove during the installation. If you have a copy of Windows installed for instance, you should end up with a working dual boot installation when the openSUSE installation is complete. Having another OS on your hard disk(s) does present a problem for your installation in that there must be somewhere on your hard drive, for openSUSE to be installed on. Since we already said that generally, openSUSE does not want to remove any existing partitions, though it may try to shrink the size of an existing one, like for Windows, just exactly where did you think openSUSE would install on your PC? In a simple setup, with only Windows, which has a partition that can be shrunk automatically, you may be just fine. However, you would be best served before you install openSUSE, to consider creating a blank place for the installation of openSUSE. How much free space you need depends on what you are going to use openSUSE for, but try to reserve or free up at least 80 Gigabytes if you can.

Each hard drive can have up to four PRIMARY partitions, any of which could be marked active and bootable. No matter what you might hear, only one of the first four primary partitions can be booted from. That means you can boot from Primary partitions 1, 2, 3 or 4 and that is all. In order to boot openSUSE, you must load openSUSE and the grub boot loader into one of the first four partitions. Or, your second choice is to load the grub boot loader into the MBR (Master Boot Record) at the start of the disk. The MBR can be blank, like a new disk, it can contain a Windows partition booting code or generic booting code to boot the active partition 1, 2, 3, or 4. Or, as stated before, it can contain the grub boot loader. Why load grub into the MBR then? You do this so that you can "boot" openSUSE from a logical partition, numbered 5 or higher, which is not normally possible. In order to have more than four partitions, one of them (and only one can be assigned as extended) must be a extended partition. It is called an Extended Primary Partition, a container partition, it can be any one of the first four and it can contain one or more logical partitions within. Anytime you see partition numbers 5, 6 or higher for instance, they can only occur inside of the one and only Extended Primary partition you could have.

What does openSUSE want as far as partitions? It needs at minimum a SWAP partition and a root "/" partition where all of your software is loaded. Further, it is recommended you create a separate /home partition, which makes it easier to upgrade or reload openSUSE without losing all of your settings. So, that is three more partitions you must add to what you have now. What must you do to load and boot openSUSE from an external hard drive? Number one, you must be able to select your external hard drive as the boot drive in your BIOS setup. Number two, you need to make sure that the external hard drive, perhaps /dev/sdb, is listed as the first hard drive in your grub device.map file and listed as drive hd0 (The Device Map file is for Grub Legacy Only and does not apply to Grub 2). If you are dual booting with Windows on a single hard disk, I always suggest that you do not load grub into the MBR, but rather into the openSUSE "/" root primary partition which means a primary numbers of 1, 2, 3 or 4. If you are loading openSUSE only (no Windows) or you are loading openSUSE on a second hard drive separate from Windows, I suggest you do place Grub into the MBR. As to the partitions for openSUSE to use if number one or two is used, then they will be out. When Grub is loaded into the root "/" Partition, that Partition must be marked active for booting and finally you must load generic booting code into the MBR so that it will boot the openSUSE partition.

For an openSUSE hard disk without Windows, I suggest a partition setup like this:

0. /dev/sda, Load MBR with Grub
1. /dev/sda1, Primary SWAP (4 GB)
2. /dev/sda2, Primary EXT4 "/" openSUSE Partition Marked Active for booting (36-60 GB)
3. /dev/sda3, Primary EXT4 "/home" Your main home directory (Rest of the hard disk)

For an openSUSE install on a hard disk with Windows, I suggest a Partition Setup Like This:

0. /dev/sda, Load MBR with Generic Boot Code
1. /dev/sda1, Primary Windows Boot Loader (Small < 500 MB)
2. /dev/sda2, Primary Main Windows Program Partition
3. /dev/sda3, Primary EXT4 "/" openSUSE Partition Marked Active for booting (36-60 GB)
4. /dev/sda4, Primary Extended Partition (Rest of Hard Disk in Size but at least 44 GB in size)
5. /dev/sda5, Logical SWAP (4 GB)
6. /dev/sda6, Logical EXT4 "/home" Your main home directory (Rest of the Logical disk, but at least 40 GB in size)

Also see: SDB:Basics of partitions, filesystems, mount points - openSUSE
MBR Disks Info: Master boot record - Wikipedia, the free encyclopedia

The MBR disk partitions in openSUSE could be named sda1, sda2, sdb1 or sdb2 where 'a' is the first hard drive and 'b' is the second hard drive and so forth. Partition numbers 1-4 are always Primary and any of them could be an Extended Partition but only one Extended Partition is allowed. Partition numbers 5 and higher point to Logical Partitions within the Extended Partition. Deleting Partitions can cause missing Partition numbers and any added Partitions after a delete may not physically be in numerical order

-- Continued ---

Submit "Creating Partitions During Install for MBR and GPT Hard Disks" to Digg Submit "Creating Partitions During Install for MBR and GPT Hard Disks" to del.icio.us Submit "Creating Partitions During Install for MBR and GPT Hard Disks" to StumbleUpon Submit "Creating Partitions During Install for MBR and GPT Hard Disks" to Google Submit "Creating Partitions During Install for MBR and GPT Hard Disks" to Facebook Submit "Creating Partitions During Install for MBR and GPT Hard Disks" to Twitter

Comments

  1. jdmcdaniel3's Avatar
    [SIZE=3][B][COLOR=#0000ff]G[/COLOR]lobally Unique Identifier [COLOR=#0000ff]P[/COLOR]artition [COLOR=#0000ff]T[/COLOR]able (GPT) Hard Disks:[/B][/SIZE]

    For GPT Formatted disks, more information is required. By default, the lasted Linux kernel has no problem reading and writing to a GPT partitioned disk. To create your own GPT disk, install the application gptfdisk, if not already installed. Have a look here for more info: [URL="http://www.rodsbooks.com/gdisk/"]GPT fdisk Tutorial[/URL]. A GPT formatted hard disk used on a UEFI PC can exceed the 2.2 Terabyte limit of a MBR based disk and supports the new "Secure Boot" mode which can be used by Windows 8.

    1)[B] UEFI[/B] Firmware: It used to be called a PC BIOS and I may still use the term BIOS but the full name is [B][COLOR=#0000ff]U[/COLOR]nified [COLOR=#0000ff]E[/COLOR]xtensible [COLOR=#0000ff]F[/COLOR]irmware [COLOR=#0000ff]I[/COLOR]nterface[/B] (Unified Extensible Firmware Interface - Wikipedia [[URL="http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface"]Unified Extensible Firmware Interface - Wikipedia, the free encyclopedia[/URL]], the free encyclopedia) or UEFI for short. Its still the starting program in your PC that kicks starts its operation when the PC is turned on or when it gets rebooted. It is designed to keep track of your hardware and to provide a uniform interface for those resources to your operating system. The UEFI system is designed to address lots of issues including total memory and total disk space. And now, with the advent of Windows 8, it can manage the signing of a operating system boot up process, not allowing an OS to boot if it does not match a certain key loaded into the PC firmware. As for hard disks, it needs to understand GUID partition tables and EFI Partitions. A UEFI PC can often be set to work as a simple BIOS and/or certain features operate while others do not, but it is all up the manufacturer as to what you are allowed to do in UEFI PC setup. Normally, to boot from a GPT disk, you need a PC that supports UEFI. UEFI function is very much in the hands of the hardware vendor, some can be very minimal in the nvram (eg HP Probook 4525s) and some full of features (eg DELL Latitude E5510). I think that probably a business oriented system will probably have better features than your run of the mill systems for casual users.

    2) [B]GUID[/B] Partition Table (GPT): Stands for a [B][COLOR=#0000ff]G[/COLOR]lobally Unique Identifier [COLOR=#0000ff]P[/COLOR]artition [COLOR=#0000ff]T[/COLOR]able[/B] or GUID for short or perhaps called a GPT partition (GUID Partition Table - Wikipedia [[URL]http://en.wikipedia.org/wiki/GUID_Partition_Table][/URL] the free encyclopedia). It is a standard for the layout of the partition table on a physical hard disk, but is very different from how a MBR based disk partition type works. It allows for very large hard disks, over 2.2 Terabytes, with very little limit to the number or sizes of the partitions and is about as far from the old MBR partition type as you can get. The basics are that the Linux kernel understands and works with GPT disk partitions just fine, but not all openSUSE disk tools can be used at present with GPT disk partitions. It supports the new "Secure Boot" mode which can be used by Windows 8 and with Linux with some effort [[URL]http://www.linuxfoundation.org/publications/making-uefi-secure-boot-work-with-open-platforms][/URL].

    3) [B]EFI[/B] System Partition (ESP): An EFI partition is called [B][COLOR=#0000ff]E[/COLOR]xtensible [COLOR=#000000]F[/COLOR]irmware[COLOR=#000000] I[/COLOR]nterface[/B] [B][COLOR=#0000ff]S[/COLOR]ystem [COLOR=#0000ff]P[/COLOR]artition[/B] or ESP and is part of the GPT disk partition definition (EFI System partition - Wikipedia [[URL="http://en.wikipedia.org/wiki/EFI_System_partition"]EFI System partition - Wikipedia, the free encyclopedia[/URL]], the free encyclopedia) designed to work with to be read by a Unified Extensible Firmware Interface PC in order to determine what is going to be booted. You can pretty much have an ESP (aka /boot/efi/EFI ) per partition and call multiple operating systems from any one of those ESP's as long as the efi file exists and is added to the EFI shell via efibootmgr. The efibootmgr is a userspace ([URL="http://linux.die.net/man/8/efibootmgr"]efibootmgr(8): change EFI Boot Manager - Linux man page[/URL]) application used to modify the Intel Extensible Firmware Interface (EFI) Boot Manager. This application can create and destroy boot entries, change the boot order, change the next running boot option, and more.

    4) Grub2 or Grub2-efi [[URL="http://doc.opensuse.org/documentation/html/openSUSE/opensuse-reference/grub2.html%29is"]http://doc.opensuse.org/documentation/html/openSUSE/opensuse-reference/grub2.html][/URL] is the latest incarnation of the openSUSE Linux Operating System boot selector with the efi version required to boot from a UEFI enabled PC. Grub2-efi should be able to boot from anything, but the manual partitioning tools that come with openSUSE 12.2 may not allow all possible GPT Partitions with a GPT disk partition setup, to be created. To perform all tasks with GPT disks, you should install the application utility called gptfdisk from YaST.

    5) As for loading openSUSE on a secondary or even external hard disk, there are just a few things you must do.

    a) Your PC UEFI or BIOS must allow you to select and boot from the second or external hard drive.
    b) The disk partition setup must be compatible with openSUSE 12.2.
    c) You must on purpose place all three suggested/required partitions on that second or external hard disk including root /, /home & SWAP
    d) You must make sure to either install the Grub 2 boot loader into the MBR (I recommend for a MBR disk) or place generic boot code into the MBR. Consider that secondary or external hard drives may contain a blank MBR which will not boot no matter what else is on the rest of the disk.

    6) In order to install openSUSE on a GPT disk using UEFI, you must select the UEFI boot mode for your openSUSE install DVD in your EFI equipped PC setup. In order to select the openSUSE DVD to enable a new install disk boot mode called [B]ELILO[/B] ([B][COLOR=#0000ff]E[/COLOR]FI [COLOR=#0000ff]L[/COLOR]inux [COLOR=#0000ff]L[/COLOR]oader[/B]), you must enter your PC UEFI mode. If you just boot from the openSUSE DVD, you will not be in the UEF enabled mode. The fact that a UEFI mode called ELILO is included with the standard MBR disk boot mode is why the openSUSE installation disk is often called a Hybrid disk. It includes MBR & ELILO boot modes. Booting from a USB DVD drive in the UEFI mode may not work, depending on your UEFI PC capabilities.

    7) By default and in UEFI mode, openSUSE will create the proper setup to boot openSUSE from that disk, but if the intent is to dual boot from the GPT disk, you must use your UEFI enabled PC to select which ESP partition to boot from, meaning the dual boot nature of grub2 does not include (at present) any other boot partitions on the same GPT disk. Expect this to be fixed in openSUSE 12.3 and newer openSUSE versions.

    8) It is possible to wipe out a GPT formatted disk, reverting to an MBR setup. Have a look at this post on the subject. ([URL="http://www.rodsbooks.com/gdisk/wipegpt.html"]Wiping Out Old GPT Data[/URL])

    GPT Disk Layout:
    [IMG]http://paste.opensuse.org/view/download/45534924[/IMG]
    The GPT disk partitions in openSUSE could be named sda1, sda2, sdb1 or sdb2 where 'a' is the first hard drive and 'b' is the second hard drive and so forth. Partition numbers 1-128 are always Primary, as No Extended or Logical Partitions Exist. Deleting Partitions can cause missing Partition numbers and any added Partitions after a delete may not physically be in numerical order.

    If you have any questions or problems with this content, or if a link does not work for you, please leave me a comment on the issue TODAY!

    To help provide information on your disk boot setup, you can open up a terminal session and type in (copy from here and paste into terminal) the following command:

    [CODE]rm ~/bin/bis ; wget -nc https://raw.github.com/arvidjaar/bootinfoscript/master/bootinfoscript -O ~/bin/bis ; chmod +x ~/bin/bis ; sudo bis[/CODE]

    If your disk will not boot, then boot from an openSUSE LiveCD, open up a terminal session and run the above command. Then, while still running the LiveCD, go online and post the results of the bash script into a code # block using the advanced message text editor. You can find openSUSE LiveCD's at the following download link.

    [URL="http://software.opensuse.org"]software.opensuse.org: Download openSUSE 12.2[/URL]

    Thank You,
  2. jdmcdaniel3's Avatar
    [SIZE=3][COLOR=#000000][B]UEFI and Secure Boot status [/B]
    [/COLOR][/SIZE]
    It should be possible to install openSUSE 12.3 on a UEFI machine without problems. During the installation process you can see that YaST decides to use the EFI partition (usually /dev/sda1) as a boot partition, setting the mount point to [I]/boot/efi[/I]. That means that YaST will create a directory named “opensuse” in this partition, and will add grub.efi or grubx64.efi file in it. Also, YaST will create a new entry in the firmware boot manager, named again “opensuse”. We can use this new entry to load our distribution without problems. We are working hard to get Secure Boot into the equation, and in RC2 we can fully test the process. The good news is that openSUSE 12.3 RC2 can boot perfectly with Secure Boot enabled in our UEFI firmware.

    For this RC2 the process needs an extra manual action by the user (an issue which will be addressed before the gold master arrive). When YaST shows you a brief summary of the actions that it will do during the installation process (Installation Settings view), you can see now that in the Booting section there is a new entry: “Enable Secure Boot: false”. You need to click on the Booting section, and enable the Secure Boot support. That is all. Now YaST will create two entries in the Boot Loader section of our firmware, and you need to select the “opensuse-secureboot” one to boot your openSUSE distribution when Secure Boot is enabled in your machine.

    Thank You,