Partitions setup

Revision as of 14:28, 7 August 2014 by WikiFreak (talk | contribs)

How to setup the partitions are a key point in Linux installation process.

There are many school regarding that:

  • More partitions will bring more control and avoid memory leaks to spread out
  • Less partitions are easier to manage


In all cases

In all cases, you need at least 2 partitions:

  • 1 data partition called root (/)
  • 1 temporary partition called "swap". This is the temporary data of the system.


The swap size depends on your RAM:

  • Up to 4 Go RAM: double your RAM value
  • 8 to 16 Go RAM: put the same amount as your RAM
  • more than 16 Go RAM: that's hard to evaluate. 16 Go of swap is already a lot! That should be enough in all cases.


Desktop installation

For a desktop installation you can use the default partitionning table. This is generally good enough.

Some developers - like me - are used to put "/opt" in a dedicated space.


This is my partition table:

File System Mount point Size Type Flags
fat32 /boot 150 Mo primary boot
ext4 / 50 Go primary
swap 8 Go primary
ext4 /home 400 Go logical


Server installation

Unlike a workstation, it's quite important to setup some partitions on a server. This will avoid to have to many logs or temp files - for instance. Then you'll have to monitor regulary the matching mount points to check the available space.


This is how I setup my servers:

File System Mount point Size Type
ext4 / 50 Go primary
swap 8 Go primary
ext4 /home 424 Go primary
ext4 /var/log 2 Go logical
ext4 /tmp 4 Go logical


Advanced

How to know the current hardware and partitions?

You can always have a list of available hardware and partitions by checking-out /dev.

ls /dev/

You'll see some output.

>> Hardware = letter

>> Partition = number


  • /dev/sda
    • /dev/sda1
    • /dev/sda2
    • /dev/sda3
  • /dev/sdb
    • /dev/sdb1
  • /dev/sdc
    • /dev/sdc1
    • /dev/sdc2


As an alternative, you can run the fdisk command:

sudo fdisk -l


Then you'll see more details.


How to know the current mount points

On *Ubuntu Desktop all the devices are automatically mounted. This is not the case on the servers!


To check the list of current mount points:

sudo mount