The part that makes my answer work through server reboots is the writing to /etc/fstab file. Many solutions were discussed but I can't seem to find one that will persists across server reboots Tools.SafeExec("fallocate", String.Format("-l ", file.FullName))) Tools.BailIfNotSudoer("Need to use 'fallocate' to create swap file")Ĭonsole.WriteLine("Creating swap file.") Let swapFile = new FileInfo(Path.Combine("/", "swapfile")) ![]() Let _,output,_ = Tools.SafeHiddenExec("swapon", "-s") Let isThereSwapMemoryInTheSystem (): bool = It's so simple that I've even written a script for it (at least for the best part, not yet the swappiness settings and other advanced stuff): #!/usr/bin/env fsharpi But suddenly I remembered a very straightforward article in DigitalOcean's blog: I was also in need for this (actually 16.04 instead of 14.04, but my answer will apply to both I think).īut when I saw I had to read so long essays that you point out, I was going to give up. ![]() I would like to create a swap using existing VM storage, instead of create a new disk using additional storage I have a default Ubuntu 14.04 LTS VM created by and running on Azure, which doesn't come with a swapĢ. I have read quite a few posts on this, but I am still unsure about the correct approach, assuming:ġ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |