How to check free disk space on FreeBSD server

How can you check and display free disk space available on a FreeBSD server? The best way is using the command ‘df -h’ and here’s exactly what I found from doing some research online. Just type “df” (df means disk free) which will show you the raw numbers or you can type “df -h” which means human readable and makes the output easier to read by displaying it in kilobytes, megabytes, and gigabytes instead of the default kilobytes.. I did this on one of my servers and here’s what it will look like…

SSH commands for checking freebsd server disk space

Here’s text from one server:

-bash-3.2$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md2             1888170872  83453524 1707256624   5% /
/dev/md0                101018     20914     74888  22% /boot
tmpfs                  4088788         0   4088788   0% /dev/shm
-bash-3.2$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md2              1.8T   80G  1.6T   5% /
/dev/md0               99M   21M   74M  22% /boot
tmpfs                 3.9G     0  3.9G   0% /dev/shm

Here’s text from another server:

$ df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad0s1a 128990 60892 57780 51% /
/dev/ad0s1f 257998 1440 235920 1% /tmp
/dev/ad0s1g 155014798 126948208 15665408 89% /usr
/dev/ad0s1e 257998 10454 226906 4% /var
procfs 4 4 0 100% /proc
/dev/ad3s1c 384602638 13645514 340188914 4% /usr/www/virtual/yyy/drive2
$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 126M 59M 56M 51% /
/dev/ad0s1f 252M 1.4M 230M 1% /tmp
/dev/ad0s1g 148G 121G 15G 89% /usr
/dev/ad0s1e 252M 10M 222M 4% /var
procfs 4.0K 4.0K 0B 100% /proc
/dev/ad3s1c 367G 13G 324G 4% /usr/www/virtual/yyy/drive2

If you want to know more about FeeBSD and server commands, I recommend this book: Absolute FreeBSD: The Complete Guide to FreeBSD

How to turn PHP Safe Mode Off

The first and easiest solution: Contact your hosting company. Ask them to turn PHP Safe Mode Off. If you don’t want to contact your webhost, you can turn it off yourself manually. Here’s how.

Turn of PHP Safe Mode Off in Linux using some basic VI Commands.

  1. Using SSH, connect to your server. Do this as root. If not, then you can SU to Root in the next step.
  2. Once you are logged in, type su - root.
  3. For your password, type the same password you used to connect to your server.
  4. At the command prompt type this to edit your php.ini file:
    vi /etc/php.ini
  5. Go to the line safe_mode = on and press the “i” key on your keyboard.
  6. Change the line to safe_mode = off and press the “Esc” key.
  7. Type :wq! to save your file.
  8. You might have to reboot your server now.

Turn PHP Safe Mode Off on a Windows server

  1. Using Remote Desktop Connection, log in to your server as an administrator.
  2. Open c:\windowsphp.ini in Notepad.
  3. Change the line safe_mode = on to safe_mode = off.
  4. Save and close windowsphp.ini .
  5. You might have to restart your webserver for changes to take affect.