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.
I understand the swap space (even though it could be probably larger, since the plan comes with 4GB of RAM <how large should it be?>) but what is the purpose of the 20GB one?
Regarding the swap partition, it should be as large as needed for your specific workload, general rules are not of much worth.
In your partition scheme you have a 20GB partition for system files (binaries, libraries, configuration files, logs, ...) and a partition for user data called /home. This is done to separate user files from system files, so that you can reinstall the OS without having to backup and restore the user data. Of course that doesn't mean you shouldn't backup the user data before doing system critical changes, but it simplifies many things.
It looks something like this. I am still researching this / looking into it, but what would be all the tmpfs and the devtmpfs. I guess it is temporary file system, but what is this for?
So the 20G one is /dev/root mounted on /
1.8T one is /dev/sda3 mounted on /home
What would be the /dev, /dev/shm, /run, /sys/fs/group, and /run/user/0 ones?
### Edit:
I guess I only care about / (the 20GB one), and /home (1.8T one), and I can increase the size of the swap one, if needed. The other ones are some kind of temporary file systems that are there because of how the system (CentOS7) works...
Last edited by AdultFoundry; 01-07-2016 at 09:21 AM.
tmpfs are used to create filesystems which can be lost when you switch off your host. They are simply stored in RAM because it is much faster than anything else.
/ is used to hold the os itself and /home is for the files of the users.
I will be the only user of this hosting plan. Most of what I will be doing is hosting websites (mostly picture files). The DocumentRoot for Apache web server is /var/www/html, so I guess, based on this /home layout, I will be running it from /home? I mean I can do that, but would I consider changing something with this (file system / partitions, to begin with)? Or just leave it as is?
### Edit:
I guess I will leave it as is and work from this / and /home model, since this is good.
Last edited by AdultFoundry; 01-07-2016 at 09:40 AM.
For more information about the different directories in your Linux system and what their purpose is I recommend to read the Linux Filesystem Hierarchy Standard: https://wiki.linuxfoundation.org/en/FHS
"Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files.
Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.
So, if:
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
S = M *2
Else
S = M + 2
Using this formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap. Creating a large swap space partition can be especially helpful if you plan to upgrade your RAM at a later time.
For systems with really large amounts of RAM (more than 32 GB) you can likely get away with a smaller swap partition (around 1x, or less, of physical RAM)."
I did not do anything to the hosting plan, and I can just reinstall the system. I increased the swap partition to 5926MB / 5.926 GB (based on S=M+2, 4GB RAM -> 6GB swap). I am already installing it with the 20GB / directory. Would it make some kind of sense to increase the size of it too (or change its size)?
Again, those kind of general rules about swap size are bogus and have no real meaning. The size swap should have on your system is solely dependent on your workload. I currently have two systems running totally without swap (one with 4GB, one with 16GB of RAM), and they are running totally fine since their workload never exceeds that amount of physical memory installed.
Having said that, it doesn't matter if you have to much swap, though it will matter if you have not enough, so if you feel safer with adding more swap there is not much wrong with it, especially when using disks that large that a few GB less of usable space don't matter.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.