You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI - How To Add Virtual Memory Partition in Oracle Linux 8 or 9 Platform Images

edited May 15, 2023 8:53AM in Linux

Applies to:

Oracle Cloud Infrastructure

Linux x86-64


Goal:

Add additional virtual memory (aka swapfile) as an additional partition to an Instance running the OCI Oracle Linux 8 or 9 Platform Image.


Solution:

When an Instance is created from an Oracle Linux 8 OCI Platform Image, the below can be observed:

[opc@instance ~]$ ls -ilha /.swapfile
13014 -rw-------. 1 root root 4.0G Apr 25 09:16 /.swapfile

[opc@instance ~]$ cat /etc/fstab | sed 's/#.*$//g;/^ *$/d'
/dev/mapper/ocivolume-root                /         xfs   defaults                                       0 0
UUID=f7cf63bd-4975-44bb-ba99-b81e037be7e1 /boot     xfs   defaults                                       0 0
UUID=9814-8B9E                            /boot/efi vfat  defaults,uid=0,gid=0,umask=077,shortname=winnt 0 2
/dev/mapper/ocivolume-oled                /var/oled xfs   defaults                                       0 0
tmpfs                                     /dev/shm  tmpfs defaults,nodev,nosuid,noexec                   0 0
/.swapfile                                none      swap  sw,comment=cloudconfig                         0 0

[opc@instance ~]$ lsblk -flamp
NAME                       FSTYPE      LABEL UUID                                   MOUNTPOINT  SIZE OWNER GROUP MODE
/dev/sda                                                                                       46.6G root  disk  brw-rw----
/dev/sda1                  vfat              9814-8B9E                              /boot/efi   100M root  disk  brw-rw----
/dev/sda2                  xfs               f7cf63bd-4975-44bb-ba99-b81e037be7e1   /boot         1G root  disk  brw-rw----
/dev/sda3                  LVM2_member       tixqPz-Ls6v-ejHE-mL8K-Zavk-d0hl-C5O4xj            45.5G root  disk  brw-rw----
/dev/mapper/ocivolume-root xfs               8b8d3b19-9faa-4dee-b3ba-765c3515b283   /          35.5G root  disk  brw-rw----
/dev/mapper/ocivolume-oled xfs               21d53c77-7876-4a1c-b4e1-a8cd74d1938c   /var/oled    10G root  disk  brw-rw----

[opc@instance

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!