Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:linux:create_new_swapfile [2023/04/28 13:39] – removed - external edit (Unknown date) 127.0.0.1 | wiki:linux:create_new_swapfile [2025/01/07 12:37] (current) – ↷ Page moved from wiki:linux:install_davinci_resolve:wiki:linux:create_new_swapfile to wiki:linux:create_new_swapfile Greg | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How To Create a New Swap File ====== | ||
+ | Sometimes the amount of RAM that your system has is not enough for the applications you run, or maybe you're running some poorly-written software that runs fine within the RAM you have but complains about low amounts of swap space. In either case, you'll need to add more " | ||
+ | |||
+ | The guide below will demonstrate how to do this. We will be moving forward with the following assumptions (both of which will be up to you to decide): | ||
+ | * You want your new swap file to be '' | ||
+ | * You wish to create the swap file at '' | ||
+ | |||
+ | ===== Create the Swap File ===== | ||
+ | |||
+ | The first thing you need to do is create the swapfile (obviously!). Simply create the directory (if it doesn' | ||
+ | |||
+ | < | ||
+ | mkdir -p / | ||
+ | fallocate -l 16G / | ||
+ | </ | ||
+ | |||
+ | ===== Configure the Swap File ===== | ||
+ | |||
+ | Now we need to set permissions on the swap file so that only root can read/write to it. Simply run: | ||
+ | |||
+ | < | ||
+ | |||
+ | And then run '' | ||
+ | |||
+ | < | ||
+ | |||
+ | At this point, we have a swap file located at '' | ||
+ | |||
+ | ===== Enable the Swap ===== | ||
+ | |||
+ | Finally we need to configure our system to load the swap at boot time, and then load the swap space on our running system (or just reboot, either works). Open up '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Now you can either reboot to load the new swap space, OR you can run the following command to load it on the running system: | ||
+ | |||
+ | < | ||
+ | |||
+ | ===== Testing ===== | ||
+ | |||
+ | Of course, anything you do is worth testing. To do that, simply run '' | ||
+ | |||
+ | // Pic | ||
+ | |||
+ | Obviously your system stats will look different than mine do depending on the configuration of your system, but you should see a total virtual memory figure that resembles 16GB (16384MB) of virtual memory, or at least whatever amount of space you decided to give to it. | ||
+ | |||
+ | Also note that if you just ran the '' |