Partitioning Linux

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Partitioning Linux

Post by Overkill »

Hi guys.
I am wanting to setup my hdd like I would with windows...I'm kind of confused on how to do that with Linux.
I normally create a 60-80gb partition for the OS, then whatever is remaining i'll create my storage drive.
When I open GParted it doesn't show a swap file, but when I check using swapon -s it shows I have a 2gb swap.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
pebcak
Level 4
Level 4
Posts: 222
Joined: Mon Dec 16, 2019 4:59 am

Re: Partitioning Linux

Post by pebcak »

It is because it is a file and not a partition. If you don't create any swap partition when installing the system, the installer creates a swapfile automatically. Look under root for /swapfile.
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

pebcak wrote: Fri Dec 25, 2020 5:09 am It is because it is a file and not a partition. If you don't create any swap partition when installing the system, the installer creates a swapfile automatically. Look under root for /swapfile.
True! What is the difference between a swap file and partition and which is better?
Am I able to partition Linux like I would Windows? Explained in the OP

Screenshot from 2020-12-25 16-47-29.png
Last edited by Overkill on Fri Dec 25, 2020 5:52 pm, edited 1 time in total.
pebcak
Level 4
Level 4
Posts: 222
Joined: Mon Dec 16, 2019 4:59 am

Re: Partitioning Linux

Post by pebcak »

Here are a couple of ArchWiki articles that might give you some start point for researching further:
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

pebcak wrote: Fri Dec 25, 2020 5:45 pm Here are a couple of ArchWiki articles that might give you some start point for researching further:
All I basically need to know is, can it be done in Linux? I don't see why, I know how to partition, I just wasn't sure about how ext4 works compared to ntfs.
pebcak
Level 4
Level 4
Posts: 222
Joined: Mon Dec 16, 2019 4:59 am

Re: Partitioning Linux

Post by pebcak »

You could use Gparted from the live USB and partiton the disk, format partitons etc. Just format to EXT4 if that is the format you need.
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Partitioning Linux

Post by AndyMH »

Depends on what you want to do? I've got a swap partition because I've always had one, but from LM19 onwards mint by default will use a swap file. If you have 8GB RAM swap will rarely get used. If you hibernate then I think you still need a swap partition (I don't).

As to partitioning, there are two basic choices:
  • A single ext4 partition for / with /home living within this partition.
  • Separate ext4 partitions for / and /home.
In addition, if you are booting UEFI you need a small (100MB, format fat32, flags = esp & boot) EFI partition. If you really want a swap partition then make it the same size as your RAM.

You will find advocates for both approaches in this forum. I'm in the have a /home partition camp. Back in my win days I always partitioned my drive so that C: = system & programs and D: = data. Having a separate /home partition is the equivalent (but it also stores your config files). It also makes it easier on a major version change, e.g. LM20 to LM21 - you can do a clean install on / leaving your data in /home untouched.

If you go down this route, then make your / partition 30-40GB (mine is 32GB and 20GB used, lot of stuff installed but I don't use flatpaks). Note - programs in linux don't suffer the bloat you get with win programs = less disk space.

If you go for separate / and /home partitions it is imperative that you set up timeshift to store snapshots on a separate drive (or separate partition = 2nd best choice). Too many posts on the forum from newbies using the defaults with timeshift (saves to /timeshift) and filling up their / partition = no boot. Think of timeshift as the equivalent of a win restore point.

timeshift takes care of the system (default backs up / excluding /home). You will then need something to take care of your data in /home. I use backintime, another alternative is luckybackup. Their default is to backup only /home, so complimentary to timeshift. Don't expect much sympathy on the forum if you bork your system and don't have backups in place. Screwing up is part of learning linux so make sure you are prepared.

How to do it? - the way I do it is to set up the partitions with gparted before installing mint. gparted is the standard linux partition editor, there is a copy on the mint install media. Then when you install mint, choose the 'something else' option. The next screen allows you to point at the partitions you created and tell the installer what to use them for.

Happy Christmas!
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

AndyMH wrote: Fri Dec 25, 2020 6:21 pm Depends on what you want to do? I've got a swap partition because I've always had one, but from LM19 onwards mint by default will use a swap file. If you have 8GB RAM swap will rarely get used. If you hibernate then I think you still need a swap partition (I don't).

As to partitioning, there are two basic choices:
  • A single ext4 partition for / with /home living within this partition.
  • Separate ext4 partitions for / and /home.
In addition, if you are booting UEFI you need a small (100MB, format fat32, flags = esp & boot) EFI partition. If you really want a swap partition then make it the same size as your RAM.

You will find advocates for both approaches in this forum. I'm in the have a /home partition camp. Back in my win days I always partitioned my drive so that C: = system & programs and D: = data. Having a separate /home partition is the equivalent (but it also stores your config files). It also makes it easier on a major version change, e.g. LM20 to LM21 - you can do a clean install on / leaving your data in /home untouched.

If you go down this route, then make your / partition 30-40GB (mine is 32GB and 20GB used, lot of stuff installed but I don't use flatpaks). Note - programs in linux don't suffer the bloat you get with win programs = less disk space.

If you go for separate / and /home partitions it is imperative that you set up timeshift to store snapshots on a separate drive (or separate partition = 2nd best choice). Too many posts on the forum from newbies using the defaults with timeshift (saves to /timeshift) and filling up their / partition = no boot. Think of timeshift as the equivalent of a win restore point.

timeshift takes care of the system (default backs up / excluding /home). You will then need something to take care of your data in /home. I use backintime, another alternative is luckybackup. Their default is to backup only /home, so complimentary to timeshift. Don't expect much sympathy on the forum if you bork your system and don't have backups in place. Screwing up is part of learning linux so make sure you are prepared.

How to do it? - the way I do it is to set up the partitions with gparted before installing mint. gparted is the standard linux partition editor, there is a copy on the mint install media. Then when you install mint, choose the 'something else' option. The next screen allows you to point at the partitions you created and tell the installer what to use them for.

Happy Christmas!
This really helped! especially how you explained it comparing windows with linux!
So, basically rather than C:/=Windows OS and D:/=Storage i'll just have 2 /home partitions? And I can store my files one the second /home partition?
40gb is enough for Linux/updates etc.?
Would it be better to save snapshots on a flash drive?
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Partitioning Linux

Post by AndyMH »

So, basically rather than C:/=Windows OS and D:/=Storage i'll just have 2 /home partitions? And I can store my files one the second /home partition?
No, you don't have two /home partitions, you have one / partition and one /home partition. 40GB is plenty for /.

This is what the drive looks like in gparted for one of my laptops:
Screenshot from 2020-12-26 11-39-01.png
Legacy boot so no EFI partition.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

AndyMH wrote: Sat Dec 26, 2020 7:42 am
So, basically rather than C:/=Windows OS and D:/=Storage i'll just have 2 /home partitions? And I can store my files one the second /home partition?
No, you don't have two /home partitions, you have one / partition and one /home partition. 40GB is plenty for /.

This is what the drive looks like in gparted for one of my laptops:
Screenshot from 2020-12-26 11-39-01.png
Legacy boot so no EFI partition.
Sorry, that's actually what I meant. Thanks for the visual, it helps alot!
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

I'm trying to install Mint 20 on my laptop, but it's not cooperating!
When it tells me to change it to EFI, it says I have no root partition but I don't see an option for that???

rsz_screenshot_from_2020-12-27_19-49-36.jpg
rsz_screenshot_from_2020-12-27_19-49-36.jpg (12.92 KiB) Viewed 1613 times
rsz_screenshot_from_2020-12-27_19-50-26.jpg
rsz_screenshot_from_2020-12-27_19-50-26.jpg (15.81 KiB) Viewed 1613 times
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Partitioning Linux

Post by AndyMH »

It's because your BIOS is set to UEFI boot and you haven't got an EFI partition. You can either:
  • wipe the existing partitions and start again, creating a small EFI partition and then two ext4 partitions for / and /home, or
  • shrink the /home partition, think it's sda3 - screenshot difficult to read, to create space at the end of the drive and create an EFI partition there.
Your EFI partition needs to be formatted fat32, and the flags boot & esp set (this is what tells the installer and BIOS that it is an EFI partition), size around 100MB, so small. It doesn't have to be big, all that lives there are the bootloader files.

I prefer making these changes with gparted, but you can do it in the mint installer (I think).

The other thing you should check - in gparted, view > device information. It will open up a panel on the left. When installing in UEFI mode, your drive should have a GPT partition table. When installing in legacy mode, it should have an MSDOS partition table. Given its name, legacy/msdos, it is the old standard for partition tables and comes with some limitations, GPT is the modern standard and does away with the limitations of an msdos partition table.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

Sorry, I tried to upload the orginal images but when I tried to attach them, they were to large, so I had to resize them.
I am going to try again tonight and see how it goes.
User avatar
Pierre
Level 21
Level 21
Posts: 13215
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Partitioning Linux

Post by Pierre »

you can also tell which Mode that you have used .. EFI / legacy .. ms-dos mode
as you do have to select that, at startup, and before the Boot Media is started.

if there is no /efi partition, available, then you can create that partition with the Gparted program.
- - 500Mb is more than enough.
try to place that /efi partition, at the start of the drive, if possible.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

Pierre wrote: Tue Dec 29, 2020 2:46 am you can also tell which Mode that you have used .. EFI / legacy .. ms-dos mode
as you do have to select that, at startup, and before the Boot Media is started.

if there is no /efi partition, available, then you can create that partition with the Gparted program.
- - 500Mb is more than enough.
try to place that /efi partition, at the start of the drive, if possible.
What's the purpose of a 500mb EFI partition?
User avatar
Pierre
Level 21
Level 21
Posts: 13215
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Partitioning Linux

Post by Pierre »

in any 64bit system, there is an /efi folder & /efi partition,
that contains the system boot files, without which, the machine won't boot up.

this applies to both the Windows System & the Linux System,
and YES .. they do conflict with each other.
:roll:
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

Pierre wrote: Wed Dec 30, 2020 1:40 am in any 64bit system, there is an /efi folder & /efi partition,
that contains the system boot files, without which, the machine won't boot up.

this applies to both the Windows System & the Linux System,
and YES .. they do conflict with each other.
:roll:
I'd appreciate some understanding since I'm new to Linux...I installed Pop OS on my laptop and I only assigned a /, /home and a swap partition, so it must have installed the EFI partition automatically because it boots just fine.
What is the best bios settings to install Linux on laptops that came installed with Windows 8 or 10? I'm having issues with my other laptop which is a Samsung, no matter what settings i've tried in partitioning or the BIOS, at boot it gives me this error...“All boot options are tried. Press <F4> key to recover with factory image using Recovery or any keys for next boot loop iteration.”
User avatar
Pierre
Level 21
Level 21
Posts: 13215
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Partitioning Linux

Post by Pierre »

that Pop OS must have Installed as MBR / legacy, if there was no mention of an /efi thing.

your Samsung would be 64bit, if it had either win-8x or win-10 installed on it.
thus the LinuxMint will also have to be 64bit & /efi as well.

you will need to select the /efi mode at boot, of your LinuxMint Live Media,
or the Installation will be wrong .. it won't 'see' any other system, either.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
User avatar
Overkill
Level 3
Level 3
Posts: 130
Joined: Wed Dec 23, 2020 5:13 pm

Re: Partitioning Linux

Post by Overkill »

I figured everything out! I created a EFI partition at the beginning of the drive and swap, then / and /home and it finally boots!

https://i.imgur.com/whPbvFW.jpg
I will do the same with my Mint install. Thanks
User avatar
David Chiang
Level 3
Level 3
Posts: 102
Joined: Sun Jul 01, 2007 4:42 am
Location: Higashiōsaka, Japan
Contact:

Re: Partitioning Linux

Post by David Chiang »

Pierre wrote: Wed Dec 30, 2020 1:40 am In any 64-bit system, there is an /efi folder & /efi partition, that contains the system boot files, without which, the machine won't boot up. This applies to both, the Windows System & the Linux System, and YES ... they do conflict with each other.
We should also mention at this point that this only applies in the event that no boot loader like GRUB has been installed beforehand. :wink:
LMDE 5 Elsie (64-bit), Linux Kernel 5.10.0, Cinnamon 5.6.8, inxi 3.3.28;
HTPC: ASUS TUF B450M-Pro Gaming, 3.6 GHz AMD Ryzen 7 3700X (8 cores),
AMD Radeon Pro WX 7100, 2 × 4 TiB Seagate BarraCuda ES.3, 4 × 16 GiB HyperX Predator DDR4;
Locked

Return to “Storage”