2

I am going to be running a web server using Debian which has 2 x 4 TB (8 TB total) drives in RAID 1. This server will be used for running websites, email and file storage.

From doing my research I am still really confused on how to setup my partitions, I really want to get it right before I continue. But all the past posts about this are like 7 years old.

I would prefer to have /boot and swap on their own partitions, then just have one big partition for the rest. I've read about /tmp /var/log all filling up and going wild... is this still something I should worry about?

I have heard of LVM but I don't like the idea of having to keep allocating drive space when needed, I would rather have all my HDD space available from the start and not have to worry about allocating new space at some point in the future.

For now I currently went with this:

PART swap swap 8G
PART /boot ext3 800M
PART / ext4 all

I'm not sure if this is a good setup for my server, am I "partitioning myself into a corner"?

Is there anyway in which I can restrict folders such as /tmp and /var/log without setting size limits with partitions?

1234567
  • 173
  • 1
  • 10
Buckket5
  • 73
  • 2
  • 8
  • 1
    You should research deeper into the technologies and understand them instead of just asking others for answers. There's absolutely no need to 'keep allocated drive space when needed'. Allocate whatever you want wherever you want, then resize accordingly when needed. It can make logical volumes smaller too, not just increase them. –  Feb 03 '17 at 23:44
  • 1
    I disagree. OP wants to build a web server and learn the tech while building. OP doesn't want to do it on a bad foundation, so getting partition semi-right before getting much deeper is a good idea. OP did some reading but didn't find satisfying answers. – Dylan Martin Feb 03 '17 at 23:57
  • 2
    `I have heard of LVM but I don't like the idea of having to keep allocating` -If you are certain that you know how you will be using the system over the entire lifetime of the system, that is fine. But the entire point of LVM and filesystems like zfs is that they give you flexibility to adjust your partitions as needed when and if your assumptions change in the future. The entire point is to let people start with some kind of simple partitions, then make things more complicated as needed. – Zoredache Feb 03 '17 at 23:59
  • 2
    @yoonix From your profile "I give up. ServerFault has been overrun by idiots and people that bought their first Ubuntu VPS an hour ago." well stay away from posts like these, you are not helpful and if these types of posts are already answered correctly without wasteful comments like yours, there would be less of these posts, enabling people like me to find current information on the topic rather than looking at 7 year old posts. – Buckket5 Feb 03 '17 at 23:59
  • @gofoques sorry but I'm going to disagree with you. This site is for managing systems in a business capacity. One doing so should already have a base foundation of knowledge instead of just asking others 'how do I?'. These questions shouldn't be here in the first place. This is not a site for learners trying to grasp the basics. –  Feb 04 '17 at 04:39

1 Answers1

2

Here's what I would suggest.

  • Don't worry about how much swap. Sure, have some, like 1G. More importantly, never ever let your box need to use swap. If it does, your server is going to grind to a near halt, and your users will tar and feather you.
  • You're going to want a separate partition for your web server logs (eg /var/log/httpd) so if it fills all the way up, your whole server doesn't puke.
  • Use LVM and leave a fair amount of space unallocated. Your reluctance to use LVM is probably misguided. Then you can allocate that space later. EG more to /home if you have greedy users, more to /var/log or /var/log/httpd if you want to keep lots of logs, etc... It's generally better to leave space unallocated than rely on your long-term predictions. Make your predictions, and allocate space, for sure, but try to keep some in reserve.
  • (this is more philophical than practical) Follow the middle path between planning and reacting. Your ability to predict your future needs will never be very good. Plan as well as you can, but keep as much flexibility as possible. LVM lets you do this.
Dylan Martin
  • 548
  • 4
  • 14
  • The comment "leave as much space unallocated as you can", is both good and bad advice. Personally I try to allocate reasonable amounts of data, and leave myself some breathing room. For example if I have 4TB to play with, but only need 10GB right now, I'll still allocate 2-3TB. You don't want to keep resizing volumes every day. Leave some space for emergencies though. LVM is very useful to let you expand partitions later, especially if you end up swapping your physical disk for larger ones later, or adding additional disks. – KHobbits Feb 04 '17 at 02:20
  • Using separate partitions for things like /var/log can cause problems too. In the past badly sized volumes have done more harm than good. For example on a webserver with 400gb hdd, I figured 20gb would be enough for /var/log, and allocated the rest for root. Turns out the way the developer wrote the code for the web apps, the sites only use 20gb of space, but generate 10gb logs each month. While my assumptions were fine at the time, 2 years on, they caused more problems, and I ended up resizing the partitions and giving half the disk to logs (even with logrotate). – KHobbits Feb 04 '17 at 02:24
  • I agree about the "leave as much space unallocated as you can" statement. I've changed it. I think it's better to leave space unallocated against and uncertain future, rather than pre-allocate it based on a prediction. Your /var/log example illustrates this perfectly. – Dylan Martin Feb 06 '17 at 20:11