LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   What are recommended sizes for partitions and swap during install? (http://www.linuxquestions.org/questions/slackware-14/what-are-recommended-sizes-for-partitions-and-swap-during-install-4175489166/)

74razor 12-25-2013 06:55 PM

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.

jefro 12-25-2013 06:56 PM

Do you really NEED those?

How much ram do you have? What are you running, 32 or 64 bit OS?

hitest 12-25-2013 07:10 PM

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.

74razor 12-25-2013 07:15 PM

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.

ericson007 12-25-2013 07:29 PM

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.

jtsn 12-25-2013 07:32 PM

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.

74razor 12-25-2013 07:39 PM

Ok, well that makes sense. I can work with that. However, what is the recommended swap size? Is there a formula?

jtsn 12-25-2013 07:45 PM

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.

mlslk31 12-25-2013 07:46 PM

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.

273 12-25-2013 07:56 PM

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.

jtsn 12-25-2013 07:56 PM

Quote:

Originally Posted by mlslk31 (Post 5086946)
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.

273 12-25-2013 08:00 PM

Quote:

Originally Posted by jtsn (Post 5086951)
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)

jtsn 12-25-2013 08:04 PM

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.

273 12-25-2013 08:17 PM

Thanks for the clarification, since I don't have swap I feel better using tmpfs.

mlslk31 12-25-2013 08:18 PM

Quote:

Originally Posted by jtsn (Post 5086951)
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 08:13 PM.