LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 12-01-2016, 01:59 PM   #16
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402

I'm with 273 - no swap partition, set up a swap file. You can still hibernate with a swap file, but if you decide to ditch it, it's easier done than repartitioning.

Also, add a file to /etc/sysctl.d such as 51-swap.conf or add the following to sysctl.conf if your distribution uses that instead:

Code:
vm.swappiness = 1
this will tell the kernel to swap as least often as possible.
 
Old 12-01-2016, 02:07 PM   #17
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I should point out my recomendation is based upon my having 32GB of RAM and never managing to flood it but, when I had 16GB, I did run a browser vulnerability which used it all.
So, I run without swap as I think it a 20th century nonsense but, were I less contrary, I'd perhaps have a small file to give warning.
 
Old 12-01-2016, 02:07 PM   #18
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by CarpCharacin View Post
How big should I make it? I am not sure so that is why I am asking here.
In the 1 week since you originally asked this question, have you considered simply taking an hour or two to read the Arch Linux Installation Guide (instead of soliciting dubious advice from random internet strangers)?

Quote:
There are no strict rules for partitioning a hard drive... Single root partition... is the simplest and should be enough for most use cases... It usually makes sense to start by considering a single / partition
That is the official advice of the Arch team... However...

Quote:
Originally Posted by CarpCharacin View Post
How big would a distro like ubuntu or debian make the swap partition for 64gb of ram?
If you don't trust the advice of the Arch team, and would prefer to follow Ubuntu or Debian's advice, you can read more here:

https://help.ubuntu.com/community/SwapFaq
https://wiki.debian.org/Swap

Last edited by snowday; 12-01-2016 at 02:41 PM.
 
1 members found this post helpful.
Old 12-01-2016, 07:47 PM   #19
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
But what if I click hibernate and there is no swap partition? I do not plan to reinstall the OS ever. Arch is a rolling release distro and that is one of the main reasons I am going with it. I am going to build a NAS and I will be storing most of my files there. So the arch team says to not have a swap partition?
 
Old 12-01-2016, 07:47 PM   #20
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by goumba View Post
I'm with 273 - no swap partition, set up a swap file. You can still hibernate with a swap file, but if you decide to ditch it, it's easier done than repartitioning.

Also, add a file to /etc/sysctl.d such as 51-swap.conf or add the following to sysctl.conf if your distribution uses that instead:

Code:
vm.swappiness = 1
this will tell the kernel to swap as least often as possible.
You have 273 GB of ram? What do you need all that ram for?
 
Old 12-02-2016, 08:13 AM   #21
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by CarpCharacin View Post
So the arch team says to not have a swap partition?
In the words of Team Arch: "There are no strict rules for partitioning a hard drive." There are situations where you might want to use a swap partition, and other situations where it is perfectly okay not to use a swap partition. Like Jjanel commented, your question is like asking: "how should I design my new house?"

You might want to take a few minutes and read the Arch Wiki Swap page, now that you are into Week 2 of your project: https://wiki.archlinux.org/index.php/swap
 
Old 12-02-2016, 01:27 PM   #22
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by CarpCharacin View Post
But what if I click hibernate and there is no swap partition? I do not plan to reinstall the OS ever. Arch is a rolling release distro and that is one of the main reasons I am going with it. I am going to build a NAS and I will be storing most of my files there. So the arch team says to not have a swap partition?
If you try to hibernate without swap it will fail, gracefully from what I recall. If you decide you want to hobernate then create a 64GB file and mount it as swap before you do -- it's that quick and easy (I know, I've done it) though hibernate can be troublesome under Linux (as it can under Windows).
 
Old 12-02-2016, 04:48 PM   #23
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
I did read the swap page and it said that it is just reccomended for users with less than 1gb of ram. I have 64gb of ram.
 
1 members found this post helpful.
Old 12-14-2016, 01:46 PM   #24
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
So should I do no swap or 4gb of swap?
 
Old 12-14-2016, 02:49 PM   #25
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
I actually may go with ubuntu gnome instead because of the package manager.

EDIT: I have decided that I am going with arch after all. So would a 4gb swap partition be ok?

Last edited by CarpCharacin; 12-14-2016 at 03:30 PM.
 
Old 12-14-2016, 06:51 PM   #26
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I didn't exactly get this.

"there is no swap partition? I do not plan to reinstall the OS ever."

Swap isn't terrible. Having it is better than not in many cases. How bad it might affect a ssd is unknown. I feel ssd's are still subject to failing like the many LED bulbs I have replaced before 20 years claimed.

You could install a small mechanical drive just for swap and even consider using it for backups.
 
Old 12-14-2016, 06:59 PM   #27
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
Wait, so swap partitions are bad for SSDs?
 
Old 12-14-2016, 07:24 PM   #28
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by CarpCharacin View Post
Wait, so swap partitions are bad for SSDs?
Says who? We use SSD's as write cache and ZFS zil/log drives just fine.

Swap should be no different and is usually less intensive than write cache.
 
Old 12-14-2016, 07:39 PM   #29
CarpCharacin
LQ Newbie
 
Registered: Nov 2016
Location: Salt Lake City, UT
Posts: 25

Original Poster
Rep: Reputation: Disabled
I don't want my SSD to fail.
 
Old 12-15-2016, 12:48 AM   #30
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by CarpCharacin View Post
So should I do no swap or 4gb of swap?
In my opinion having 4GB of swap when you have 64GB of RAM is pointless as if you're in a position to use swap then you've probably got a memory leak or something similar to worry about and 4GB won't give you that much help over the 64GB.
As I mentioned if you do want to hedge your bets then set up a swap file, of whichever size you see fit, then run the system with "typical high" workloads and see for yourself whether you get any benefits.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Partitioning and Using SSD with Slackware rshepard Slackware 10 01-09-2014 02:14 PM
SSD Partitioning OpenSuse 13.1 cxiii SUSE / openSUSE 6 12-11-2013 05:47 PM
SSD partitioning for fedora 19 distro justin thyme Linux - Hardware 5 11-18-2013 07:31 AM
SSD partitioning aloisius-a Linux - Hardware 4 02-18-2011 01:34 AM
SSD File System Partitioning jaycee4 Linux - Newbie 7 09-18-2009 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration