Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How to partition a web server

  1. #1
    Join Date
    Nov 2006
    Beans
    197

    How to partition a web server

    How would you go about partitioning a web server? I have 500 GB.

    Would you create an lvm? Yes or no?

    Thank you.

  2. #2
    Join Date
    Oct 2007
    Beans
    338

    Re: How to partition a web server

    I googled this also use it
    LVM is suitable for:
    Managing large hard disk farms by letting you add disks, replace disks, copy and share contents from one disk to another without disrupting service (hot swapping).
    On small systems (like a desktop at home), instead of having to estimate at installation time how big a partition might need to be in the future, LVM allows you to resize your disk partitions easily as needed.
    Making backups by taking "snapshots".

  3. #3
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to partition a web server

    On my home file/media/web server, I set up / to be 20GiB, /home at 100GiB on a 120GiB hard drive. for data I have:

    • 2 X 500Gib
    • 2 X 400gib
    • 1 X 1TiB


    I gave / 20GiB, as thats all I figured I needed for mysql and mediawiki, /home is for family members to store personal files.

  4. #4
    Join Date
    Dec 2012
    Beans
    9

    Re: How to partition a web server

    Quote Originally Posted by fernandoch View Post
    How would you go about partitioning a web server? I have 500 GB.

    Would you create an lvm? Yes or no?

    Thank you.
    is this for home, small business or med scale company.
    500gb is not really a lot for a lvm , depending of course from the hardw. that you have.
    i'd put "home", "var" end "etc" outside the "/" partition. to make backup, log-tmp files cleanup, reconfig easier . it's easier to create an image of a server when the etc folder is not present, even when the server is live. And also it makes it much easier to upgrade the hhds , You can easiel add more swap memory if you can handle more RAM and so on.
    Last edited by HomelandSecurity; December 31st, 2012 at 09:03 AM.

  5. #5
    Join Date
    May 2006
    Location
    Boston
    Beans
    1,918
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to partition a web server

    Quote Originally Posted by HomelandSecurity View Post
    is this for home, small business or med scale company.
    500gb is not really a lot for a lvm , depending of course from the hardw. that you have.
    i'd put "home", "var" end "etc" outside the "/" partition. to make backup, log-tmp files cleanup, reconfig easier . it's easier to create an image of a server when the etc folder is not present, even when the server is live. And also it makes it much easier to upgrade the hhds , You can easiel add more swap memory if you can handle more RAM and so on.
    +1 (I agree with myself)

    blog
    Donations BTC : 12FwoB7uAM5FnweykpR1AEEDVFaTLTYFkS
    DOUBLEPLUSGOOD!!

  6. #6
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: How to partition a web server

    I'd definitely recommend going for LVM, it makes everything much easier down the line.

    I'd create a 100MB boot partition and put all the remaining space into a volume group.
    I'd then create a 20GB root logical volume, a 50GB /var volume and then a further logical volume to mount as /var/www and make it as large as you think you will need. Any unused space would become a last LV for /home.
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  7. #7
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to partition a web server

    Quote Originally Posted by spynappels View Post
    I'd definitely recommend going for LVM, it makes everything much easier down the line.

    I'd create a 100MB boot partition and put all the remaining space into a volume group.
    I'd then create a 20GB root logical volume, a 50GB /var volume and then a further logical volume to mount as /var/www and make it as large as you think you will need. Any unused space would become a last LV for /home.
    Wouldn't it be much better to start the LVs with as small size as possible (depending what you need for the start), and then grow them as needed from the unused VG space?

    If I'm not mistaken, you can grow the LV and the filesystem online, but you can shrink only the LV online. You need to shrink the filesystem offline. Which means you need to shut down to shrink because shrinking the LV without the filesystem first is pointless and dangerous.

    Isn't the point of LVM to start small and grow as needed, instead of assigning the whole VG to LVs right away at the start? Later if you want to reassign part of the space to another LV it's more difficult (but not impossible).
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  8. #8
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: How to partition a web server

    Quote Originally Posted by darkod View Post
    Wouldn't it be much better to start the LVs with as small size as possible (depending what you need for the start), and then grow them as needed from the unused VG space?

    If I'm not mistaken, you can grow the LV and the filesystem online, but you can shrink only the LV online. You need to shrink the filesystem offline. Which means you need to shut down to shrink because shrinking the LV without the filesystem first is pointless and dangerous.

    Isn't the point of LVM to start small and grow as needed, instead of assigning the whole VG to LVs right away at the start? Later if you want to reassign part of the space to another LV it's more difficult (but not impossible).
    That's a good point, I was thinking in terms of the disk size now being fully available and the VG being extended by the addition of further PVs when required, which was why I said to create the /var/www LV as large as was required, with the option of growing when the VG was enlarged by adding extra PVs (HDDs).

    The OP would need to host an extremely large number of websites with large databases for the disk to fill, and /home does tend to fill up rather more quickly.

    But yes, you could (should) probably start small and grow as required.
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  9. #9
    Join Date
    Nov 2006
    Beans
    197

    Re: How to partition a web server

    Thank you guys.

    And why not / 498 GB and swap 2 GB?

  10. #10
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How to partition a web server

    Quote Originally Posted by fernandoch View Post
    Thank you guys.

    And why not / 498 GB and swap 2 GB?
    One simple reason yet compelling enough is if you have a run away log file you could fill up your root partition.

    If you / partition fills up, your system will become unstable and likely unresponsive to most commands.

    A second compelling reason for creating separate partitions is for upgrades or re-installations. If you have your data on separate partitions from /, you can reinstall without overwriting/formatting your user data.

    You may think with ~500gigs it may take a long time before a run away log file fills the drive, I'd say time is relative

    I'm sure you could install as you mention and likely have no issues.

    If this project is for learning server admin, then I'd say go for lvm with small partitions for key mount points. If this is just to get the server up as quick as possible then by all means partition like you mention, / and /swap.


    Here are some responses
    to your question.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •