π οΈ Steps to Set Up a New Linux Server with Partitioning
1. Boot from Installation Media
- Insert your Linux distribution ISO (e.g., Ubuntu, CentOS, AlmaLinux).
- Boot from USB/DVD and start the installation process.
2. Choose Installation Type
- Select βManualβ or βCustomβ partitioning when asked.
- This gives you full control over disk layout.
π§© Recommended Partition Scheme (for general-purpose server)
| Mount Point | Size | File System | Purpose |
|---|---|---|---|
/boot | 1 GB | ext4 | Holds bootloader and kernel files |
/ | 20β30 GB | ext4/xfs | Root filesystem |
/home | 10β50 GB or more | ext4/xfs | User data (optional on servers) |
/var | 10β50 GB | ext4/xfs | Logs, mail, web data, packages |
/tmp | 2β10 GB | ext4 | Temporary files |
swap | 1β4 GB (or 2x RAM if <4GB RAM) | swap | Virtual memory fallback |
Optional Partitions:
/srvβ For hosting service data (web, FTP)./optβ For third-party applications./dataβ If you’ll store a large amount of data separately.
3. Set Mount Points and File Systems
- For each partition, specify the mount point, size, and file system (ext4 is common).
- Make sure to format each partition (except for swap).
4. Set Bootloader Location
- Usually installed to the primary disk (e.g.,
/dev/sda).
5. Complete the Installation
- Set root password and configure user(s).
- Finish installation and reboot.
π Tips:
- Use LVM (Logical Volume Manager) if you want flexible resizing later.
- Consider RAID setup for redundancy if your server has multiple disks.
- Always have backups before repartitioning or reformatting disks.