The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting up partitions

Discussion in 'General Discussion' started by siparker, Aug 20, 2012.

  1. siparker

    siparker Member

    Joined:
    Jun 4, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    i am currently trying to ensure i have partitions setup correctly for a new cpanel server.

    In the past i have had issues on other servers with both /tmp and /rootfs becoming full.

    my hosting provider is ovh and i am using their reinstall option to try and do this.

    the issues i have are that i do not fully understand the linux file system in terms of mount points and partitions.

    I have the following guidelines Advanced Options: Pre-Installation which i have read through but i am really stuck when it comes to making the actual partitions

    so within ovh i created /boot with 250MB of space then / with 40GB of space

    i then added the first folder i know i needed to ahve mounted somewhere other than rootfs which was /usr with 25gb of space

    after this i get a message show up which says

    Code:
    Attention: your partition layout contains 3 primary partitions and you still have free disk space.
    
    The limit of disks allows you to have only 3 or 4 primary partitions and as many logical partitions as you wish. To use all available disk space, you may:
    
        create the last primary partition using all the remaining space
        create as many logical partitions as you wish (subject to disk space)
    So should i be using logic partitions?

    My other question is if i have managed to setup the /usr and /var as seperate partitions do i then need to do something during the cpanel install to make them use this part of the drive rather than the normal path which i think was within /root

    all in all very noob about this so thanks in advance for the advice.
     
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    We recommend putting everything on a single large partition. If you do not create a /tmp partition when you partition the hard drive, cPanel will create a file and mount it as /tmp, and that can be resized later if necessary with no effects on the rest of the hard drive.

    Unless you have very specific needs, we advise not trying to carve up a hard drive into separate /home, /usr, /var, etc. partitions, because it is just impossible to guess what your future needs will be, and it is very easy to outgrow a critical partition with no way of foreseeing this happening.

    If you absolutely must divide up the drive into partitions, logical volume management (LVM) is a good option, because you can resize a logical volume without reformatting it or reformatting the entire hard drive. Your data center or administrator should be able to explain LVM in greater detail and help you configure it.
     
  3. siparker

    siparker Member

    Joined:
    Jun 4, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    i have no reasons at all to make seperate partitions. i assumed it was the done thing as all my previous servers had them.

    Is there a guide to resizing the files if/when they become to small / in danger of being full?

    can i specify the filesizes within cpanel setup?
     
  4. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Partition sizing is done by fdisk, which is part of the operating system and has nothing to do with cPanel. Partitions are sized and formatted before cPanel is ever installed.

    If you look at our installation documentation, you will see that we recommend one swap partition, and one partition for everything else:

    Step 5: Configure Your Operating System

    If your previous servers had many small partitions, it is because your data center or administrator set them up that way before installing cPanel. cPanel does not partition the hard drive or format partitions.

    There is nothing in cPanel for specifying partition sizes, because cPanel does not partition the hard drive. This is all done by fdisk when the operating system is installed, before cPanel ever enters the scene.
     
  5. siparker

    siparker Member

    Joined:
    Jun 4, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Sure i understand that. i was just wondering how the filesizes for the files are dictated. as you mentioned the /var folder will be created if there is not a partition for it. how is this resized if required?

    i did see another version here which said to make other sizes. Advanced Options: Pre-Installation

    i take it that is for advan ed users (i am not) and i dont require any of that additional partitioning.

    yes i understand that. i am just wanting to ensure i know what i am doign as i ahve had about 10 - 15 different issues now because of /tmp or /rootfs filling up and causing the server to stop working correctly.

    What i meant to ask was after i have partitioned the hard drive in whatever way seems best (for example / and swap file) you said that cpanel will then create a file and mount it as /tmp

    How do i resize this if it is too small? can i dictate what this file size will be anywhere?
     
  6. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    No, cPanel will create a file for the /tmp directory, not /var, and mount it as a partition.

    The file that is mounted as /tmp is created by /scripts/securetmp. The size is specified in that file. By default, it is 512 MB, which should be more than large enough for most servers.

    Remember that /tmp is used for small, transient files that typically do not last very long. A notable case is session cookies used by site scripts. They are very small, and should be deleted after a session ends. Let cPanel create the default size when it installs. You can resize it later if it proves to be too small, but that is an unusual case.

    The following describes how to use /scripts/securetmp to make a new /tmp:

    http://forums.cpanel.net/f5/problem-tmp-partition-76122.html

    If you want to resize /tmp, alter the value of my $tmpdsksize in /scripts/securetmp before you run it. However, again, we have seen that the default size is more than adequate on most servers, and I strongly disadvise trying to alter this on a new installation. If /tmp fills up, the best fix is to fix what is filling it up so that it stops happening, not try to resize it.
     
  7. siparker

    siparker Member

    Joined:
    Jun 4, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    ok. sorry i had meant tmp not var sorry about that

    so the server i have has 2x3tb hdd in raid so the resulting space is 3tb

    do i just have the swap file and then the whole of the rest of the hdd space as /

    it details 40gb in the guide which was obviously a while ago now

    im keen to get this right now as i lost a hdd on the other server tonight and am having issues with another one because of some disk error which keeps happening
     
  8. siparker

    siparker Member

    Joined:
    Jun 4, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    so i created one partition of 2tb a 28gb swap and used the remainder as a secondary partition i was thinking of using for backups as i head read somewhere backing up to the same drive can cause performance issues

    i now have the following fromt he server status is it all ok from what you can see

    Filesystem Size Used Avail Use% Mounted on
    rootfs 1.8T 3.7G 1.7T 1% /
    /dev/root 1.8T 3.7G 1.7T 1% /
    none 12G 192K 12G 1% /dev
    /dev/sda3 942G 200M 895G 1% /backup
    tmpfs 12G 0 12G 0% /dev/shm
    /dev/loop0 485M 13M 447M 3% /tmp
    /dev/loop0 485M 13M 447M 3% /var/tmp
    /dev/root 1.8T 3.7G 1.7T 1% /var/named/chroot/var/run/dbus
     
  9. siparker

    siparker Member

    Joined:
    Jun 4, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    any feedback pls
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I strongly disagree with the idea that /tmp at 500MB is sufficient size for a machine that is larger than a VPS machine, and even then I'm not sure even a small machine shouldn't have at least a 2GB /tmp folder. Your machine is substantially bigger than a small server, since the drive is around 2TB large. You will most assuredly need a larger /tmp directory than our default.

    The biggest issue it that MySQL's MyISAM tables write temporary table data to /tmp and will hang if it fills up. This then logs to /var/lib/mysql/hostname.err (where hostname is the fully qualified hostname) as "Incorrect key file" entries. This is discussed at this location:

    http://forums.cpanel.net/f5/drive-critical-dev-loop0-var-tmp-97-full-190772.html#post799162

    Resizing /tmp is discussed at this location:

    http://forums.cpanel.net/f5/drive-critical-dev-loop0-var-tmp-97-full-190772.html#post782021

    If you end up using EAccelerator with FCGI or DSO PHP handler on the machine for PHP OPCode Caching, it will also write the cache files by default to /tmp, filling it up.

    We have many forum threads and tickets over this MySQL issue and over /tmp being too small. MySQL quits working as do websites unable to write session data when /tmp fills up, so it isn't a small issue either.
     
Loading...

Share This Page