Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to swap ubuntu

# Check Current Swap
sudo swapon -s

# Create Swap File
sudo fallocate -l 4G /swapfile
chmod 600 /swapfile

# Make it to swap format and activate on your system
sudo mkswap /swapfile
sudo swapon /swapfile

# Make Swap Permanent
sudo vim /etc/fstab
# and add below entry to end of file
/swapfile   none    swap    sw    0   0

# Check System Swap Memory
sudo swapon -s
free -m

# Update Swappiness Parameter
sudo vim /etc/sysctl.conf
# append following configuration to end of file
vm.swappiness=10

# Now reload the sysctl configuration file
sudo sysctl -p
Comment

create swapfile ubuntu

sudo swapon --show
Comment

create swapfile ubuntu

sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
Comment

create swapfile ubuntu

sudo swapon /swapfile
Comment

create swapfile ubuntu

sudo fallocate -l 1G /swapfile
Comment

create swapfile ubuntu

sudo nano /etc/fstab
Comment

create swapfile ubuntu

/swapfile swap swap defaults 0 0
Comment

create swapfile ubuntu

sudo mkswap /swapfile
Comment

increase swap size ubuntu


https://docs.rackspace.com/support/how-to/create-remove-swap-file-in-ubuntu/

//changes on this line only
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 oflag=append conv=notrunc
The above command will append 1GiB of zero bytes at the end of your swap file.
Comment

create swapfile ubuntu

sudo chmod 600 /swapfile
Comment

PREVIOUS NEXT
Code Example
Shell :: bash check if file is readable 
Shell :: remove icon from desktop ubuntu 
Shell :: how to install vim on macos 
Shell :: grep after match 
Shell :: cookiecutter 
Shell :: npm i postgresql 
Shell :: yarn install production only 
Shell :: bootar pendrive linux 
Shell :: linux change permissions recursive only directories 
Shell :: my ip 
Shell :: delete branch gitlab 
Shell :: push imagesto docker 
Shell :: clone all github repos 
Shell :: how to convert colab notebook to html 
Shell :: installing sonarqube on ubuntu 
Shell :: chmod chown 
Shell :: git clone without folder 
Shell :: rename all files starting with in linux 
Shell :: change commit branch after push 
Shell :: how to delete an issue on github 
Shell :: ubuntu navigate to directory in windows 
Shell :: powershell to connect to remote computer 
Shell :: get logs from application isntaller 
Shell :: git clone does not show all branches 
Shell :: docker answer dialog 
Shell :: git list files only upto 1-levels 
Shell :: Vim deleting all lines containing pattern 
Shell :: brownie coverage 
Shell :: ufw enable no disrupt 
Shell :: jq for xml 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =