Professional Documents
Culture Documents
Compact Flash Guidelines
Compact Flash Guidelines
SPANStor systems that boot from Compact Flash use a 128MB RAM disk in memory
after installation for the /var partition. System files necessary for the proper operation of
SPANStor are maintained in the /var partition which is created in the “a” slice (for
example /var on sd0 would reside on /sd0a). The /var partition needs to be moved from
memory disk to a partition on hard disk as part of the installation procedure to facilitate
proper long term operation and reduce the number of writes to the Compact Flash. A
utility program can be accessed from the SPANStor Administrative GUI under System
Configuration / Expert Mode / Compact Flash Setup to configure the /var partition on a
disk device.
The /var partition contains files that are updated frequently like the log files in the
/var/log directory, configuration database files, and other operating system files. Critical
files in the /var partition are synchronized using the /varback directory which resides on
the Compact Flash boot partition to insure that these files are updated on Compact Flash.
Synchronization occurs every minute for critical files, every 30 minutes for important
files and once a day at 3:30am for all other files not excluded in /var.
The setup dialog allows the size of /var to be selected from a pulldown selection list
ranging from 256MB to 4068MB (4GB). Since the disk drive may require partitioning if
the 0a partition does not exist or match the requested size, this routine may require a
repartition of the drive selected for /var.
The var_sync.php process runs under control of crontab to manage the synchronization of
files between /var and /varback. Critical files include the configuration database files,
the winbindd_idmap.tdb, and secrets files. Important files include the primary system log
files in /var/log and the database files in /var/db.
The synchronization process exludes the contents of the /var/tmp directory, the backup
index files included in /var/backup, as well as /swap and /run.
The largest potential usage of space in /var comes from the backup index files created to
support incremental backups and restores, as well as the database monitor files. The
system swap file is also created in /var and is the single largest usage of space in /var.
The current swap size can be examined using the #swapctl –l command.
Examples:
/var size = 512MB swapfile size = 256MB
/var size = 1024MB swapfile size = 512MB
/var size = 2048MB swapfile size = 1GB
/var size = 3072MB swapfile size = 1GB
The space consumed by some log files is highly dependent on the logging level in force.
It is recommended that the smbd log level which is set to a default of 2 to aid in
installation debugging, be reduced to 0 using the Admin GUI CIFS / Expert Mode and
the winbindd log level be reduced from 2 to 0 by editing the /etc/rc.d/nss_winbind script
and changing the command_args="-B -d2" to command_args="-B –d0" to reduce the
logging level.
SPANStor automatically runs the newsyslog routing to check, rename, and archive the
log files in /var every 15 minutes. Any time a log file exceeds 1MB it is renamed and
gzipped to conserve space. Up to 10 archived log files are kept for each system log.
SPANStor supports a number of backup methods that create index and incremental files
when backups are taken, or update the incremental file and rebuild the index files as
necessary. It is possible and recommended to move the Database Index Files from /var
to some other location using the Admin GUI / Backup / Setup/ Database Location dialog,
which will significantly reduce the amount of space consumed in /var for incremental
backups.
An index file (listing of files and dirs backed up) is created for each backup dataset which
can cause index file usage in /var to grow quite large if many different data sets are
backed up. A data set is a named backup of some specific location. For example, if you
backup the entire system on Saturday as a single operation, this would be considered one
dataset. If you backup ten different users home directories each weekday, this would
create 10 data sets. Each unique data set has an associated index file which is stored in
the /var/backups directory under a sub-directory for the backup type (NDMP, automatic,
manual, etc.) and in a directory structure that corresponds to the data set backed up. In
addition to index files, full backups create an incremental file that is used by incremental
backups to determine what changes have occurred since the last full backup or
incremental backup.
The following table indicates some approximate values for the amount of space
consumed in /var by backup index files. These values are based on the following
assumptions:
Assuming this is a starting point, here are some calculated /var sizes (excluding swap):
*Note that the swap file size varies based on the size of /var. Swap will typically be 512
MB to 1 GB based on the size of /var. It is recommended that /var be 2GB minimum or
3GB wherever possible to insure a 1GB swap file.
var_space_for_backups_in_bytes =
(num_auto_backup_sets*dbytes*d)+((any_auto_backups_defined* f*fbytes) / compratio)
+(num_NDMP_sets*dbytes*d)+((any_native_backups*f*fbytes) / compratio)
Make sure that a 'backup set' is a full backup, as incrementals will use and update the
incremental file from the last full backup. For NDMP, a backup set can be a single
volume, single dir, etc. - so insure the dirs and files counted are from the backup location
(dir, volume etc.). NDMP backups create an incremental file but do not create any index
files, as this information is passed to the NDMP client as file history.
Example case 1:
User uses automatic backups and uses one full backup set - and one incremental set
(which will use the full incremental index file).
f = 10 million files.
fbytes=100
d = 1 million directories.
dbytes = 100
compratio=10
Full backup sets will create an incremental file related to the backup set name. If a
backup set is an incremental, it will find the most recent full incremental index file to use.
Here is a 1024GB (1TB) example for incremental storage of the automatics (assuming
both are full backups):
2 backup sets * number of files * 64 bytes per filename average / compression ratio
2*((10,737,418*64)/10) = 137,438,950 bytes
Plus a single index since the user is doing manuals - and we're assuming the manual
is a full backup:
1 manual backup *((10,737,418*64)/10) = 68,719,475 bytes
233,646,169 / (1024*1024) = 233,646,169 / 1048576
Total /var/backup then is: 222.8 MB