Popular Posts

Nov 10, 2019

pacct file log rotation and deletion Solaris

pacct file log rotation and deletion Solaris

APPLIES TO :  Oracle SPARC Solaris

ISSUE :  Process Accounting Files (/var/adm/pacct) files are growing in size and in count as well, there is not proper log rotation in place

GOAL :  Rotate the /var/adm/pacct file and leave only 15 days file in server, delete the old file by having log rotation in place

SOLUTION :  /usr/lib/acct/turnacct script is used to manage the process accounting files in solaris servers, Modify the file based on our requirement and place enable it in daily cron job

Prerequisites :   NIL

               1. Edit the script /usr/lib/acct/turnacct and comment the below line and add the next line
                       root@JUDI-DEV-10:/root # vi /usr/lib/acct/turnacct
                                                      #pfexec /usr/sbin/logadm -p now /var/adm/pacct
                                                      pfexec /usr/sbin/logadm -C 15 -p now /var/adm/pacct
                       -C 15 - is to have only the last 15 files in server at any point in time

               2. Now place the script in cron
                       root@JUDI-DEV-10:/root # crontba -e
                                              0 0 * * * /usr/lib/acct/turnacct switch >/dev/null 2>/dev/null

               3. Now place the script in cron
                       root@JUDI-DEV-10:/root # crontba -e

                                              0 0 * * * /usr/lib/acct/turnacct switch >/dev/null 2>/dev/null


This will rotate the pacct files daily and delete the old files from server which is older than 15. days. 

Nov 1, 2019

create zpool on existing directory with data

Create zpool on existing directory with data

APPLIES TO :  Oracle SPARC Solaris

ISSUE :  A directory contains a huge amount of data, due to disk space constrain we need to convert that data into zfs volume. The challenge is how to retain the file ownership, permission, and soft/hard links

GOAL :  Create a zfs volume and move the local data with exact permission, ownership.

SOLUTION :  There isn't a built-in or automated way to create a new DataSet and migrate existing data to it. To get it done you'll need to create the dataset and manually (e.g. rsync) the data to it.

Prerequisites :   NIL

               1. Move the data directory into a new name.
                       root@JUDI-DEV-10:/root # mv /oracle /oracle_org

               2. Create a zpool volume with a the new disk
                       root@JUDI-DEV-10:/root # zpool create -f -m /oracle oracle c1d1

               3. Copy the data to the zfs volume using the rsync command
                       root@JUDI-DEV-10:/root # rsync -aAX /oracle_org/ /oracle

               4. Verify the permission and ownership once the copy completed
                       root@JUDI-DEV-10:/root # ls -rlt


create zpool with existing data directory
create zpool and sync with existing directory
zfs create dataset from existing directory
create zpool on existing directory with data
Proper way to create a zfs off an existing directory
ZFS: adding filesystem over existing directory
create ZFS dataset over existing data
converting existing directory to zfs dataset

Zfs create dataset from existing directory

Popular Posts