- How do I create an EFI partition
- 3 Answers 3
- Linux Partitioning Recommendations
- Content
- Partitioning for Linux-only Installation
- Disk Selection
- Creating Partitions
- efi (UEFI bootloader)
- / (Linux system)
- /home (personal user data)
- swap (temporary storage)
- Partitioning table summary
- Partitioning to dual-boot Linux and Windows
- Freeing up Space for Linux
- Creating Linux Partitions
- Partition a New Drive for data storage
- Conclusion
How do I create an EFI partition
Background: I have a preinstalled windows 8 desktop and am trying to uninstall windows 8 and install Ubuntu 12.10 with live DVD. I disabled secure boot. Am able to boot live DVD via boot menu only which brings up Ubuntu’ s manual installation menu, I believe. But when trying to install Ubuntu 12.10 I get a blank screen. Completely black. So what I believe the problem is is that I did not create an EFI partition. If I’m wrong someone please correct me and assist. Question: How do I create an EFI partition? Do I do this in Windows 8? Appreciate any help I can get.
3 Answers 3
Since your desktop came with Windows 8 preinstalled I believe you already have an EFI partition. While in the live DVD Ubuntu session try to get gdisk installed via apt-get, and list the partitions with sudo gdisk -l /dev/sda . The partitions would be most likely in this order
- A small, under 1MB partition with code EF02
- The EFI partition with code EF00
- A windows Recovery Environment partition, code 2700
- A windows System Reserved partition containing the BCD, MSR code 0C01
- followed by the OS partition, perhaps code 0700
These short codes are gdisk’s internal, in the GPT they have GUID corespondents.
If this is the partitioning scheme that you already have, you can leave the first four partitions untouched and either shrink or delete the Windows OS partition to make room for Ubuntu partitions. To shrink you’ll have to get gparted installed, otherwise for deletion/creation you can stay within gdisk. If you deleted everything try to recreate this partitioning scheme under gdisk.
edit You can also do the partitioning from within Windows Disk Management, shrink the Windows NTFS partition and make the linux partitions, leaving them unformatted and with no assigned letters, then in the Ubuntu installer just assign them their respective mount points, type and format. It is potentially safer to continue partitioning the disk using the same tool that it was started with. /edit
About your blank screen, you might have a graphic card that still uses old BIOS functions, try to temporarily enable BIOS compatibility while doing the install, and make sure that you are booting your DVD under UEFI. If you boot the DVD under BIOS while trying to do an EFI install you might get into GPT issues.
If you install your Ubuntu with grub-efi-amd64-signed I believe you won’t have to turn secure boot off.
Linux Partitioning Recommendations
Manual disk partitioning can be confusing for new Linux users. In this post, we will provide you our Linux partitioning recommendations. We’ll address both EFI partitioning for dual-boot with Windows and Linux-only installation schemes.
Content
Partitioning for Linux-only Installation
Disk Selection
I’ll use Ubuntu 20.04 LTS installer to demonstrate partitioning, but the same process applies to every Linux distro. We need to get to the manual partition settings of the installer, it is located under the “Something else” label in the Ubuntu installer:
This is how Ubuntu’s installer partition manager looks like:
As we can see, I have two hard drives, which are named alphabetically:
If you also have several hadrd drives on your system, you can select the one you need based on its size.
These are brand-new hard drives that are not partitioned yet. I’ll install my system with /dev/sda disk for my Ubuntu installation. For that we first need to create a partition table on it. A partition table will store information about our partitions.
Select your disk → New Partition Table → Continue
Creating Partitions
Now that we have created a partition table, it’s time to create partitions. You can think of partitions as slicing our disk into parts, each for different purpose.
The first partition will be for the bootloader. Bootloader is responsible for loading the operating system and is critical part of every computer. UEFI and BIOS (legacy) are the two common bootloaders for computers. You can find out what bootloader is supported by your hardware in the motherboard firmware specs. Recent hardware uses the UEFI and we recommend to install Linux in the EFI mode, while older hardware can only be used in the legacy mode.
For the EFI mode, we recommend to create four different partitions:
- efi (UEFI bootloader)
- / (Linux system)
- /home (personal user data)
- swap (temporary storage)
Click the “+” button, and create them in order.
efi (UEFI bootloader)
Starting with the efi partition, 100MB is usually more than enough. The type of partition should be primary. Select “EFI System Partition” in the “Use as” dropdown menu.
/ (Linux system)
Now select the rest of the free space to create the root partition. Ubuntu recommends at least 15GB for the system partition. However, if you want to play games and install many programs, I recommend 50GB or even 100GB. It depends on the size of your hard drive and your needs.
Select Ext4 journaling file system if it’s not already selected by default and mount point to be root (i.e., forward slash /).
/home (personal user data)
Next, select the free space again and click the “+” button to create /home partition. Home partition is used to store personal files like images, downloads, music, videos, etc. Again, depending on your needs, choose the size accordingly. I’ll go with 30 GB because it is only for the demonstration purpose.
Select Ext4 journaling file system if it’s not already selected by default and mount point to be /home.
swap (temporary storage)
Last, we have a swap partition. The system automatically uses a swap partition in case RAM gets filled. This way, it doesn’t have to forcibly close processes to free up RAM/prevent a system crash. We have a dedicated post that goes in-depth about Linux swap, so make sure to check it out if you are interested in learning more about it.
There are no strict rules on how large a swap partition should be. With that being said, there are general guidelines that the community follows. If you have less than 8GB of RAM, the swap should be two times that size. Otherwise, the swap can be the same size as RAM.
Once you have selected the right size, make sure to mark the partition as a swap in the “Use as” dropdown menu, and that’s it!
Partitioning table summary
Here’s how my partitioning table looks like after the above changes.
Complete the rest of the steps and fire up the installation once you are ready! Your distro should boot without any issues!
Feel free to run the following command in the newly installed system to check your partition table, and everything should match:
Congratulations! You have installed Ubuntu with manual partitioning, which gives you a lot more flexibility. For example, you can completely wipe the system partition ( / ) and install another distribution on it while all your personal data in /home stays intact. Just remember NOT to format the /home partition during the re-installation.
Partitioning to dual-boot Linux and Windows
Freeing up Space for Linux
While I primarily use Linux as my operating system, it can fall short in specific scenarios. That’s why some users prefer to dual-boot Windows and Linux. This partitioning recommendation will work exacltly for such users.
First, load the Linux installation live system. This time though, select “Try Ubuntu” instead of “Install Ubuntu”. That’s because we need to free up space for Linux before running the installation.
To that end, we’ll use GParted. GParted is the most advanced partition manager for Linux. It’s a lot more capable than the partition manager in the installer.
There is only Windows installed and it occupies the whole disk. That’s the most common scenario for people looking to try Linux but would like to keep Windows.
The only partition that we can modify is the “Basic data partition”. It’s usually the largest partition, and in my case, it’s /dev/sda3. We are going to resize that partition to free up some space for our Linux system.
Right-click on the basic data partition → Resize → Type the new (smaller) size for that partition
I’ve decided to shrink the basic data partition to 30GB and I was left with 90GB of free space for my Linux system. You need to do similar shrink on your system.
Creating Linux Partitions
We already have an efi partition that was created by the Windows installer, so we don’t need to create it.
We only need to create the remaining three partitions:
The detailed steps on doing this can be found by scrolling up to the “Creating Partitions” section above. The only difference is that GParted has an “Add” button instead of “+” like the installer’s partition manager and you do not need to add mount points in GParted.
After you have provided the new partition scheme in Gparted, all changes are “virtual”, meaning that your drive is still intact. It’s a fantastic feature of GParted that allows us to see how the drive would look with our changes. Once you’re happy with your changes, click the checkmark button on the top menu to apply the changes.
Depending on the size of your drive, it may take some time for changes to complete. Nevertheless, once it’s done, we can proceed with the installation. Launch the installer from the desktop menu and go to the partitioning step. (it’s called “Installation type” in Ubuntu’s installer)
Select manual partition or “Something else”, as Ubuntu calls it and you will see the newly create partition scheme. Now we only need to edit our system ( / ) and /home partitions to specify the mount points for root / and /home respectively.
Proceed with the installation steps, and that’s it! Once you reboot the system, the GRUB menu should show up, asking you to select which operating system to boot.
Note: If it doesn’t show up, don’t panic! Go to the boot manager in BIOS (usually F8 at the boot) and shift Ubuntu to be first in the list.
Partition a New Drive for data storage
Another scenario would be that you have purchased a hard drive and would like to add it to your Linux system as a data storage. Similar to the above, we’ll use GParted, the bets Linux partitioning tool.
Open GParted → Select your new disk → Device → Create New Partition Table → Select type msdos → Apply
Now we can partition the hard drive. If you would like to have use this hard drive with Linux exclusively, you can create one ext4 file system partition that occupies the whole disk.
Alternatively, you can split the drive into two partitions: one for Linux with the ext4 filesystem and another one for Windows with the ntfs filesystem. When you are done with partitioning, don’t forget to click “Apply” for GParted to apply changes.
Opening files manager confirms that the partitions have been created.
Conclusion
We have finally addressed one of the most common sources of confusion regarding manual Linux partitioning. This was a more advanced topic, so kudos to you for reaching it to the end!
Let me know in the comments below if you would like to see more advanced Linux tips. Also, don’t forget to subscribe to our newsletter, so you don’t miss out on the latest posts!