Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
12-25-2013, 07:55 PM
|
#1
|
Member
Registered: Dec 2012
Posts: 39
Rep: 
|
What are recommended sizes for partitions and swap during install?
Just curious, I plan on making a swap partition and /, /home, and /var on separate partitions. I've went through the wiki but I don't see much as far as recommended sizes. I have a 160 GB SSD.
Thank you for any input.
|
|
|
12-25-2013, 07:56 PM
|
#2
|
Moderator
Registered: Mar 2008
Posts: 22,290
|
Do you really NEED those?
How much ram do you have? What are you running, 32 or 64 bit OS?
|
|
|
12-25-2013, 08:10 PM
|
#3
|
Guru
Registered: Mar 2004
Location: Canada
Distribution: Slackware, Void, Debian, Ubuntu
Posts: 7,445
|
For Slack all you really need is swap and root. If you want to keep data between installations you could have a separate /home partition.
|
|
|
12-25-2013, 08:15 PM
|
#4
|
Member
Registered: Dec 2012
Posts: 39
Original Poster
Rep: 
|
Those are the recommended partitions according to the Slackware wiki. I like doing best practice so I was going to move forward with those partitions. Yea, I probably could just use / and that is it I suppose.
I have 8GB RAM and it is a 64 bit processor.
|
|
|
12-25-2013, 08:29 PM
|
#5
|
Member
Registered: Sep 2004
Location: Japan
Distribution: RHEL9.4
Posts: 735
Rep: 
|
I also like to keep things seperate.
I usually split up root /var /var/log /webroot /home and /usr
I give each ample space but have run out of space a few times. Lvm is great for that sort of thing. I leave aroung 100gigs free on lvm and then later i can just make a volume needing more space bigger with lvexpand. Not the perfect solution to provide consecutive disk areas but it works pretty nicely. Without having to destroy and recreate partitions.
|
|
|
12-25-2013, 08:32 PM
|
#6
|
Member
Registered: Sep 2011
Posts: 925
|
On traditional Unix, you separate /, /tmp, /var and /usr (with /opt symlinked to /usr/opt and /home to /usr/home). In this scenario, / and /tmp are of fixed size (few GB), /var is sized to what the specific system needs and /usr gets the rest.
On Linux you may be fine with just / and /home, with / "big enough" and /home for the remainder.
At least /home should be separate so a user filling his $HOME can not kill the whole system.
Last edited by jtsn; 12-25-2013 at 08:40 PM.
|
|
|
12-25-2013, 08:39 PM
|
#7
|
Member
Registered: Dec 2012
Posts: 39
Original Poster
Rep: 
|
Ok, well that makes sense. I can work with that. However, what is the recommended swap size? Is there a formula?
|
|
|
12-25-2013, 08:45 PM
|
#8
|
Member
Registered: Sep 2011
Posts: 925
|
Swap size should be between RAM size and 2x RAM size. It can be used by swap-backed temporary filesystems (like tmpfs for /tmp) and Suspend to Disk, so RAM size is a good minimum while more than 2x RAM size doesn't make sense on most installations.
Using tmpfs is recommended with SSDs.
Last edited by jtsn; 12-25-2013 at 08:46 PM.
|
|
|
12-25-2013, 08:46 PM
|
#9
|
Member
Registered: Mar 2013
Location: Florida, USA
Distribution: Slackware, FreeBSD
Posts: 210
Rep:
|
Traditional swap is 2.5 * RAM. That stated, if my older PCs get to 1 * RAM in swap, I'm probably in some trouble. I use 1.5 * RAM, and if I need more, I do something like this:
Code:
dd if=/dev/zero of=testfile bs=1024k count=1024
mkswap testfile
swapon testfile
As for the partitions, it's what you want to do with it. At work, I keep separate /tmp and /home partitions. At home, I keep an encrypted /home and separate /var. If you're new, you can start with just / and swap. The people who get deep into the separate /var idea tend to cite things like mail spools for university-sized mail servers. I don't have such a server, so I keep a separate /var, use /var/src for source code, just so there's no fragmentation issues when I install things to /usr.
Last edited by mlslk31; 12-25-2013 at 09:00 PM.
Reason: forgot mkswap line
|
|
|
12-25-2013, 08:56 PM
|
#10
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
For swap I think it depends on what you want to use the machine for. If you're only doing "normal desktop things" then filling 8GB of RAM ought not to happen very often so you could almost do without swap. However, that does mean that should you run out of RAM you will start to see processes killed (as I understand it). You also need at least as much swap as RAM for hibernate to work as it saves the contents of RAM to the swap partition (or file) before powering down.
I asked about the size of the root partition for Slackware myself on here and was told 15GB is more than enough for a full install plus a decent number of additional applications. I see no reason to doubt that.
|
|
1 members found this post helpful.
|
12-25-2013, 08:56 PM
|
#11
|
Member
Registered: Sep 2011
Posts: 925
|
Quote:
Originally Posted by mlslk31
The people who get deep into the separate /var idea tend to cite things like mail spools for university-sized mail servers. I don't have such a server, so I keep a separate /var, use /var/src for source code, just so there's no fragmentation issues when I install things to /usr.
|
The separation of /var is mainly for performance reasons. Still makes sense on a SSD: You mount every partition with "discard" (for TRIM support) except /var, which gets fstrim(8) on a cron schedule. You can also mount /tmp as tmpfs to completely keep the writes away from the SSD.
Quote:
use /var/src for source code, just so there's no fragmentation issues when I install things to /usr.
|
Modern Linux filesystems (even ext2/ext4) don't have any issues with fragmentation.
|
|
|
12-25-2013, 09:00 PM
|
#12
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
Quote:
Originally Posted by jtsn
You can also mount /tmp as tmpfs to completely keep the writes away from the SSD.
|
But if you have swap then, surely, you are using disk for this? Besides, I thought that tmpfs was disk and RAM and you need to specify ramfs for RAM only? (I do use tmpfs myself in my fstab because I've never got ramfs to work)
|
|
|
12-25-2013, 09:04 PM
|
#13
|
Member
Registered: Sep 2011
Posts: 925
|
Tmpfs uses RAM and reverts back to swap, if RAM gets low (using swap as backing store). Ramfs isn't recommended, there is no size limit and writing to a ramfs can fill up the complete memory (swap can't be used) and crash the machine.
Last edited by jtsn; 12-25-2013 at 09:08 PM.
|
|
|
12-25-2013, 09:17 PM
|
#14
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
Thanks for the clarification, since I don't have swap I feel better using tmpfs.
|
|
|
12-25-2013, 09:18 PM
|
#15
|
Member
Registered: Mar 2013
Location: Florida, USA
Distribution: Slackware, FreeBSD
Posts: 210
Rep:
|
Quote:
Originally Posted by jtsn
Modern Linux filesystems (even ext2/ext4) don't have any issues with fragmentation.
|
They're still there, just not as obvious as it is on Windows. After a while, though, a speed gain can still be had from doing a backup/zero/format/restore cycle. That "while" can be a year or more, though, if I manage major deletes responsibly. Some filesystems (XFS, ext4, and btrfs) have defragmentation tools, but some filesystems (JFS, NILFS2, F2FS, and some more) don't have defragmentation tools. It's something to think about when planning partitions.
Note that I don't have an SSD to my name, and I don't know how they deal with such issues.
|
|
|
All times are GMT -5. The time now is 06:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|