Skip to content

Instantly share code, notes, and snippets.

@JQL
Last active August 25, 2018 10:37
Show Gist options
  • Save JQL/4e212f70cc7afb0542f1b3383de3accf to your computer and use it in GitHub Desktop.
Save JQL/4e212f70cc7afb0542f1b3383de3accf to your computer and use it in GitHub Desktop.
Linux Partitions - new file system
Linux Partitions - new file system
1. Create a Partition Table.
2. Create a Boot Partition at the beginning of the Drive (not necessary for an SSD or modern BIOS but good practice so you don't forget when on a "spinning rust drive"):
a. Use Ext2 file system (no journaling):
b. Mount Point: /boot
c. Make the size: >=512MB
d. Primary Partition and "Beginning of this space"
3. Create the Root Partition (Start here if you have an SSD or modern BIOS after creating the Partition Table):
a. Use Ext4 file system
b. Mount point: /
c. Size depends on extra software installed: +/ 32 GB should be way more than enough.
d. Primary Partition and "Beginning of this space"
4. Create a Swap File (see below):
a. Use "swap area"
b. Mount Point: not used
c. Size depends on memory available:
i. <=4GB : 4GB SWAP Partition
ii. >4GB & <8GB : the same size as the memory on the machine
iii. >=8GB : 2GB will suffice in most cases (for intensive video or photo editing work use 4GB to 8 GB). Note: always have a swap file as some functions need it.
d. Primary Partition and "Beginning of this space"
5. Create the HOME Partition:
a. Use Ext4 file system
b. Mount Point: /home
c. Size depends on your requirements but usually the rest of the drive.
d. Primary Partition and "Beginning of this space".
(Note: if you want to add or alter a partition later, make this a Logical Partition)
Notes: If upgrading your distribution, you can remove the format tick from the /home disk partition and all your data files will remain. Just re-install your software later.
Rather than a SWAP Partition you can create a Swap File like in Windows. This is usually faster!
================================================================================================
(Remove the swap partition and the line: "/dev/mapper/mint--vg-swap_1 none swap sw 0 0" from /etc/fstab)
1. cd /
2. sudo dd if=/dev/zero of=swapfile bs=1024k count=MB-num
3. sudo mkswap swapfile
4. sudo swapon swapfile
To mount the file add this line to /etc/fstab:
/swapfile none swap sw 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment