Swap file ? - Printable Version +- Linux Lite Forums (https://www.freecinema2022.gq/forums) +-- Forum: Software - Support (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=5) +--- Forum: Installing Linux Lite (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=17) +--- Thread: Swap file ? (/showthread.php?tid=6504) |
Swap file ? - arky217 - 10-09-2019 When Linux Lite is installed, does it automatically create a swap file ? And if so, what size is it and where is it located ? Re: Swap file ? - minesheep - 10-09-2019 By default swap file is located on "/" (filesystem root). The default size is maxed at 5% of free disk space (when creating = installing) or 2GB. You can see your total swap space size with htop (it is a command line tool). Swap space creation https://linuxize.com/post/create-a-linux-swap-file/ Re: Swap file ? - Moltke - 10-09-2019 (10-09-2019, 04:04 PM)arky217 link Wrote: When Linux Lite is installed, does it automatically create a swap file ? When installing any Linux OS it creates a "swap space", to substitute disk space for RAM memory when real RAM fills up and more space is needed. The swap space can either be a "swap file" or a "swap partition". Linux Lite, as well as most modern distros does not create a swap file but a swap partition by default which size is usually 2gb. Users can and does create swap files for different purposes under different conditions to meet certain criteria or specific needs. To know a bit more read here: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/deployment_guide/ch-swapspace Hope this helps! Re: Swap file ? - arky217 - 10-10-2019 Well, using Gparted, I see that I have no swap partition. And I also have no swap file, because when I do a 'sudo swapon --show', it returns nothing, and when I do a 'sudo free -h', it shows swap: 0B So, after thinking about it, I believe that I know what happened. I originally installed Peppermint on this drive and before installing Peppermint, I created a swap partition of 12GB (I have 12GB of ram). Then later, I installed MX Linux along side of Peppermint. Then even later, I installed Linux Lite 4.4 along side of both of them. Well, after using Linux Lite for a while, I decided to make it my daily driver, so I deleted the MX Linux and Peppermint partitions and I also deleted the swap partition. The reason that I deleted the swap partition is because I had later read that Ubuntu 18.04 and its derivatives (such as Peppermint & Lite) automatically create a swap file upon installation. But, I'm guessing that when I originally installed Peppermint, that no swap file was created because I had already created a swap partition. (I'm guessing here) So, when I deleted the Peppermint, MX Linux, and the swap partitions and added their space to the Linux Lite partition, that is why I now have no swap file. In fact, after I did that, Lite took several minutes to boot up. I found out that the reason why is that it was looking for the swap partition that it was using before I deleted it. And after I edited a file (don't remember which just now), to stop Lite from trying to find that swap partition, it then booted normally. So, I said all that to say this: With 12GB of ram, do I even really need a swap file or partition ? (I have never seen my ram usage even come close to 4GB) If I should make a swap file, what commands do I need to do to create it and what size should I make it ? (I have 12GB ram and my drive is a 120GB SSD) Thanks for any and all replies. Re: Swap file ? - Moltke - 10-10-2019 Quote:With 12GB of ram, do I even really need a swap file or partition ? I think not. I don't know what you do with your pc but since you've already said it barely come close to 4gb, it's unlikely that it run out of RAM. So, I don't think you need to worry about not having a swap partition/file. Re: Swap file ? - MS - 10-10-2019 To make swap file, this is the drill that works for me - I copied these instructions from a popular website, most probably the AskUbuntu, do not remember the exact location though: Quote:From Ubuntu 18.04 onwards, a swapfile rather than a dedicated swap partition is used. The swap file is named "swapfile". To change the size of this swap file: EDIT: Generally it is better to have at least some swap space than none, albeit with tight hard drive, I know it could be painful, myself I have a 256GB SSD, with swap matching 75% of the RAM, only due to playing with V-Box every now and then in high RAM consumption. Otherwise than that, also in your case, maybe 25% of the RAM could suffice. Basic recommendation is 150~200% of RAM to be assigned, but as you see, it depends. |