Add a partition in linux

Create the new partition

Create the partition

chose the hard drive:

1
fdisk -l

And them create the partition:

1
cfdisk /dev/sda

Once it’s done you have to set the type.

1
mkfs.ext4 /dev/sda2

For me it’s sda2 because I already use sda1 for the downloads, the sda2 will be for my games.

Create the directory

Create the directory for the partition:

1
mkdir /home/peanutstick/games

And give the own:

1
sudo chown peanutstick $HOME/games -R

Mount the partition

1
mount /dev/sda2 /home/peanutstick/games

Set it in fstab

If you don’t do if the changes will not be saved after a reboot.

1
sudo vim /etc/fstab

Now add this:

1
/dev/sda2 /home/peanutstick/games ext4 defaults 0 0