Trouble with PiAware 8.2 on Ubuntu 20.04 Installed on Odroid N2

I found an easy method of solving memory shortage on my OrangePiPC, running Armbian Bullseye.

It has 1 GB RAM and 0.5 GB swap, i.e. total 1.5 GB which proved insufficient to build dump978-fa from source-code.

As my microSD card has enough free space, I decided to create a 1 GB swap file, making total memory 2.5 GB (1 GB RAM + 0.5 GB original swap + 1 GB swap file created by me). With this arrtangement I could build dump978-fa.

ORIGINAL MEMORY

Click on screenshot to see larger size

 

MEMORY AFTER ADDING 1 GB SWAP FILE

Click on screenshot to see larger size

 

HOW TO ADD SWAP FILE

 

STEP-1: Calculate block size for 1 GB swap file
1 GB = 1000 MB
Block size = 1024 * 1000MB = 1024000 blocks

 

STEP-2: Login as root

pi@orangepipc:~$ su -
Password:
root@orangepipc:~#

 

NOTE:
All steps below should be performed as root.

 

STEP-3: Create 1 GB (1024000 block) swap file “my-swap”

# dd if=/dev/zero of=/my-swap bs=1024 count=1024000 status=progress  

 

STEP-4: Setup correct file permission for security reasons. Following commands make sure only root user can read and write to the my-swap file.

# chown root:root /my-swap  

# chmod 0600 /my-swap  

 

STEP-5: Set up a Linux swap

# mkswap /my-swap  

 

STEP-6: Enable the swap file by following command

# swapon /my-swap  

STEP-7: Open file /etc/fstab for editing

# sudo nano /etc/fstab  

Add following line at bottom of file /etc/fstab to automatically enable my-swap on reboots.

/my-swap none swap sw 0 0

Save and close the file.

 

1 Like