Greetings,
I want to manually install Rocky Linux Server with the: DISA STIG for Rocky Linux 8.
It will be installed on a virtual machine (Virtual Box) with the bellow specifications:
- Disk space: 65GB total (fixed)
- RAM Memory: 2GB total
What types, sizes etc of disk partitions should i create?
Thanks in advance.
You can use the installer to âviewâ the partition sizes, and then you can always cancel if you donât like what you see. The server will be somewhat constrained with your spec, and you wonât have much room to expand.
Once you start the installer select âInstallation Destinationâ, select âCustomâ and then âDoneâ, and then select âcreate them automaticallyâ, which will show you a list of partitions and sizes (with reasonable defaults). /boot/efi, /boot, /, swap, /home.
Be careful with /home, as it will stretch the end of the disk, and you canât shrink it later. If you had bigger disks you could make /home smaller, and then create a new physical volume, volume group, logical volume in the free space called something like /data. That way you can keep things like databases and web content outside of /var or /home.
1 Like
The default filesystem is XFS. One canât shrink XFS. However, on you can change the filesystem type in the installer. I still use primarily ext4, which can shrink.
Hey thanks for the reply,
my question/request is a guide about manual partitioning, like what type of format, size, directories should i create etc⌠with the DISA STIG for Rocky Linux 8 in mind. ( One example is that i found on the internet that some say to create /swap size with the exact amount of my RAM memory and some say with the half of it).
The purpose of this server is to create a basic web host for test purposes with the bellow installed:
- NGINX
- MariaDB
- Webmin
- Wordpress
Hi,
I use the following for cpanel servers, which is basically a prebuilt LAMP server; which just users apache rather than nginx:
xfs on lvm
/boot 1024 MB
/TMP 1024 MB
I just use what was recommended for SWAP, for 7 (Chapter 15. Swap Space Red Hat Enterprise Linux 7 | Red Hat Customer Portal)
/ The rest.
Thanks Tom.
The values provided by the installer are worth looking at, as they make an intelligent guess, and are what youâd expect to see on a RHEL enterprise server.
1 Like
DISA STIG just mandates a separate /tmp partition. There are other security benchmarks which are more demanding in that regard. The CISecurity Benchmark for example wants
/tmp
/var
/var/tmp
/var/log
/var/log/audit
/home
see CIS Red Hat Linux Benchmark
additional partitions for application data can make sense, e.g. separate partitions for application data or logs.
Appendix B. Partitioning reference Red Hat Enterprise Linux 8 | Red Hat Customer Portal notes that /usr
and /var
are critical for boot and them being separate partitions makes things more complex. They also note that some security policies do require the separation.
Cloud provider that I have used has (OpenStack) image that creates only one partition, /
for the system volume. No /boot, no swap. One can attach and mount additional (data) volumes and one can create swapfile, if necessary. Obviously, security policies are not in general use among their clients, i.e. such default image is ok.
Apart from security policy, there is matter of convenience. If you need to reinstall, then what do you need to rewrite and what should be kept? (User) data is what you definitely want to keep; it is unique and thus valuable. OS files are reproducible. Configuration depends on OS files, but is unique; should be deployable. On bare metal it makes sense to separate the data to partition that reinstall will not touch. On VM ⌠perhaps it is âcheaperâ to create new instance and ârestoreâ data to it? (E.g. if OS is in âsystem volumeâ and data on attached volume, reattaching that data volume to new VM is âa restoreâ or âkeepâ?)
1 Like
Hey thanks for your reply,
Does that mean that, when i create a new partition letâs say for example: /var/log/audit it will created with a predefined disk space?.
A âpartitionâ is a continuous set of sectors (LBAs) on disk. Partition table stores just indices of first and last sector. When you create a partition, you decide how many sectors, how much space, it will have.
A âfilesystemâ is file data and metadata about those file objects. It is within sectors of a partition. (Technically, filesystem could be smaller than the partition, but then you have unallocated sectors.)
You mount a filesystem to some path.
The installer asks you for mount point (the path), size, and filesystem type (default is XFS). Then it creates partition of desired size, initializes a filesystem in it, and adds the mount instructions to /etc/fstab
.
1 Like