Partitioning or Ideal Slice size

rndinit0

Verified User
Joined
Jan 15, 2005
Messages
98
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 248M 59M 169M 26% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad0s1e 248M 30K 228M 0% /tmp
/dev/ad0s1f 178G 2.1G 161G 1% /usr
/dev/ad0s1d 248M 29M 199M 13% /var
procfs 4.0K 4.0K 0B 100% /proc
linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc

Well I managed to install DA without any problems.
I asked my hosts tech to optimize the partition scheme for direct admin (they are a da reseller or partner) And I figured that they would know whats best for DA.

I WAS HORRIBLY WRONG.

I have a 249mb /var slice. Great... I understand DA keeps users emails in that slice. So ... not a good idea.

How did you guys set up your slices ?

I was thinking /var should be at least 10gb but then i realized well what if i host like 100 + domains

each domain should be able to store at least 1gb of mail

Any feedback is appreciated.
 
Looks like they used auto partitioning on your server, you could potentially fix yourself but I would ask them to start again.

I would reccomend this.

/ - 256meg
/tmp - 512meg
/var - 2 gig or more
swap 2x the amount of ram so if 1 gig ram set swap to 2 gig
then the rest on /usr
 
I'd make at least 10 Gig for /var.

And I did want to add a clarification that this works for BSD because /home is a link to /usr/home.

Jeff
 
You could try to back it up then move it to /usr/var and then link /usr/var to /var.

1. tar cvfp /usr/var-backup.tar /var
If the backup does get stuck just let it run for a while then hit ctrl+c. It may be attempting to backup files still open and sometimes gives errors or just sits there.

2. umount -f /var

3. mkdir /usr/var

4. rm -rf /var

5. ln -s /usr/var /var

6. tar xvf /usr/var-backup.tar -C /usr
Its ok it will untar into /usr/var

7. Edit /etc/fstab and put a # infront of the line containing your old var partition.

/dev/ad0s1d 248M 29M 199M 13% /var

8. Everything should be ok.

Sorry I can take no responsibilty for what this does to your system. Try it on a test server first if you have one.

I have tested it and it works as I say.

Thanks
 
I do this for FreeBSD.

/ - 512M
/tmp - 512M
swap 2x the amount of ram
/var - 50% of remaining drive
/usr - rest of drive

HELP! I have been doing the above for a while because it was my understanding that if you have a /var partition, mysql's data would be placed there (along with mail). Today I looked though and mysql is in /usr/local/mysql/data.

So, was I just assuming wrong and mysql data is suppose to be in /usr/local/mysql/data (unless you move it) or is something wrong with the install?
 
Just installing a new HP proliant DL380 with 145 G hdd

/ 512m
/tmp 4G
/swap 4G
/var 30G (handling mail on other dedicated server, so only log files will be here I guess)
/usr 101G
 
Since you bumped this up, I guess I will ask again.

It was my understanding that if you have a /var partition, mysql's data would be placed there (along with mail). Today I looked though and mysql is in /usr/local/mysql/data.

So, was I just assuming wrong and mysql data is suppose to be in /usr/local/mysql/data (unless you move it) or is something wrong with the install?
 
On our Freebsd 5.3 installed by DA themselves mysql dbases are in /usr/local/mysql/data/(username)

your not completely wrong.. I have seen mysql in /var too.. but not on DA
 
If you're a unix purist then all variable files (files which can change during normal server operation) are in subdirectories of /var.

Even /home in many systems is a link to /var/home.

The advantage is that all other partitions can be mounted read-only except when you need to write to them, and you have a lot less of a chance of being hacked.

However Linux has never enforced it, and neither does DA.

Jeff
 
I just had a server set up for me with FreeBSD 5.4 and gave them the link to http://www.directadmin.com/install.html for the tidbit of partitioning info that is there.

Result is I have:
PHP:
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad0s1a    260M    185M     54M    77%    /
devfs          1.0k    1.0k      0B   100%    /dev
/dev/ad0s1e    260M     12k    239M     0%    /tmp
/dev/ad0s1f     76G    1.3G     68G     2%    /usr
/dev/ad0s1d    260M     29M    210M    12%    /var
procfs         4.1k    4.1k      0B   100%    /proc
I then Licensed DA and let JBMC install for me. My conclusion is that:

A. Partitioning, slices or whatever is not optimal and perhaps a result of auto partitioning. Mine looks almost like rndinit0's.

B. JBMC made due with the partitioning, but didn't fully compensate for it by shifting stuff around and adding softlinks. Again, perhaps a result of the 'let her fly' automatic approach. I'd have rather they told me the partitioning was not optimal, not install DA and let me deal with my provider first.

C. I have a mess despite the fact I tried to avoid this by asking, stating my intent, etc. before I bought the server.

D. If you don't get the control panel the host sells with their servers, pre-installed it's important to SPELL OUT exactly how you want the HDD set up. :mad:


On my system /home is where HTTP data & mySQL data is being stored and this is no softlink to /usr/home. My e-mail is apparently being stored in /var/spool/virtual..

One domain has nearly comsumed /home and this is obvously gooing to be kind of a kludge unless...

I feel like pressing for a format and reinstall of the OS with more appropriate partitioning but I am not certain if it's that important.

Their 3rd level tech has suggested to me moving /home to /usr/home and creating a softlink /home -> /usr/home, similar to what chatwizrd suggested.

What I don't know is if there is any cost to doing that? Do softlinks use more CPU? Mean I will need to modify stuff all over, etc. to make DA run okay?

Thanks for reading and hope to hear some comments!
 
couple things.

on auto partitioning the default home is symlinked to /usr/home anyway and there should be no increased load from this so its a harmless thing to do.

the var partition is bit small for DA type usage and starting from fbsd 6.0 the auto paritioning is changed to default to around 2 gig for var, you could work with the partitions you got but as the server gets more busy you may get into a situation where things like email will have to be moved and symlinked in.
 
on auto partitioning the default home is symlinked to /usr/home anyway and there should be no increased load from this so its a harmless thing to do.
I guess this wasn't auto-partitioning then because there wasn't any /usr/home directory and /home was definitely not a soft-link.

It's good to know that soft-links don't cause any extra load.

The datacenter has acknowledged the partitioning was strange and has offered to re-do the server for me.

The server presently with 512M RAM and 80G HDD, I gave a partitioning layout of:
PHP:
/      512M
/tmp   512M
/var    10G
/usr    15G
/home   remaining space
swap     1G
I don't quite understand how the structure is created with the DA setup.sh but the above was extrapolated from both this thread and here which is pretty recent (hence assumed to be worthy of consideration).

At this point any suggestions/pointers about the possibility of integrating DA a little friendlier with FreeBSD 5.4 (for stuff like portsnap,portaudit,portupgrade,pkgdb, etc) or customizing my directadmin.conf (?) would be great.

I don't want to break the ability for DA to work or upgrade but it would be nice, if possible, to integrate DA a little more with port/package utilities... I guess what might be considered a 'non-customapache' in a way? :)
 
On two servers today we did:

/ as 1000 Megabytes
/usr as 10000 Megabytes
/var as 10000 Megabytes
/tmp as 2000 Megabytes
swap as 1024 Megabytes
/home as the remainder.

But I've never seen a BSD install that didn't link /home as /usr/home; if it's properly linked then you don't need a /home partition and instead you set /usr last, as the remainder.

Jeff
 
But I've never seen a BSD install that didn't link /home as /usr/home; if it's properly linked then you don't need a /home partition and instead you set /usr last, as the remainder.
Hi Jeff,
my being very new to FreeBSD I don't quite know what behaviour to expect or not. My guess is that the DC tech who setup my server did something off the wall for what ever reason.

A /home link to /usr/home would have suited me fine but I only came to the realization something was wrong after a few days of having the server and DA already installed.

At that point, having DA already installed it seemed to be most logical to re-do the server.

I considered something like:
Code:
1. tar cvfp /usr/home-backup.tar /home
2. mkdir /usr/home
3. rm -rf /home
4. ln -s /usr/home /home
5. tar xvf /usr/home-backup.tar -C /usr
..to deal with the situation but since the DC tech offered to re-do the server I just opted to try and give them more specific partitioning instructions...avoiding any unknown (to me) problems such a change might bring.

The grey area of how/why DA was installed to a physical /home (not a soft-link to /usr/home) suggested to me I may as well instruct the DC to make a /home partition. I guess it's a six or half dozen thing..

I'm sure whith some time under my belt with this server I'll be more confident in deciding how and identifying a proper configuration.
 
I ran into the same problem, in FreeBSD 4.x a symlink was automatically created. I am not so sure 5.4 does that automatically. If any of you were to use maildir format you might want to keep in mind that you may run out of inodes before you run out of disk space. With that in mind I use an entirley seperate drive for my home partition and I format it both var and home partitions with different bytes /inode ratio

The standard FreeBSD defualt for file systems in 16k.

from man tuning FreeeBSD
The defaults may be unsuitable for a file system that requires a very
large number of i-nodes or is intended to hold a large number of very
small files. Such a file system should be created with an 8K or 4K block
size. This also requires you to specify a smaller fragment size. We
recommend always using a fragment size that is 1/8 the block size (less
testing has been done on other fragment size factors). The newfs(8)
options for this would be ``newfs -f 1024 -b 8192 ...''.


Here is what my setup looks like.

989M /
1.4G /tmp
2.9G /usr
959M /var
696G /home
 
I have never had an issue with the way /home works on freebsd, seperate /home partition is how linux works but freebsd has always symlinked it to /usr/home.
 
eds132,

You make some very good points about inodes.

I'll keep that in mind as I build our first DA server with MailDir.

Jeff
 
ha ha forgot to check back on this one lol

Yea, I was creating some archives for a qmail setup on a 160GB drive and when I ran out of drive space! I ran df and there was half the drive empty! I couldn't figure it out for at least a 4-5 hours.... I had to nfs mount another drive, then copy the old data to that . Then I reformated the 160 with 512 for fragment size and 4096 for the block size..... copied the data back on . I lost alittle disk space but was able to actually use all of it.
 
Just to reply on the thread starter. I too used the automatic partitioning in BSD 54. Last week my mailflow stopped. Since Clam is scanning and using temp space somewhere in /var.

It seemed i had a user on the system that was only using his webmail , somewhat 50 domains reside on the system , most of them running their own mailservers or using pop3 and so not storing mail locally on my server.

I just moved /var/spool/virtual to /usr/var/spool/virtual, whem creating the dirs on usr be sure to check the permissions :

mv /var/spool/virtual /usr/var/spool/virtual

chown mail:mail /usr/var/spool/virtual

Then create a symbolic link in /var/spool

ln - s /usr/var/spool/virtual virtual

Somewhat standard unix stuff that makes these OS`es so nice, versatile and stable.

This should work on any unix machine. Off course you should be aware of what you are doing.

*EDIT 24-01-2007*
Now one year later some domains we`re dropped. Keep in mind that when you have done the above you get an error in DA when deleting domains.
You`ll need to manually remove /usr/var/spool/virtual/domain.

Does anyone have experience with changing the emailspoolvirtual directive in /usr/local/directadmin/conf/directadmin.conf :
emailspoolvirtual=/var/spool/virtual
And will a changed directadmin.conf be preserved in upgrades ?
*END EDIT24-01-2007*
 
Last edited:
Hello everyone, I am working as a computer tech. I am not very good at it yet and I am wondering in terms that I can undertsand can anyone explain to me why there are 1024 mb in a gig? Any help would be greatly appriciated!:)
 
Back
Top