How to partition your hard drive to install Linux Mint

Starting today, I would like to cover Linux here at Winaero! There's no need to panic. It will not replace our regular Windows articles and we will not shift the focus from Windows to Linux manuals and tutorials. However, it will be a nice addition for everyone who wants to give Linux a try for the first time if they are not satisfied with Windows. We will show on our blog how to prepare your PC to install Linux in a dual boot configuration. Today's article is about how to partition the disk drive and optionally make it use a single partition. If you plan to switch to Linux in the future, or if you are just curious about this operating system, you will enjoy it.

Advertisment


Although I prefer Arch Linux for daily use, and it is my primary operating system, here we will cover Linux Mint because it is easy to use and is perfect for anyone familiar with Microsoft Windows. Linux Mint is one of the most popular distros at the moment of this writing. It combines the benefits of the popular Ubuntu Linux with the classic Desktop usability of Windows.

These days, more and more users are interested in trying out some alternative OS besides Windows. The latest Windows versions have become unsatisfactory even for people who were in the Windows camp for many years.

Today, Linux has made huge strides in end user usability and aesthetics. Previously, it was a bit geeky and installation wasn't that simple. You were given too many choices and still had to resort to the command line for some operation. Modern Linux distros have a simple graphical installer which makes installation a breeze. It is as easy as installing Windows.

How to partition your hard drive for Linux Mint

It is a myth that Linux requires many partitions on the hard drive. Actually, there is no reason to have lots of partitions. When installing, you can omit most of them and have only a single partition where your Linux distribution will be installed.

Personally, I prefer having the following partition layout:
/boot - 300MB
/ - root partition of 20 GB
/home - the largest partition.
/swap - 2 x size of RAM

The boot partition has the boot loader files. The root partition contains the operating system files, logs and configuration files. The swap partition is used when your system needs to move memory pages between the RAM and the disk. And the Home partition contains all the user data, that is why it has the largest size.

But there is no actual reason to have a separate /boot partition unless you have some exotic or encrypted file system for the root (/) partition which cannot be read by the Linux kernel directly.

The reason I made a separate /home partition is for data safety. That way, you can unmount the /home partition and perform system maintenance without risk of data loss. You can even reinstall the operating system and format all the other partitions and keep your /home partition with all your data and app preferences intact!

As I said above, you can omit all these separate partitions and you can have only the /root partition. As for the swap partition, you can instead have a swap file. A swap file is slightly slower than a dedicated partition but is still quite usable. If you worry about slowdown issues, then just create the swap partition 2 x the size of your RAM.

To create the desired partition layout when installing Linux Mint, switch the installer's page to "something else":

Linux mint partitions

It will show you the partitions on your hard drive. Mine has no partitions:

Linux mint no partitions on the drivePress the "+" button to add a new partition. Adjust the partition size you want to give to Linux Mint, set the mount point to "/" (root) and leave the file system as ext4:

Linux mint create root partitionIf you decide to separate the home partition, create it now as a primary partition with the desired size:

Linux mint create home partitionYou can get something like this:

Linux mint created partitionsTo create the swap partition, you need to create a new primary partition and select "swap area" as its file system:

Linux mint swap partitionIn my case I created the following layout:

Linux mint created partitions 2It has one root partition which contains all the user and system data, and the swap partition as well.

The swap file

If you decided to not create a swap partition and use the swap file instead, you need to do the following steps after the installation:

      1. Open the terminal app.
      2. Type the following:
        sudo su

        Type your current password to get root privileges. The prompt will change from the ~ symbol to #:Linux mint root terminal

      3. Type the following in the terminal:
        # fallocate -l 1024M /swapfile

        This will create a new file, /swapfile with 1 GB of size. Adjust the size to the desired value.

      4. Adjust permissions for the /swapfile file using the following command:
        # chmod 600 /swapfile
      5. Format the file to be used as a swap file:
        # mkswap /swapfile

        Linux mint swap file

      6. You just created a ready-to-use swap file. Now you need to make it active. Open the /etc/fstab file with any text editor. Nano text editor is pretty good for this task:
        # nano /etc/fstab
      7. Type the following line in Nano:
        /swapfile none swap defaults 0 0

        Linux mint swap file in fstab

      8. Press Ctrl + O to save the /etc/fstab file.
      9. Press Ctrl + X to exit Nano.

You are done. After rebooting, the operating system will use the file /swapfile as the swap file. To check how your operating system is using the swap partition or the swap file, type the following command in the terminal:

$ cat /proc/swaps

It will show you which device, partition or file you are using for swapping purposes and how it is used at that moment:
Linux mint swap usage

That's it. So, it is possible to use only one partition to run the Linux Mint operating system smoothly.

Advertisment

30 thoughts on “How to partition your hard drive to install Linux Mint

  1. Samit

    After this tutorial, I’m waiting for your tutorial to install Linux alongside Windows (dual booting) as soon as possible.

    Reply
    1. Sergey Tkachenko Post author

      Why not? I will write

      Reply
  2. myr4ik07

    Ну очень мне нравится это граф окружение

    Reply
  3. luiz fernandes

    congratulations,for universal vision of internet,and continue with readineness about Linux Mint,write more tutorials and thankyou,for my english,i am brazilian.

    Reply
    1. Sergey Tkachenko Post author

      Thank you. I will try.

      Reply
  4. Mr. sayak

    i try to install linux mint 17.3 in windows 7.. as demo version.. can it possible ? :/

    Reply
    1. Sergey Tkachenko Post author

      Well, you can start with a virtual machine setup. Install it in VirtualBox

      Reply
      1. Mr. sayak

        that means linux mint 16 only can demo vertion. good for double boot system. not all version . thnkss :)

        Reply
  5. Mr. sayak

    and one question.. what’s mean by /swap – 2x size of RAM ?? can u plz tell me. :/ i can’t understand and install it.

    Reply
    1. Sergey Tkachenko Post author

      If you RAM size is 2Gb, means your swap partition is recommended to be 4Gb.

      Reply
      1. Mr. sayak

        hmmm.. i’m using corsair 4gb ram that means ,my swap partition is recommd to be 8 gb ( 8192 mb ) ;) i get it, thnkss for guid me sir :)

        Reply
        1. Sergey Tkachenko Post author

          Indeed.
          You are welcome

          Reply
  6. Bob

    I type this from Linux Mint setup on a new PC I got, afraid to screw up the partitions. Suppose I have Windows 8.1 installed on a modern PC with UEFI BIOS and GPT disk. It created a Recovery Partition for WinRE, another EFI system partition, a Microsoft Reserved Partition and the partition where Windows is installed. I created yet another partition for Linux. So far so good. Now my disk already has 5 partitions. So now I want to avoid more partitions. Is there a way to make the Linux Mint setup share its /boot partition with any of the existing partitions Windows created and have the rest 3 that Linux needs (root, home and swap) on a single partition I created for Linux Mint? Or it will create at least 1 more as Linux /boot partition?

    Reply
    1. Bob

      I guess I should set the “Device for boot loader installation” to /dev/sda and not any of the partitions. That way, Linux’s boot loader will take over the Windows one and give me the option of which to boot? Or another option is /dev/sda5 (which is my ext4 partition) and then use EasyBCD from Windows to add Linux to the Windows boot loader.

      Reply
  7. Bob

    Well it looks like first option is my only choice since evil Microsoft has blocked the loading of legacy or non-Windows operating systems from the BCD menu when in UEFI mode.

    Reply
    1. Bob

      Tried all! Even set /dev/sda as boot device and reinstalled again using Mint Setup but it will only boot Windows 8.1 and not even show the Linux boot manager, GRUB. Looks like on EFI system, it is not as easy as legacy MBR.

      Reply
  8. Bob

    Well finally thanks to this article and some more research, I got it working. On an EFI system, if GRUB isn’t becoming the default, move the files to \EFI\Boot\ and rename the main file as bootx64.efi.

    Reply
  9. Jim

    Very helpful for someone returning to Linux after many years. Good to see the standard boot-root-swap config has still held up.

    A few notes for future readers:

    * A good post on shrinking your Windows 10 partition to make room: http://www.everydaylinuxuser.com/2015/11/how-to-shrink-windows-10-to-make-space.html
    * With Linux Mint 17.3, Mint’s installer also insists that you make a 1MB partition for Grub, marked as “Reserved for BIOS use.” If you don’t, it’ll prompt you to go back and make one.
    * With regards to Bob’s earlier note re: UEFI and bootloading, I had to enable legacy bootloading in my BIOS in order to get things up and running. Then everything came up fine.

    Thanks for the post, Sergey!

    Reply
  10. FrustratedNoob

    You lost me after, “It is a myth that Linux requires many partitions on the hard drive” – and then went on to talk about partitions.

    I’m an absolute, 100% noob at this. I have an Asus F555LD laptop with a newly upgraded system to Win 10.

    I can’t even understand the Windows 10’s boot menu and what to choose once I’ve stumbled upon it so that I can install Linux Mint Rosa from a disc.

    In fact, in all the tech ‘info’ on how to dual boot, no one – but NO ONE – tells noobs what to do when they get into Windows 10’s boot menu – provided they can even figure out how to find it in the first place.

    This nonsense is becoming a career that I just don’t have time for just to be able to use a Linux distro instead of the much hated Windows OS.

    Is there anybody on earth who understands how to explain details (not history lessons with a lot of technical jargonese, mind you, as most tend to do!) on how to actually do this without leaving me with a migraine and sending me in a dozen different directions to read this jibberish and that jibberish?

    Reply
    1. linux newbie

      Hi. Hope you have figured this out. I don’t see a date on this.
      So I have an ASUS and finally figured out….after HOURS…..how to get it to boot linux.

      a few things to do…

      First Go to control panel
      Select ‘Power Options’
      Select ‘Choose what the power buttons do’
      click on ‘change settings that are currently unavailable’
      Uncheck the box for ‘fast boot’ or ‘fast start up’

      move your mouse to the upper right to bring up the black side bar
      select ‘settings’
      now!
      hold down your shift key and click the “power button” and click “restart”…..ALL WHILE HOLDING SHIFT

      When your pc starts back up you will see a blue screen
      go to advanced options
      go to reset boot options, this will restart your comp to the BIOS
      go to ‘security’ and disable secure boot
      go to ‘boot’ and disable ‘fast boot’ —should be disabled already
      go to launch csm and disable — i saw in one place to have this enabled and another to have it disabled
      press f10 to SAVE and exit

      boot up normal
      REPEAT:
      move your mouse to the upper right to bring up the black side bar
      select ‘settings’
      now!
      hold down your shift key and click the “power button” and click “restart”…..ALL WHILE HOLDING SHIFT

      When your laptop restarts you will see a blue screen which has an option ‘boot from device-cd/usb/etc’ choose this option and select cd or USB which ever you are using.

      now sometimes i have to restart my laptop several times to get it to see the usb, i am not sure what is going on with that but i am going to partition my hard drive and install it

      I hope this helps, i pieced together things i saw on several websites to finally get it to work
      there is no ‘press f12 or press f2’ to get boot menu list

      best of luck!

      Reply
  11. timinski

    Nice write-up. Thank you!

    Related question that I can’t seem to source the answer to despite MUCH searching:

    How to force Mint installer (currently 17.3) to leave my 2nd DOS partition (1st 2gb partition in extended partition) untouched at install time. I need to have a system dual boot as either DOS (PC-DOS 7.01) with primary FAT16 and 1 x logical FAT16 or boot to Mint with the balance of the HDD as Ext4 Root, Home and a 4GB swap partition.

    I know, I know….DOS?? Sorry but it is still needed for some ancient programs I still use which require an LPT dongle…..that can only otherwise be used (unstably) via VMWare or VirtualBox + extensions

    What always seems to occur is that after installing Mint alongside my DOS install, I either lose access to my DOS logical partition or more fun (!), this logical partition works under DOS but is invisible to Mint which accesses the partition differently and reads/writes to it via a FAT table that DOS cannot access. In other words, a file created on the 2nd FAT16 partition under DOS is invisible to Mint and vice-versus one created under Mint is invisible to DOS.

    Any help or tips would be wonderful.

    Thanks!
    — Timinski

    Reply
  12. Rade

    HI.I want to know can I install partitioning sheme like this:
    /root
    /swap
    /home

    I mean installing without /boot and I want to know should Linux boot without /boot partition.
    This would be useful when making system image with clone zilla
    Thanks

    Reply
    1. Sergey Tkachenko Post author

      It will work perfectly.
      I have 3 PCs here with the /root partition only and two with /root and /home.
      I prefer these layouts for SoC boards (Banana Pi/Raspberry Pi etc).

      Reply
  13. Jake

    Thank you! :)

    Reply
  14. John Lane

    Hi Sergey, I am trying to follow your directions to create four partitions for my Linux Mint 19.1, /boot, /root, /home & swap. However, you begin the instructions with the creation of /root followed by /home then /swap, but you do not mention /boot. Am I supposed to create it first? Thank you for your patience with a noob.

    John Lane

    Reply
    1. Sergey Tkachenko Post author

      Yep, if you want to create a separate boot partition, then create it before your root and home partitions.

      Reply
  15. Muhammad Omar

    Is it necessary for the partitions to be in the same order in each of the following cases?
    The first case:
    1- boot
    2- /
    3- home
    4- swap
    The second case:
    1- /
    2- home
    3- swap

    Reply
    1. Sergey Tkachenko Post author

      Hello. I don’t know how the partition order is important or not.
      But I would follow the order you have mentioned.
      My devices are all partitioned using it.

      Reply
  16. DeeDee

    Hi. I want to install Linux mint 20 and Ubuntu studio I have a 250 gb hard disk drive. I plan to completely erase the hard disk before I do this. How do I make partitions/install both operating systems?

    Reply
    1. Sergey Tkachenko Post author

      Erase the disk
      Create one boot partition of 400 Mb
      Create one root partition for Linux Mint
      Create one home partition for Linux Mint
      Install Mint without a swap partition. Format and use the above partitions you have created.
      Do not create other partitions.

      Start Ubuntu Studio
      Use the above Boot partition.
      Create one more root partition for Ubuntu Studio
      Create one more home partition for Ubuntu Studio

      Swap both OSes to a file like /swapfile.

      It is a general recommendation, and can be adjusted. But in most cases it will do its work.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *