Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
Hello all, I have been going the installation of hardened and encrypted Alpine Linux. There is a question I have. I like to break everything up into logical volumes to keep things flexible, but one issue I always have is figuring out sizes. For example I usually give swap 4 GB, root 70 GB and home the rest, etc. My question is this, I am looking to do something like having everything I can on their own LV. What is a good way to size the partitions? For example swap being 4 GB (or even 512M) on modern hardware is good, even though we use to do x2 RAM. Is there a good gage fro root, var, share etc? Thanks!
For example swap being 4 GB (or even 512M) on modern hardware is good, even though we use to do x2 RAM.
The size of swap depends on the size of the programs you run on the computer. I would not bother setting up swap space as small as this.
Quote:
Is there a good gage fro root, var, share etc? Thanks!
Again, this depends on the needs of the applications. How large are the databases you will be using? Are you running a web site? Are you using the computer as a server for anything? Then you should have an idea of the space requirements.
If you don’t, use the default setup.
EDIT:
Quote:
I like to break everything up into logical volumes to keep things flexible.
I don’t see how fragmenting your filesystem into small pieces adds flexbility.
Last edited by berndbausch; 05-25-2019 at 06:08 PM.
Regarding /swap, a crucial bit of information is missing. How much RAM does this machine have?
I think 70GB for root is too high. I normally give root 25GB to 30GB, /swap the indicated amount based on my personal formula, and /home the rest. I seldom more that 60% usage or /.
My personal formula for /swap is this: If I have less than 8GB RAM, swap = RAM. If it's 8GB RAM or more, I give /swap 4GB. (I do not hibernate.)
Breaking up things only makes sense if each is it's own physical device. And sense in that it having it's own device does not negatively impact the performance of the others. Like swap, /tmp, /var/log/, /home/, and whatever applies depending on what the computer is doing. Where volumes would be taking multiple devices and making them one filesystem across a bunch of disks. Or across one disk, so you can add a bunch of disks later. If you're not doing anything fancy, you're fairly safe going with system defaults IMO. Having 2x RAM if you suspend or hibernate is a need I suppose. But things boot fast enough these days I just turn them off. When I last used actual swap and not swap files on low ram systems. It was to accommodate media types that were read-only and encrypted, like DVDs. So the unencrypted version could be extracted to swap (if only in theory, probably didn't work that way). Of course back when swap was necessary, it was on spinning rust and often placed near the center of the spinning rust. In that way the read heads were at worst 50% of the way away from getting to swap. A practice that doesn't make sense on most modern storage devices. And even if it did make sense, why not give it it's own device. Storage is cheap these days.
Use a swapfile so you can increase it's size later on if necessary. I personally only run a 2gb swap. It's never been touched. No sense wasting more space than needed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.