Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to change swap space on ubuntu

# Disable Swap
sudo swapoff /swapfile
# Edit Swapfile to desired size, 2G, 4G etc
sudo fallocate -l 2G /swapfile
# Enable Swap again
sudo swapon /swapfile
# You can check your new swap with
sudo swapon --show
Comment

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

swap memory in ubuntu

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
output 
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=fde7d2c8-06ea-400a-9027-fd731d8ab4c8
Copy
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

swap memory in ubuntu

sudo fallocate -l 2G /swapfile
Copy
Comment

ubuntu edit swap m

edit swap size ubuntu
Comment

PREVIOUS NEXT
Code Example
Shell :: sed insert multiple lines after match 
Shell :: delete file from a branch git 
Shell :: npm help 
Shell :: how to unrar multiple files at once linux 
Shell :: bash multiline string variable 
Shell :: copy command 
Shell :: ? For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) 
Shell :: giphy slack 
Shell :: hide permission denied ~/.bash 
Shell :: docker input device is not a tty 
Shell :: git fork 
Shell :: how to use curl command in ubuntu 
Shell :: wpa passphrase 
Shell :: create a new file in bash script 
Shell :: git create master branch in empty repository 
Shell :: kubernetes copy files to persistent volume 
Shell :: linux distributions command line 
Shell :: shell: how to grep a string 
Shell :: github max file size 
Shell :: npm install firebase @angular/fire 
Shell :: add gist file to dev.to 
Shell :: how force detached ENI 
Shell :: WSL2 git init 
Shell :: how to get security details of binary file 
Shell :: mac workbench error loading schema content 1558 
Shell :: bash leerzeichen entfernen 
Shell :: minecraft launcher installations gone 
Shell :: is dual booting or vm is best for asus rog 
Shell :: disban camera ubuntu 
Shell :: Remove noexec flag mounted device 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =