Thread: Live backup
View Single Post
  #3   (View Single Post)  
Old 21st December 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,131
Default

The problem with dump that you only can dump a complete filesystem. And it needs space for the filesystem snapshot if you use that "-L" flag,

As a side remark, the OpenBSD dump is different, that can do a level 0 dump of parts of a filesystem, but that doesn't help you here.

From a recently installed FBSD 7.2 system with a ports collection, apache22 and mailman install:
Code:
df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad0s2a    496M    145M    311M    32%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad0s2e    496M     12K    456M     0%    /tmp
/dev/ad0s2f     33G    1.6G     28G     5%    /usr
/dev/ad0s2d    1.4G    148M    1.2G    11%    /var
Here I still have plenty of free space in '/usr' for a filesytem snapshot

An overview of the '/usr' directories:
Code:
#  ls -l /usr
total 52
drwxrwxr-x   2 root  operator    512 Dec 20 20:09 .snap
drwxr-xr-x   2 root  wheel      7168 Dec 21 01:30 bin
drwxr-xr-x   2 root  wheel       512 Dec 20 20:12 compat
drwxr-xr-x   2 root  wheel       512 Dec 20 20:12 games
drwxr-xr-x  47 root  wheel      4608 May  1  2009 include
drwxr-xr-x   6 root  wheel     11264 Dec 20 20:28 lib
drwxr-xr-x   5 root  wheel       512 May  1  2009 libdata
drwxr-xr-x   5 root  wheel      1536 Dec 20 20:28 libexec
drwxr-xr-x  15 root  wheel       512 Dec 21 01:56 local
drwxr-xr-x   2 root  wheel       512 Dec 20 20:12 obj
drwxr-xr-x  69 root  wheel      1536 Dec 21 01:55 ports
drwxr-xr-x   2 root  wheel      5120 Dec 20 20:28 sbin
drwxr-xr-x  26 root  wheel       512 Dec 20 20:11 share
drwxr-xr-x  22 root  wheel       512 Dec 20 20:12 src
A look at the usage for each directory
Code:
# for X in $(ls -d /usr/*) ; do du -sk $X  ; done
27910   /usr/bin
2       /usr/compat
2       /usr/games
17700   /usr/include
38954   /usr/lib
92      /usr/libdata
18302   /usr/libexec
194532  /usr/local
2       /usr/obj
564984  /usr/ports
15754   /usr/sbin
339336  /usr/share
506084  /usr/src
An alternative more human friendly version
Code:
# for X in $(ls -d /usr/*) ; do du -sh $X  ; done
 27M    /usr/bin
2.0K    /usr/compat
2.0K    /usr/games
 17M    /usr/include
 38M    /usr/lib
 92K    /usr/libdata
 18M    /usr/libexec
190M    /usr/local
2.0K    /usr/obj
552M    /usr/ports
 15M    /usr/sbin
331M    /usr/share
494M    /usr/src
So the disk space usage hogs are here
  • "/usr/local" with 190 mb
  • "/usr/ports" with 552 mb
  • "/usr/share" with 331 mb
  • "/usr/src" with 494 mb

If I would be short of space I would have to analyze where the volatile data
is stored. That would be "/usr/local/mailman/archives"

So I could add in another disk and move some of the "/usr" disk directories, like those mailman archives, to the second disk to make more space for filesystem snapshots.

Or rethink the partition scheme and create separate filesystems for some of the '/usr' subdirectories.

How much space do you have left on your system (df -h)?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote