Monday, December 29, 2014

How to check sudo activities

To check the sudo user activities , enable the logging.


To check who ran what commands, you may want to enable sudo log.
Check following value on your sudoers file.
# visudo
Defaults        log_host,log_year,logfile=/var/log/sudolog
 

Monday, December 22, 2014

म पिएर पीइने मान्छे होइन, 
म पिएर पीइने मान्छे होइन,
आँफैलाई टुक्रा पारी,
जिउने मान्छे होइन !!!

म सम्बन्ध तोद्ने मान्छे होइन,
म सम्बन्ध तोद्ने मान्छे होइन,
सम्बन्ध तोडी जानेलाई
फर्काउने मान्छे होइन !!!

म मिठो कुराले फकाउने मान्छे होइन,
म मिठो कुराले फकाउने मान्छे होइन,
मुटुलाई नै दु:खने गरी
तिखो छुरा रोप्ने होइन !!!

म हल्ला-हल्लामा दौड्ने मान्छे होइन,
म हल्ला-हल्लामा दौड्ने मान्छे होइन,
बजारमा चल्ने हल्ला कुरा
पत्त्याउने मान्छे होइन !!!

म  सध्भावना तोद्ने मान्छे होइन,
म  सध्भावना तोद्ने मान्छे होइन,
अन्तर मन्को भित्री कुरा
बुझ्न सक्ने मान्छे होइन !!!

म आफ्ना पीडा सुनाउने मान्छे होइन,
म आफ्ना पीडा सुनाउने मान्छे होइन,
सुनाएर मन्को कुरा
हल्का पार्ने मान्छे होइन !!!

असफलतामा दु:ख मानी
रुँदै हिँद्ने मान्छे होइन !!!

FS Creation on AIX

login as:
$ sudo su -
Enter your LAN Password:
root@my-aix-server-2 /
> lspv | grep -i power
hdiskpower0     00f95dd987d53177                    udbxsrcp_vg1    active
hdiskpower1     00f95dd987cf16f7                    udbxsrcp_vg1    active
hdiskpower2     00f95dd987d7446c                    udbxsrcp_vg1    active
hdiskpower3     00f95dd987d299fd                    udbxsrcp_vg1    active
hdiskpower4     00f95dd987cbbcc2                    udbxsrcp_vg1    active
hdiskpower5     00f95dd987d6c3c6                    udbxsrcp_vg1    active
hdiskpower6     00f95dd987d0f8de                    udbxsrcp_vg1    active
hdiskpower7     00f95dd987cd427a                    udbxsrcp_vg1    active
hdiskpower8     00f95dd987ca1850                    udbxsrcp_vg1    active
hdiskpower9     00f95dd987d35617                    udbxsrcp_vg1    active
hdiskpower10    00f95dd987cca3e2                    udbxsrcp_vg1    active
hdiskpower11    00f95dd987d6b982                    udbxsrcp_vg1    active
hdiskpower12    00f95dd987d0c93e                    udbxsrcp_vg1    active
hdiskpower13    00f95dd987cc4864                    udbxsrcp_vg1    active
hdiskpower14    00f95dd987d52387                    udbxsrcp_vg1    active
hdiskpower15    00f95dd987cf3daa                    udbxsrcp_vg1    active
hdiskpower16    00f95dd987d8a3de                    udbxsrcp_vg1    active
hdiskpower17    00f95dd987d5b900                    udbxsrcp_vg1    active
hdiskpower18    00f95dd987cf86c4                    udbxsrcp_vg1    active
hdiskpower19    00f95dd987d7eb4e                    udbxsrcp_vg1    active
hdiskpower20    00f95dd987d13451                    udbxsrcp_vg1    active
hdiskpower21    00f95dd987cc0f32                    udbxsrcp_vg1    active
hdiskpower22    00f95dd987d68ce7                    udbxsrcp_vg1    active
hdiskpower23    00f95dd987d1db2f                    udbxsrcp_vg1    active
hdiskpower24    00f95dd987cd538f                    udbxsrcp_vg1    active
hdiskpower25    00f95dd987d87a28                    udbxsrcp_vg1    active
hdiskpower26    00f95dd987d1947d                    udbxsrcp_vg1    active
hdiskpower27    00f95dd987cc506d                    udbxsrcp_vg1    active
hdiskpower28    00f95dd987d48c01                    udbxsrcp_vg1    active
hdiskpower29    00f95dd987cebcc6                    udbxsrcp_vg1    active
hdiskpower30    00f95dd987ccffb7                    udbxsrcp_vg1    active
hdiskpower31    00f95dd987d541dc                    udbxsrcp_vg1    active
hdiskpower32    00f95dd987d95e38                    udbxcasp_vg1    active
hdiskpower33    00f95dd987d272a5                    udbxcasp_vg1    active
hdiskpower34    00f95dd987ced468                    udbxprcp_vg1    active
hdiskpower35    00f95dd987d955e3                    udbxprcp_vg1    active
hdiskpower36    00f95dd987d2280d                    udbxprcp_vg1    active
hdiskpower37    00f95dd987d31008                    udbxprcp_vg1    active
hdiskpower38    00f95dd987dad3f8                    udbxprcp_vg1    active
hdiskpower39    00f95dd987cee69f                    udbxmonp_vg1    active
hdiskpower40    00f95dd987d7ad0b                    udbxmonp_vg1    active
hdiskpower41    00f95dd987d1157f                    udbxmonp_vg1    active
hdiskpower42    00f95dd987d8b814                    tempspace_vg1   active
hdiskpower43    00f95dd987d172bc                    tempspace_vg1   active
hdiskpower44    00f95dd987d7facb                    tempspace_vg1   active
hdiskpower45    00f95dd987d277d0                    tempspace_vg1   active
hdiskpower46    00f95dd987dc31d5                    tempspace_vg1   active
hdiskpower47    00f95dd987d093f2                    tempspace_vg1   active
hdiskpower48    00f95dd987d48539                    tempspace_vg1   active
hdiskpower49    00f95dd987cfe8d4                    tempspace_vg1   active
hdiskpower50    00f95dd987da1c44                    tempspace_vg1   active
hdiskpower51    00f95dd987d40fd4                    tempspace_vg1   active
hdiskpower52    00f95dd987db5d3e                    tempspace_vg1   active
hdiskpower53    00f95dd987d0a125                    udbbackup_vg1   active
hdiskpower54    00f95dd987d7cf51                    udbbackup_vg1   active
hdiskpower55    00f95dd987d23e64                    udbbackup_vg1   active
hdiskpower56    00f95dd987db6d10                    udbbackup_vg1   active
hdiskpower57    00f95dd987d5e046                    udbbackup_vg1   active
hdiskpower58    00f95dd987cfe09e                    udbbackup_vg1   active
hdiskpower59    00f95dd987d8e06c                    udbbackup_vg1   active
hdiskpower60    00f95dd987d0fc26                    udbbackup_vg1   active
hdiskpower61    00f95dd987da000f                    udbbackup_vg1   active
hdiskpower62    00f95dd987d51340                    udbbackup_vg1   active
hdiskpower63    00f95dd987ddd591                    udbbackup_vg1   active
hdiskpower64    00f95dd987d54fb4                    udbbackup_vg1   active
hdiskpower65    00f95dd987dbe256                    udbbackup_vg1   active
hdiskpower66    00f95dd987d309e0                    udbbackup_vg1   active
hdiskpower67    00f95dd987da7ca6                    udbbackup_vg1   active
hdiskpower68    00f95dd987d2d76e                    udbbackup_vg1   active
hdiskpower69    00f95dd987db49b0                    udbbackup_vg1   active
hdiskpower70    00f95dd987d453c9                    udbbackup_vg1   active
hdiskpower71    00f95dd987dceeb8                    udbbackup_vg1   active
hdiskpower72    00f95dd987d4ebcc                    udbbackup_vg1   active
hdiskpower73    00f95dd987dd8652                    udbbackup_vg1   active
hdiskpower74    00f95dd987d83071                    toolsvg         active
hdiskpower75    00f95dd98cf0abfc                    pagevg          active
hdiskpower76    none                                None
hdiskpower77    none                                None
hdiskpower78    none                                None
hdiskpower79    none                                None
hdiskpower80    00f95dd98fca6e19                    altinst_rootvg
root@my-aix-server-2 /
> cfgmgr
root@my-aix-server-2 /
> powermt config
root@my-aix-server-2 /
> lspv | grep -i power
hdiskpower0     00f95dd987d53177                    udbxsrcp_vg1    active
hdiskpower1     00f95dd987cf16f7                    udbxsrcp_vg1    active
hdiskpower2     00f95dd987d7446c                    udbxsrcp_vg1    active
hdiskpower3     00f95dd987d299fd                    udbxsrcp_vg1    active
hdiskpower4     00f95dd987cbbcc2                    udbxsrcp_vg1    active
hdiskpower5     00f95dd987d6c3c6                    udbxsrcp_vg1    active
hdiskpower6     00f95dd987d0f8de                    udbxsrcp_vg1    active
hdiskpower7     00f95dd987cd427a                    udbxsrcp_vg1    active
hdiskpower8     00f95dd987ca1850                    udbxsrcp_vg1    active
hdiskpower9     00f95dd987d35617                    udbxsrcp_vg1    active
hdiskpower10    00f95dd987cca3e2                    udbxsrcp_vg1    active
hdiskpower11    00f95dd987d6b982                    udbxsrcp_vg1    active
hdiskpower12    00f95dd987d0c93e                    udbxsrcp_vg1    active
hdiskpower13    00f95dd987cc4864                    udbxsrcp_vg1    active
hdiskpower14    00f95dd987d52387                    udbxsrcp_vg1    active
hdiskpower15    00f95dd987cf3daa                    udbxsrcp_vg1    active
hdiskpower16    00f95dd987d8a3de                    udbxsrcp_vg1    active
hdiskpower17    00f95dd987d5b900                    udbxsrcp_vg1    active
hdiskpower18    00f95dd987cf86c4                    udbxsrcp_vg1    active
hdiskpower19    00f95dd987d7eb4e                    udbxsrcp_vg1    active
hdiskpower20    00f95dd987d13451                    udbxsrcp_vg1    active
hdiskpower21    00f95dd987cc0f32                    udbxsrcp_vg1    active
hdiskpower22    00f95dd987d68ce7                    udbxsrcp_vg1    active
hdiskpower23    00f95dd987d1db2f                    udbxsrcp_vg1    active
hdiskpower24    00f95dd987cd538f                    udbxsrcp_vg1    active
hdiskpower25    00f95dd987d87a28                    udbxsrcp_vg1    active
hdiskpower26    00f95dd987d1947d                    udbxsrcp_vg1    active
hdiskpower27    00f95dd987cc506d                    udbxsrcp_vg1    active
hdiskpower28    00f95dd987d48c01                    udbxsrcp_vg1    active
hdiskpower29    00f95dd987cebcc6                    udbxsrcp_vg1    active
hdiskpower30    00f95dd987ccffb7                    udbxsrcp_vg1    active
hdiskpower31    00f95dd987d541dc                    udbxsrcp_vg1    active
hdiskpower32    00f95dd987d95e38                    udbxcasp_vg1    active
hdiskpower33    00f95dd987d272a5                    udbxcasp_vg1    active
hdiskpower34    00f95dd987ced468                    udbxprcp_vg1    active
hdiskpower35    00f95dd987d955e3                    udbxprcp_vg1    active
hdiskpower36    00f95dd987d2280d                    udbxprcp_vg1    active
hdiskpower37    00f95dd987d31008                    udbxprcp_vg1    active
hdiskpower38    00f95dd987dad3f8                    udbxprcp_vg1    active
hdiskpower39    00f95dd987cee69f                    udbxmonp_vg1    active
hdiskpower40    00f95dd987d7ad0b                    udbxmonp_vg1    active
hdiskpower41    00f95dd987d1157f                    udbxmonp_vg1    active
hdiskpower42    00f95dd987d8b814                    tempspace_vg1   active
hdiskpower43    00f95dd987d172bc                    tempspace_vg1   active
hdiskpower44    00f95dd987d7facb                    tempspace_vg1   active
hdiskpower45    00f95dd987d277d0                    tempspace_vg1   active
hdiskpower46    00f95dd987dc31d5                    tempspace_vg1   active
hdiskpower47    00f95dd987d093f2                    tempspace_vg1   active
hdiskpower48    00f95dd987d48539                    tempspace_vg1   active
hdiskpower49    00f95dd987cfe8d4                    tempspace_vg1   active
hdiskpower50    00f95dd987da1c44                    tempspace_vg1   active
hdiskpower51    00f95dd987d40fd4                    tempspace_vg1   active
hdiskpower52    00f95dd987db5d3e                    tempspace_vg1   active
hdiskpower53    00f95dd987d0a125                    udbbackup_vg1   active
hdiskpower54    00f95dd987d7cf51                    udbbackup_vg1   active
hdiskpower55    00f95dd987d23e64                    udbbackup_vg1   active
hdiskpower56    00f95dd987db6d10                    udbbackup_vg1   active
hdiskpower57    00f95dd987d5e046                    udbbackup_vg1   active
hdiskpower58    00f95dd987cfe09e                    udbbackup_vg1   active
hdiskpower59    00f95dd987d8e06c                    udbbackup_vg1   active
hdiskpower60    00f95dd987d0fc26                    udbbackup_vg1   active
hdiskpower61    00f95dd987da000f                    udbbackup_vg1   active
hdiskpower62    00f95dd987d51340                    udbbackup_vg1   active
hdiskpower63    00f95dd987ddd591                    udbbackup_vg1   active
hdiskpower64    00f95dd987d54fb4                    udbbackup_vg1   active
hdiskpower65    00f95dd987dbe256                    udbbackup_vg1   active
hdiskpower66    00f95dd987d309e0                    udbbackup_vg1   active
hdiskpower67    00f95dd987da7ca6                    udbbackup_vg1   active
hdiskpower68    00f95dd987d2d76e                    udbbackup_vg1   active
hdiskpower69    00f95dd987db49b0                    udbbackup_vg1   active
hdiskpower70    00f95dd987d453c9                    udbbackup_vg1   active
hdiskpower71    00f95dd987dceeb8                    udbbackup_vg1   active
hdiskpower72    00f95dd987d4ebcc                    udbbackup_vg1   active
hdiskpower73    00f95dd987dd8652                    udbbackup_vg1   active
hdiskpower74    00f95dd987d83071                    toolsvg         active
hdiskpower75    00f95dd98cf0abfc                    pagevg          active
hdiskpower76    none                                None
hdiskpower77    none                                None
hdiskpower78    none                                None
hdiskpower79    none                                None
hdiskpower80    00f95dd98fca6e19                    altinst_rootvg
hdiskpower81    none                                None
root@my-aix-server-2 /
> powermt display dev=hdiskpower81
Pseudo name=hdiskpower81
Symmetrix ID=000192603809
Logical device ID=1451
state=alive; policy=SymmOpt; priority=0; queued-IOs=0;
==============================================================================
--------------- Host ---------------   - Stor -   -- I/O Path --  -- Stats ---
###  HW Path               I/O Paths    Interf.   Mode    State   Q-IOs Errors
==============================================================================
   0 fscsi0                   hdisk1313 FA  7eB   active  alive       0      0
   0 fscsi0                   hdisk1314 FA  9eB   active  alive       0      0
   1 fscsi1                   hdisk1315 FA 10eB   active  alive       0      0
   1 fscsi1                   hdisk1316 FA  8eB   active  alive       0      0
   2 fscsi2                   hdisk1317 FA  7eB   active  alive       0      0
   2 fscsi2                   hdisk1318 FA  9eB   active  alive       0      0
   3 fscsi3                   hdisk1319 FA 10eB   active  alive       0      0
   3 fscsi3                   hdisk1320 FA  8eB   active  alive       0      0
   4 fscsi4                   hdisk1321 FA  7eB   active  alive       0      0
   4 fscsi4                   hdisk1322 FA  9eB   active  alive       0      0
   5 fscsi5                   hdisk1323 FA 10eB   active  alive       0      0
   5 fscsi5                   hdisk1324 FA  8eB   active  alive       0      0
   6 fscsi6                   hdisk1325 FA  7eB   active  alive       0      0
   6 fscsi6                   hdisk1326 FA  9eB   active  alive       0      0
   7 fscsi7                   hdisk1327 FA 10eB   active  alive       0      0
   7 fscsi7                   hdisk1328 FA  8eB   active  alive       0      0

root@my-aix-server-2 /
> df -g /udb/data/prcpdb/c1
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/prcpdbc1     90.00      7.19   93%       15     1% /udb/data/prcpdb/c1
root@my-aix-server-2 /
> lslv prcpdbc1
LOGICAL VOLUME:     prcpdbc1               VOLUME GROUP:   udbxprcp_vg1
LV IDENTIFIER:      00f95dd900004c0000000148a49d9ac3.6 PERMISSION:     read/writ                                  e
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            1440                   PP SIZE:        64 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                1440                   PPs:            1440
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       edge                   UPPER BOUND:    1024
MOUNT POINT:        /udb/data/prcpdb/c1    LABEL:          /udb/data/prcpdb/c1
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no
DEVICESUBTYPE:      DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
root@my-aix-server-2 /
> lsvg -l udbxprcp_vg1
udbxprcp_vg1:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
homeudbxprcp        jfs2       3200    3200    4    open/syncd    /udb/home/udbx                                  prcp
logprcpdb           jfs2       256     256     1    open/syncd    /udb/log/prcpd                                  b
prcpdbsyscat        jfs2       48      48      1    open/syncd    /udb/data/prcp                                  db/syscat
prcpdbusrspc        jfs2       32      32      1    open/syncd    /udb/data/prcp                                  db/userspace
prcpdbtoolstmp      jfs2       48      48      1    open/syncd    /udb/data/prcp                                  db/toolstemp
prcpdbc1            jfs2       1440    1440    1    open/syncd    /udb/data/prcp                                  db/c1
prcpdbc2            jfs2       1440    1440    1    open/syncd    /udb/data/prcp                                  db/c2
prcpdbc3            jfs2       1440    1440    1    open/syncd    /udb/data/prcp                                  db/c3
root@my-aix-server-2 /
> lsvg -l udbxprcp_vg1
udbxprcp_vg1:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
homeudbxprcp        jfs2       3200    3200    4    open/syncd    /udb/home/udbxprcp
logprcpdb           jfs2       256     256     1    open/syncd    /udb/log/prcpdb
prcpdbsyscat        jfs2       48      48      1    open/syncd    /udb/data/prcpdb/syscat
prcpdbusrspc        jfs2       32      32      1    open/syncd    /udb/data/prcpdb/userspace
prcpdbtoolstmp      jfs2       48      48      1    open/syncd    /udb/data/prcpdb/toolstemp
prcpdbc1            jfs2       1440    1440    1    open/syncd    /udb/data/prcpdb/c1
prcpdbc2            jfs2       1440    1440    1    open/syncd    /udb/data/prcpdb/c2
prcpdbc3            jfs2       1440    1440    1    open/syncd    /udb/data/prcpdb/c3
root@my-aix-server-2 /
> extendvg udbxprcp_vg1 hdiskpower81
0516-1254 extendvg: Changing the PVID in the ODM.
root@my-aix-server-2 /
> chfs -a size=+50G /udb/data/prcpdb/c1
0516-787 extendlv: Maximum allocation for logical volume prcpdbc1
        is 1440.
root@my-aix-server-2 /
> lslv prcpdbc1
LOGICAL VOLUME:     prcpdbc1               VOLUME GROUP:   udbxprcp_vg1
LV IDENTIFIER:      00f95dd900004c0000000148a49d9ac3.6 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            1440                   PP SIZE:        64 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                1440                   PPs:            1440
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       edge                   UPPER BOUND:    1024
MOUNT POINT:        /udb/data/prcpdb/c1    LABEL:          /udb/data/prcpdb/c1
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no
DEVICESUBTYPE:      DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
root@my-aix-server-2 /
> chlv -x 2880 prcpdbc1
root@my-aix-server-2 /
>  lslv prcpdbc1
LOGICAL VOLUME:     prcpdbc1               VOLUME GROUP:   udbxprcp_vg1
LV IDENTIFIER:      00f95dd900004c0000000148a49d9ac3.6 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            2880                   PP SIZE:        64 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                1440                   PPs:            1440
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       edge                   UPPER BOUND:    1024
MOUNT POINT:        /udb/data/prcpdb/c1    LABEL:          /udb/data/prcpdb/c1
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no
DEVICESUBTYPE:      DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
root@my-aix-server-2 /
> chfs -a size=+50G /udb/data/prcpdb/c1
Filesystem size changed to 293601280
Inlinelog size changed to 512 MB.
root@my-aix-server-2 /
> chfs -a size=+50G /udb/data/prcpdb/c2
0516-787 extendlv: Maximum allocation for logical volume prcpdbc2
        is 1440.
root@my-aix-server-2 /
> chlv -x 2880
root@my-aix-server-2 /
> df -g /udb/data/prcpdb/c2
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/prcpdbc2     90.00      7.19   93%       15     1% /udb/data/prcpdb/c2
root@my-aix-server-2 /
> lslv
root@my-aix-server-2 /
> lslv prcpdbc2
LOGICAL VOLUME:     prcpdbc2               VOLUME GROUP:   udbxprcp_vg1
LV IDENTIFIER:      00f95dd900004c0000000148a49d9ac3.7 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            1440                   PP SIZE:        64 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                1440                   PPs:            1440
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       edge                   UPPER BOUND:    1024
MOUNT POINT:        /udb/data/prcpdb/c2    LABEL:          /udb/data/prcpdb/c2
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no
DEVICESUBTYPE:      DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
root@my-aix-server-2 /
> chlv -x 2880 prcpdbc2
root@my-aix-server-2 /
> chlv -x 2880 prcpdbc3
root@my-aix-server-2 /
> chfs -a size=+50G /udb/data/prcpdb/c2
Filesystem size changed to 293601280
Inlinelog size changed to 512 MB.
root@my-aix-server-2 /
>  chfs -a size=+50G /udb/data/prcpdb/c3
Filesystem size changed to 293601280
Inlinelog size changed to 512 MB.
root@my-aix-server-2 /
> chfs -a size=+200G /udb/home/udbxprcp
0516-787 extendlv: Maximum allocation for logical volume homeudbxprcp
        is 3200.
root@my-aix-server-2 /
> chlv -x 6400
root@my-aix-server-2 /
> df -g /udb/home/udbxprcp
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/homeudbxprcp    200.00    198.96    1%      324     1% /udb/home/udbxprcp
root@my-aix-server-2 /
> chlv -x 6400 homeudbxprcp
root@my-aix-server-2 /
> chfs -a size=+200G /udb/home/udbxprcp
Filesystem size changed to 838860800
root@my-aix-server-2 /
>

patching aix server

login as:
$ sudo su -
Enter your LAN Password:
root@myaixserver /
> lspv | grep -i root
hdisk5          00f62694c1485fa8                    rootvg          active
hdisk6          00f62694c14fb18f                    old_rootvg
root@myaixserver /
> oslevel -s
6100-09-02-1412
root@myaixserver /
> alt_disk_install -B -C hdisk6
root@myaixserver /
> cd /tmp
root@myaixserver /tmp
> smitty update_all
#---------------------------------------------------------------------
# No installable software products were found on the media.
#---------------------------------------------------------------------
                                                                    COMMAND STATUS
Command: failed        stdout: yes           stderr: no
Before command completion, additional instructions may appear below.
0503-003 geninstall:  The specified device /tmp
        is not a valid device or file.
#---------------------------------------------------------------------
# No installable software products were found on the media.
#---------------------------------------------------------------------





F1=Help                              F2=Refresh                            F3=Cancel                             F6=Command
F8=Image                             F9=Shell                              F10=Exit                              /=Find
n=Find Next




root@myaixserver /tmp
> lspv | grep -i root
hdisk5          00f62694c1485fa8                    rootvg          active
hdisk6          00f62694c14fb18f                    old_rootvg
root@myaixserver /tmp
> bootlist -m normal -o
hdisk5 blv=hd5 pathid=0
root@myaixserver /tmp
> bootlist -m normal hdisk6
root@myaixserver /tmp
>  bootlist -m normal -o
hdisk6 blv=hd5 pathid=0
root@myaixserver /tmp
>  bootlist -m normal hdisk5
root@myaixserver /tmp
>  bootlist -m normal -o
hdisk5 blv=hd5 pathid=0
root@myaixserver /tmp
>
 

Saturday, December 20, 2014

Monday, December 1, 2014

RHEL7: Create filesystem on redhat EL 7

How to Create, mount, unmount, and use vfat, ext4 and xfs file systems.
Prerequisite

Basic Logical volume operation with xfs
# fdisk /dev/sdb
# pvcreate /dev/sdb1
# vgcreate myvg /dev/sdb1

To create a new partition called mylv with a size of 100MB, type:
# lvcreate --size 100M --name mylv /dev/myvg
Ext4 file system
To create an ext4 file system (here called /dev/myvg/mylv), type:
# mkfs.ext4 /dev/myvg/mylv

To mount this file system, type:
# mount /dev/myvg/mylv /mnt
Add entry to /etc/fstab
/dev/myvg/mylv /mnt ext4 defaults 1 2
To check an unmounted file system consistency, type:
# fsck /dev/myvg/mylv
To get details about a file system, type:
# dumpe2fs /dev/myvg/mylv

Playing around XFS.

XFS is default file system on RHEL7.


# lvcreate -n mylv -L 10G myvg
or
# lvcreate --name mylv --size 10G /dev/myvg

# mkfs.xfs /dev/myvg/mylv
Add entry to /etc/fstab file to save off the reboot.
/dev/mapper/myvg-mylv /mnt xfs defaults 1 2
# mount -a
or
# mount /dev/myvg/mylv /mnt
# df -h /mnt


Extending filesystem by 2GB
# vgs //check free space
# lvscan  // get device path
# lvextend -L +2G  /dev/myvg/mylv
# xfs_growfs /mnt
Note: do not use resize2fs, its only for ext fs

Resizing (reducing) filessytem under zfs
You can't resize zfs. If there is a scenario, you have to remove existing fs and create a new one.

To repair an unmounted file system consistency,
# xfs_repair /dev/myvg/mylv
# xfs_info /dev/myvg/mylv

C. create an Vfat file system
# mkfs.vfat /dev/myvg/mylv
Mount the filessystem.
# mount /dev/myvg/mylv /mnt
Add entry to /etc/fstab file
# vi /etc/fstab
/dev/mapper/myvg-mylv /mnt vfat defaults 1 2
To repair an unmounted file system consistency,
# fsck.vfat /dev/myvg/mylv

Tuesday, November 25, 2014

Setting Up printer using CUPS Command-Line Utilities on SOlaris 11.2


Setting Up printer using CUPS Command-Line Utilities on SOlaris 11.2

1. Become root
sam@apsol11sas25:~$ sudo su -
Enter your LAN Password:
Your password expires in 7 days. Please change it as soon as possible.
Oracle Corporation      SunOS 5.11      11.2    June 2014
You have new mail.
2. How to Set Up Your Printing Environment
2.1. Ensure that the cups/scheduler and the cups/in-lpd SMF services are online.
root@apsol11sas25:~# svcs -a | grep cups/scheduler
online         Nov_20   svc:/application/cups/scheduler:default
root@apsol11sas25:~# svcs -a | grep cups/in-lpd
disabled       Nov_20   svc:/application/cups/in-lpd:default
2.2. If not running, enable these services
root@apsol11sas25:~# svcadm enable cups/in-lpd
root@apsol11sas25:~# svcs -a | grep cups/in-lpd
online         11:46:28 svc:/application/cups/in-lpd:default

2.3. Find out if the printer/cups/system-config-printer package is installed on your system.
root@apsol11sas25:~# pkg info print/cups/system-config-printer
          Name: print/cups/system-config-printer
       Summary: Print Manager for CUPS
      Category: System/Administration and Configuration
         State: Installed
     Publisher: solaris
       Version: 1.0.16
 Build Release: 5.11
        Branch: 0.175.2.0.0.26.0
Packaging Date: October 28, 2013 03:14:17 PM
          Size: 2.69 MB
          FMRI: pkg://solaris/print/cups/system-config-printer@1.0.16,5.11-0.175.2.0.0.26.0:20131028T151417Z
2.4. If not installed, install it
# pkg install print/cups/system-config-printer
2.5. list the print service enabled on your system
root@apsol11sas25:~# /usr/sbin/print-service -q
-bash: /usr/sbin/print-service: No such file or directory
root@apsol11sas25:~# print-service -q
-bash: print-service: command not found
3. Set Up a printer using the lpadmin Command
root@apsol11sas25:~# lpstat -d
no system default destination
root@apsol11sas25:~# lpadm
-bash: lpadm: command not found
root@apsol11sas25:~# ls -l /usr/sbin/lpadmin
-r-xr-xr-x   1 root     bin        28068 Sep 22 16:59 /usr/sbin/lpadmin
root@apsol11sas25:~# /usr/sbin/lpadmin -p ^C
root@apsol11sas25:~# hp5593^C
root@apsol11sas25:~# ping hp5593
hp5593 is alive
root@apsol11sas25:~# nslookup hp5593
Server:         192.168.20.20
Address:        192.168.20.20#53
Name:   hp5593.fhlmc.com
Address: 192.168.20.28
3.1 Use the lpadmin command with the -p option to add a printer to CUPS.
root@apsol11sas25:~# /usr/sbin/lpadmin -p hp5593 -E
-p  ---> Specifies the name of the printer to add.
-E ---> Enables the destination and accepts jobs.

root@apsol11sas25:~# lpstat -d
no system default destination
3.2. Enable the printer to accept print requests and to print those requests.
root@apsol11sas25:~# cupsaccept hp5593
root@apsol11sas25:~# cupsenable  hp5593
3.3. Verify that the printer is correctly configured
root@apsol11sas25:~# lpstat -p hp5593 -l
printer hp5593 is idle.  enabled since November 25, 2014 11:51:11 AM EST
root@apsol11sas25:~# lpstat -d
no system default destination
root@apsol11sas25:~# lpstat -p hp5593
printer hp5593 is idle.  enabled since November 25, 2014 11:51:11 AM EST
root@apsol11sas25:~# pwd
/root
root@apsol11sas25:~# cd /var/tmp
root@apsol11sas25:/var/tmp# cat >testprint
Testing printer from Sam to John.
If you see this page, please give it to John.
Thank you
Printed from apsol11sas25
root@apsol11sas25:/var/tmp# ls testprint
testprint
4. Test your print job
root@apsol11sas25:/var/tmp# lp testprint
lp: Error - no default destination available.
root@apsol11sas25:/var/tmp# lp -d hp5593 testprint
request id is hp5593-1 (1 file(s))
root@apsol11sas25:/var/tmp# lpstat
root@apsol11sas25:/var/tmp# lpstat -l
root@apsol11sas25:/var/tmp# lpstat -r
scheduler is running
root@apsol11sas25:/var/tmp# lpstat -t
scheduler is running
no system default destination
device for hp5593: ///dev/null
hp5593 accepting requests since November 25, 2014 11:58:32 AM EST
printer hp5593 is idle.  enabled since November 25, 2014 11:58:32 AM EST
root@apsol11sas25:/var/tmp# man lpstat
Reformatting page.  Please Wait... done
root@apsol11sas25:/var/tmp#
5. Set the system's default destination printer
root@apsol11sas25:/var/tmp# lpadmin -d hp5593
root@apsol11sas25:/var/tmp#  lpstat -d
system default destination: hp5593
root@apsol11sas25:/var/tmp# ls -ltr
-rw-r--r--   1 root     root         128 Nov 25 11:57 testprint
root@apsol11sas25:/var/tmp# lp testprint
request id is hp5593-2 (1 file(s))
root@apsol11sas25:/var/tmp#

https://docs.oracle.com/cd/E23824_01/html/821-1451/gllmb.html#scrolltoc
https://docs.oracle.com/cd/E23824_01/html/821-1451/gllgm.html#scrolltoc

 

Thursday, November 20, 2014

changing the value at /etc/security/limits.conf file

UNIX Support - Update a standard system configuration file
Please update /etc/security/limits.conf file on mysassrv05 to change nofile limit for mossas1 to 65000.

=====================================
To set the limit system wide for all user,
echo "* hard nofile 10240" >> /etc/security/limits.conf
echo "* soft nofile 10240" >> /etc/security/limits.conf
sysctl -w fs.file-max=10240
sysctl -p - Loads the value setting specified on /etc/sysctl or defined value.
There is no reboot required and it also works fine even after reboot. The value defined here is just a reference but you can define your own.

========================================

On Solaris:
add entry to /etc/system
set rlim_fd_max = 4096

# Hard limit on file descriptors for a single proc
##(Without this above condition, the default value for nofiles is half of the rlim_fd_cur)

set rlim_fd_cur = 1024 # Soft limit on file descriptors for a single proc
On AIX:
etc/security/limits
- you can configure ulimits for each user here
esaadmin:
 stack = 393216
 stack_hard = 393216

On Linux:
/etc/security/limits.conf
- you can configure ulimits for each user here

username hard nofile 4096
username soft nofile 63536
Hard and soft limits of 4096 for 'nofile' (all users)
* soft nofile 4096
* hard nofile 4096


Lock paged memory when using memcached by using memcached -k option

How to lock the paged memory?
# man memcached

#memcached -u user -k &
 warning: -k invalid, mlockall() failed: Cannot allocate memory

The reason is that by default locked memory is 64K.
Run the command below to see the output
# ulimit -l
64

You can change the value by addeding entry for memlock at /etc/security/limits.conf for root user.

# - memlock - max locked-in-memory address space (KB)
oracle soft nofile 24576
oracle hard nofile 65536
root   -     memlock   1048576
Verify the change, you may want to logout and log back in to test it.
# ulimit -l
If you are setting values for normal user
Once you made the change, su to the user and run the following command to see hard and soft limit.
Not: do man for more info or google is there for you.
$ ulimit -Hn
4096
$ ulimit -Sn
4096
$ id
uid=65128(mysas) gid=75260(sasgrp)
$
ulimit -u

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Please change nofile limit for mostmgr to 65000.
# more /etc/security/limits.conf

* hard core 0
* soft core 0
mostmgr         hard    nofile          25000
mostmgr         soft    nofile          25000
# End of file

# vi /etc/security/limits.conf
#@student        -       maxlogins       4
* hard core 0
* soft core 0
mostmgr         hard    nofile          65000
mostmgr         soft    nofile          65000
# End of file

# su - trnmgr
$ ulimit -Hn
4096
$ ulimit -Sn
4096
$ id
$ ulimit -u

To set the limit system wide for all user,
# echo "* hard nofile 10240" >> /etc/security/limits.conf
# echo "* soft nofile 10240" >> /etc/security/limits.conf
# sysctl -w fs.file-max=10240
# sysctl -p
========================================

On Solaris:
add entry to /etc/system
set rlim_fd_max = 4096 # Hard limit on file descriptors for a single proc
##(Without this above condition, the default value for nofiles is half of the rlim_fd_cur)
set rlim_fd_cur = 1024 # Soft limit on file descriptors for a single proc
On AIX:
etc/security/limits
- you can configure ulimits for each user here
esaadmin:
 stack = 393216
 stack_hard = 393216

On Linux:
/etc/security/limits.conf
- you can configure ulimits for each user here
username hard nofile 4096
username soft nofile 63536
Hard and soft limits of 4096 for 'nofile' (all users)
* soft nofile 4096
* hard nofile 4096

 

data transfer using rsync

data transfer using rsync
This is tested from Solaris 10 to Solaris 11.2 server. [ M5000 to M10 server]

1. Include all the mountpoint that you want to transfer
$ cat /var/tmp/myFS.txt
/appdata/dev/appris1
/appdata/dev/appris2
/appdata/dev/davm

2. List the directories that you don't want to transfer. It must to relative path to the mountpoint.
$ cat /var/tmp/my.exclude
/hhpsc
/round3
/vendors
/logs/output

3. Have your simple script ready. Make sure to check one at a time. Once confirm, try with multiple mountpoints.
$ cat myrsync.all.sh
#!/bin/sh
D_HOST=he2unxpv401
C_FILE=/var/tmp/myFS.txt
for i in `cat ${C_FILE}`
do
        echo "Syncing $i to ${D_HOST} . Please wait ...."
        /usr/bin/rsync -logtprz --exclude-from=/var/tmp/my.exclude --progress --rsh='ssh -l root' $i root@${D_HOST}:$i
 # Solaris 11, we had an issue with root user. When you use sudo to root, its not really a user root, its a role. Convert root role to root user.
 #/usr/bin/rsync -logtprz --exclude-from=/var/tmp/my.exclude --progress --rsync-path="sudo rsync" --rsh='ssh -l your_userid' $i your_userid@${D_HOST}:$i
 #/usr/bin/rsync -logtprz --delete --update --progress --rsync-path="sudo rsync" --rsh='ssh -l dev' /app1/   dev@myappsas09:/app2/
done

4. Add/change below entry at the last line of /etc/ssh/sshd_config file
AuthorizedKeysFile /etc/ssh/authorized_keys/%u
and also allow root login by changing from no to yes on permit root login.
PermitRootLogin yes

5. Generate root key using ssh-keygen
# ssh-keygen -t dsa
Copy the public key from root user's home dir (solaris 10 its on / and solaris 11, its under /root) to target server's /var/tmp
again rename to root and copy to /etc/ssh/authorized_keys/

6. Test your connection with ssh to host and should not ask for password.
start your simple rsync and if it works use the script.
 

selinux on Redhat 7


2nd part
Lelinux
# ls -lZ
its hard to find the context level you want
# yum install -y httpd
# cd /var/www/html
# ls -Z
you will see webserver default se-context level
To manage context lavel
List all context level
# semanage fcontext -l | more
# semanage fcontext -l | grep http

its top
check current configuration
# ls -Z

man -k _selinux on old version
on redhat 7
# yum whatprovides */sepolicy
to generate the man page..
# yum -y install policycoreutils-devel

# sepolicy --help
# man sepolicy
# man sepolicy-manpage
where you want to put ur man page
# selpolicy manpage -a -p /usr/share/man/man8
wait for a while to generate the man page..

# man -k _selinux  # whill not show any...
Run mandb command to update the database
# mandb
# man httpd_selinux # to get selinux context level
# cd /var/www
# ls -lZ
# man semanage-fcontext  # only works on RHEL 7
check the example presented
# mkdir /apps
# cat >/apps/index.html
This is test

edit the /etc/httpd/conf/httpd.conf
locate DocumentRoot and change it to /apps
also change Directory location from /var/www to
<Directory "app>
check couple of places

# systemctl restart httpd
# yum -y install elinks
# elink http://localhost
#
# tail -f /var/log/audit/audit.log | grep AVC
# grep AVC /var/log/audit/audit.log

check the log and you will see the error
# semanage -a -t httpd_sys_content_t "/web(/.*)?"
now you apply the polocy and apply to filesystem
# restorecon -R -v /web
# elinks http://localhost

https://www.youtube.com/watch?v=jz_OrnjCR_M

3rd part
boolean =>
# getsebool -l  # currently available
# semanage boolean -l # show policy state
# man -k _selinux | grep ftp
# man ftpd_selinux # shows us inf about ftp boolean
#
# getsebool -a | grep ftp
#
# sesearch -b ftpd_anon_write -ACT
boolean can define a lot of information
transition rules
# sesearch -b ftpd_anon_write -ACT | grep -v type_transit
check for ftpd_t  public_content_WR_T
check for file or directory
source context
# sesearch -b ftpd_anon_write -ACT | grep -v type_transit
# setsebool -P ftpd_anon_write on
no longer blocks the write for anon user...

# sesearch -b ftpd_anon_write -ACT | grep -v type_transit
check for E for enabled on the first coloum
D for disabled
use -P for persistance , without
 

Tuesday, November 18, 2014

data sync, and server migration


Source: Solaris 10 zone M5000 server
Target: Solaris 11.2, M10 server




One of the server which had over 30TB of data was really slow. This was a zone on M5000 server with 64GB of ram. We build a new server on Sun M10 server and sync the data. rsync was really slow because it was using the 1GB throughput available on the system. However on M10 side, it has 10GB connection and out TSM back server also had 10GB connection. So we decided to use restore rather then rsync. 30 TB of data was restored and then final rsync is completed within a week. It was a wonderful experience. We used to do san to san replication but this time the storage were on different env. Server were on different env. We were copying data from prod to dev. Here is the detail how this task was completed.

on source server get the filesystem info.

You will need FS info, total size assigned to the filesystem and mountpoint.
bash-3.2# df -h | grep z01 | awk '{print $1 "\t\t\t" $2 "\t\t" $6}' >/var/tmp/FS_info.txt
z01p25/sis_appr1                        1.0T            /appsdata/dev/sis/appr1
z01p26/sis_appr2                        500G            /appsdata/dev/sis/appr2
z01p25/fmd_dev_sis_dav                  600G            /appsdata/dev/sis/davm
z01p19/distressed_wrsi                  500G            /appsdata/dev/sis/distressed_wrsi
z01p03/fdata_dev_sis_earlyindicator                     20G             /appsdata/dev/sis/earlyindicator
z01p25/fmd_dev_sis_hpaf                 100G            /appsdata/dev/sis/hpafcst
z01p11/appsdata_dev_sis_hve_monthly                     450G            /appsdata/dev/sis/hve/monthly
z01p10/appsdata_devsis_hve_monthly2                     400G            /appsdata/dev/sis/hve/monthly2
z01p06/fdata_dev_sis_hvedistress                        300G            /appsdata/dev/sis/hvedistress
z01p07/apdata_dev_sis_hvedist                   250G            /appsdata/dev/sis/hvedistress_archive
z01p18/fdata_dev_sis_hvedist_arch2                      295G            /appsdata/dev/sis/hvedistress_archive2
z01p29/fmd_dev_sis_mls                  1000G           /appsdata/dev/sis/mls
z01p13/appsdata_dev_sis_rnd                     600G            /appsdata/dev/sis/rnd
z01p07/apdata_dev_sis_rnd10                     325G            /appsdata/dev/sis/rnd10
z01p15/fmd_dev_sis_rnd11                        400G            /appsdata/dev/sis/rnd11
z01p16/appsdata_dev_sis_rnd2                    600G            /appsdata/dev/sis/rnd2

Now, seperate pool and volume info

bash-3.2# cat /var/tmp/FS_info.txt | awk '{print $2 "\t" $3}' > /var/tmp/size_n_FS.txt
bash-3.2# cd /var/tmp
bash-3.2# cat /var/tmp/size_n_FS.txt
1.0T    /appsdata/dev/sis/appr1
500G    /appsdata/dev/sis/appr2
600G    /appsdata/dev/sis/davm
500G    /appsdata/dev/sis/distressed_wrsi
20G     /appsdata/dev/sis/earlyindicator
100G    /appsdata/dev/sis/hpafcst
450G    /appsdata/dev/sis/hve/monthly
400G    /appsdata/dev/sis/hve/monthly2
300G    /appsdata/dev/sis/hvedistress
250G    /appsdata/dev/sis/hvedistress_archive
295G    /appsdata/dev/sis/hvedistress_archive2
1000G   /appsdata/dev/sis/mls
600G    /appsdata/dev/sis/rnd
325G    /appsdata/dev/sis/rnd10
400G    /appsdata/dev/sis/rnd11
600G    /appsdata/dev/sis/rnd2

bash-3.2# cat /var/tmp/FS_info.txt | awk '{print $1}'>pool_n_Vol.txt
bash-3.2# cat pool_n_Vol.txt
z01p25/sis_appr1
z01p26/sis_appr2
z01p25/fmd_dev_sis_dav
z01p19/distressed_wrsi
z01p03/fdata_dev_sis_earlyindicator
z01p25/fmd_dev_sis_hpaf
z01p11/appsdata_dev_sis_hve_monthly
z01p10/appsdata_devsis_hve_monthly2
z01p06/fdata_dev_sis_hvedistress
z01p07/apdata_dev_sis_hvedist
z01p18/fdata_dev_sis_hvedist_arch2
z01p29/fmd_dev_sis_mls
z01p13/appsdata_dev_sis_rnd
z01p07/apdata_dev_sis_rnd10
z01p15/fmd_dev_sis_rnd11
z01p16/appsdata_dev_sis_rnd2


bash-3.2# cat pool_n_Vol.txt | awk -F/ '{print $1 "\t" $2}'>pool_volume.sep.txt
bash-3.2# cat pool_volume.sep.txt
z01p25  sis_appr1
z01p26  sis_appr2
z01p25  fmd_dev_sis_dav
z01p19  distressed_wrsi
z01p03  fdata_dev_sis_earlyindicator
z01p25  fmd_dev_sis_hpaf
z01p11  appsdata_dev_sis_hve_monthly
z01p10  appsdata_devsis_hve_monthly2
z01p06  fdata_dev_sis_hvedistress
z01p07  apdata_dev_sis_hvedist
z01p18  fdata_dev_sis_hvedist_arch2
z01p29  fmd_dev_sis_mls
z01p13  appsdata_dev_sis_rnd
z01p07  apdata_dev_sis_rnd10
z01p15  fmd_dev_sis_rnd11
z01p16  appsdata_dev_sis_rnd2



bash-3.2# paste pool_volume.sep.txt size_n_FS.txt
z01p25  sis_appr1       1.0T    /appsdata/dev/sis/appr1
z01p26  sis_appr2       500G    /appsdata/dev/sis/appr2
z01p25  fmd_dev_sis_dav 600G    /appsdata/dev/sis/davm
z01p19  distressed_wrsi 500G    /appsdata/dev/sis/distressed_wrsi
z01p03  fdata_dev_sis_earlyindicator    20G     /appsdata/dev/sis/earlyindicator
z01p25  fmd_dev_sis_hpaf        100G    /appsdata/dev/sis/hpafcst
z01p11  appsdata_dev_sis_hve_monthly    450G    /appsdata/dev/sis/hve/monthly
z01p10  appsdata_devsis_hve_monthly2    400G    /appsdata/dev/sis/hve/monthly2
z01p06  fdata_dev_sis_hvedistress       300G    /appsdata/dev/sis/hvedistress
z01p07  apdata_dev_sis_hvedist  250G    /appsdata/dev/sis/hvedistress_archive
z01p18  fdata_dev_sis_hvedist_arch2     295G    /appsdata/dev/sis/hvedistress_archive2
z01p29  fmd_dev_sis_mls 1000G   /appsdata/dev/sis/mls
z01p13  appsdata_dev_sis_rnd    600G    /appsdata/dev/sis/rnd
z01p07  apdata_dev_sis_rnd10    325G    /appsdata/dev/sis/rnd10
z01p15  fmd_dev_sis_rnd11       400G    /appsdata/dev/sis/rnd11
z01p16  appsdata_dev_sis_rnd2   600G    /appsdata/dev/sis/rnd2

bash-3.2#  paste pool_volume.sep.txt size_n_FS.txt | awk '{print $2 "\t" $3 "\t" $4 "\t" $1}' >mypool_config.txt

bash-3.2# cat mypool_config.txt
sis_appr1       1.0T    /appsdata/dev/sis/appr1 z01p25
sis_appr2       500G    /appsdata/dev/sis/appr2 z01p26
fmd_dev_sis_dav 600G    /appsdata/dev/sis/davm  z01p25
distressed_wrsi 500G    /appsdata/dev/sis/distressed_wrsi       z01p19
fdata_dev_sis_earlyindicator    20G     /appsdata/dev/sis/earlyindicator        z01p03
fmd_dev_sis_hpaf        100G    /appsdata/dev/sis/hpafcst       z01p25
appsdata_dev_sis_hve_monthly    450G    /appsdata/dev/sis/hve/monthly   z01p11
appsdata_devsis_hve_monthly2    400G    /appsdata/dev/sis/hve/monthly2  z01p10
fdata_dev_sis_hvedistress       300G    /appsdata/dev/sis/hvedistress   z01p06
apdata_dev_sis_hvedist  250G    /appsdata/dev/sis/hvedistress_archive   z01p07
fdata_dev_sis_hvedist_arch2     295G    /appsdata/dev/sis/hvedistress_archive2  z01p18
fmd_dev_sis_mls 1000G   /appsdata/dev/sis/mls   z01p29
appsdata_dev_sis_rnd    600G    /appsdata/dev/sis/rnd   z01p13
apdata_dev_sis_rnd10    325G    /appsdata/dev/sis/rnd10 z01p07
fmd_dev_sis_rnd11       400G    /appsdata/dev/sis/rnd11 z01p15
appsdata_dev_sis_rnd2   600G    /appsdata/dev/sis/rnd2  z01p16

=========================================================


Get the ownership info
# df -h |grep z01 | awk '{print $6}' >/var/tmp/permission.txt

bash-3.2$ more permission.txt
drwxrwxrwx   9 sisuser  sisgrp        10 Sep 10 16:15 /appsdata/dev/sis/appr1
drwxrwxrwx   9 sisuser  sisgrp        14 Mar 19  2014 /appsdata/dev/sis/appr2
drwxrwxr-x   8 sisuser  sisgrp        10 Aug 26 16:06 /appsdata/dev/sis/davm
drwxrwxrwx   4 sisuser  sisgrp         4 Apr 18  2014 /appsdata/dev/sis/distressed_wrsi
drwxrwx---  11 sisuser  sisgrp        50 May  2  2008 /appsdata/dev/sis/earlyindicator
drwxrwxrwx   3 sisuser  sisgrp         4 Jul 12  2013 /appsdata/dev/sis/hpafcst
drwxrwx---  31 sisuser  sisgrp        35 Apr 20  2011 /appsdata/dev/sis/hve/monthly
bash-3.2$ cat permission.txt | awk '{print "chown -R " $3":"$4 "\t" $9}' >/var/tmp/chpermission.sh
$ cat chpermission.sh
chown -R sisuser:sisgrp /appsdata/dev/sis/appr1
chown -R sisuser:sisgrp /appsdata/dev/sis/appr2
chown -R sisuser:sisgrp /appsdata/dev/sis/davm
chown -R sisuser:sisgrp /appsdata/dev/sis/distressed_wrsi
chown -R sisuser:sisgrp /appsdata/dev/sis/earlyindicator
chown -R sisuser:sisgrp /appsdata/dev/sis/hpafcst
chown -R sisuser:sisgrp /appsdata/dev/sis/hve/monthly
chown -R sisuser:sisgrp /appsdata/dev/sis/hve/monthly2
chown -R sisuser:sisgrp /appsdata/dev/sis/hvedistress
chown -R sisuser:sisgrp /appsdata/dev/sis/hvedistress_archive
chown -R sisuser:sisgrp /appsdata/dev/sis/hvedistress_archive2




Now,
Calculate the size and what filesystem you want to create on what pool. We created 800 to 1200 GB pool and adjusted the
space to fit the filesystem. You copy the mypool_config.txt file to the target system and create pool and filesystem. and
also copy the chpermission.sh script and put it under /var/tmp and run it to change the permission.

==============================================================================
On target system
==============================================================================
1. Bring the luns under the OS and create pool based on the size.
vi createpool.sh
#!/bin/sh
zpool create poolv401_2 c1d11 c1d12 c1d13 c1d14 c1d15 c1d16
zpool create poolv401_3 c1d21 c1d22 c1d23 c1d24 c1d25
zpool create poolv401_4 c1d26 c1d27 c1d28 c1d29 c1d30
zpool create poolv401_5 c1d31 c1d32 c1d33 c1d34 c1d35
zpool create poolv401_6 c1d36 c1d37 c1d38 c1d39 c1d40
zpool create poolv401_7 c1d41 c1d42 c1d43 c1d44 c1d45
zpool create poolv401_8 c1d46 c1d47 c1d48 c1d49 c1d50 c1d51
zpool create poolv401_9 c1d52 c1d53 c1d54 c1d55 c1d56 c1d57
zpool create poolv401_10 c1d58 c1d59 c1d60 c1d61 c1d62
zpool create poolv401_11 c1d63 c1d64 c1d65 c1d66 c1d67
zpool create poolv401_12 c1d68 c1d69 c1d70 c1d71 c1d72 c1d73
zpool create poolv401_13 c1d74 c1d75 c1d76 c1d77 c1d78 c1d79
zpool create poolv401_14 c1d80 c1d81 c1d82 c1d83
zpool create poolv401_15 c1d84 c1d85 c1d86 c1d87 c1d88
zpool create poolv401_16 c1d89 c1d90 c1d91 c1d92 c1d93
zpool create poolv401_17 c1d94 c1d95 c1d96 c1d97 c1d98 c1d99
zpool create poolv401_18 c1d100 c1d101 c1d102 c1d103 c1d104 c1d105
zpool create poolv401_19 c1d106 c1d107 c1d108 c1d109 c1d110
zpool create poolv401_20 c1d111 c1d112 c1d113 c1d114 c1d115 c1d116
zpool create poolv401_21 c1d117 c1d118 c1d119 c1d120 c1d121
zpool create poolv401_22 c1d122 c1d123 c1d124 c1d125 c1d126 c1d127
zpool create poolv401_23 c1d128 c1d129 c1d130 c1d131 c1d132 c1d133
zpool create poolv401_24 c1d134 c1d135 c1d136 c1d137 c1d138 c1d139
zpool create poolv401_25 c1d140 c1d141 c1d142 c1d143
zpool create poolv401_26 c1d144 c1d145 c1d146 c1d147 c1d148 c1d149
zpool create poolv401_27 c1d150 c1d151 c1d152 c1d153 c1d154
zpool create poolv401_28 c1d155 c1d156 c1d157 c1d158 c1d159 c1d160
zpool create poolv401_29 c1d161 c1d162 c1d163 c1d164 c1d165 c1d166
zpool create poolv401_30 c1d167 c1d168 c1d169 c1d170 c1d171 c1d172
zpool create poolv401_31 c1d173 c1d174 c1d175 c1d176 c1d177
zpool create poolv401_32 c1d178 c1d179 c1d180 c1d181 c1d182
zpool create poolv401_33 c1d183 c1d184 c1d185 c1d186 c1d187
zpool create poolv401_34 c1d188 c1d189 c1d190 c1d191 c1d192
zpool create poolv401_35 c1d193 c1d194 c1d195


# ===================================================================


# FS      Size   MNT Point  POOL
# Pool poolv401_1 - 1T
FS_sis_appr1                        990G                    /appsdata/dev/sis/appr1 poolv401_1
#
# poolv401_2  - 1.2T
FS_sis_appr2                        500G                    /appsdata/dev/sis/appr2 poolv401_2
FS_fmd_dev_sis_dav                  600G                    /appsdata/dev/sis/davm poolv401_2
#
# poolv401_3 - 1T
FS_distressed_wrsi                  500G                    /appsdata/dev/sis/distressed_wrsi poolv401_3
FS_fdata_dev_sis_earlyindicator     20G                     /appsdata/dev/sis/earlyindicator poolv401_3
FS_appsdata_dev_sis_hve_monthly     450G                    /appsdata/dev/sis/hve/monthly poolv401_3
#
# poolv401_4  - 1T
FS_appsdata_devsis_hve_monthly2 400G                    /appsdata/dev/sis/hve/monthly2 poolv401_4
FS_fdata_dev_sis_hvedistress  300G                    /appsdata/dev/sis/hvedistress poolv401_4
FS_apdata_dev_sis_hvedist   250G                    /appsdata/dev/sis/hvedistress_archive poolv401_4
#
# poolv401_5 - 1T
FS_fmd_dev_sis_mls                  990G                   /appsdata/dev/sis/mls poolv401_5
#
# poolv401_6 - 1T
FS_fdata_dev_sis_hvedist_arch2  295G                    /appsdata/dev/sis/hvedistress_archive2 poolv401_6
FS_appsdata_dev_sis_rnd   590G                    /appsdata/dev/sis/rnd  poolv401_6
FS_fmd_dev_sis_hpaf   100G                    /appsdata/dev/sis/hpafcst poolv401_6
#
# poolv401_7 - 1T
FS_fmd_dev_sis_rnd11   390G                    /appsdata/dev/sis/rnd11  poolv401_7
FS_appsdata_dev_sis_rnd2   590G                    /appsdata/dev/sis/rnd2  poolv401_7
#
# poolv401_8 - 1.2T
FS_apdata_dev_sis_rnd10     325G                    /appsdata/dev/sis/rnd10  poolv401_8
FS_fdata_dev_sis_rnd5    375G                    /appsdata/dev/sis/rnd5  poolv401_8
FS_fdata_dev_sis_rnd6    375G                    /appsdata/dev/sis/rnd6  poolv401_8
#
# poolv401_9 - 1.2T
FS_apdata_dev_sis_rnd7    300G                    /appsdata/dev/sis/rnd7  poolv401_9
FS_fmd_dev_sis_rnd8   375G                    /appsdata/dev/sis/rnd8  poolv401_9
FS_fmd_dev_sis_rnd9    375G                    /appsdata/dev/sis/rnd9  poolv401_9
#
# poolv401_10  - 1TB
FS_fdata_dev_sis_rs                 445G                    /appsdata/dev/sis/rs  poolv401_10
FS_appsdata_dev_sis_rs_archive  295G                    /appsdata/dev/sis/rs_archive poolv401_10
FS_fmd_dev_sis_rs_arc2   245G                    /appsdata/dev/sis/rs_archive2 poolv401_10
#
# poolv401_11 - 1TB -- adjusted
FS_appsdata_dev_sis_rs_monthly  595G                    /appsdata/dev/sis/rs_monthly  poolv401_11
FS_fdata_dev_sis_rsm_arch   395G                    /appsdata/dev/sis/rs_monthly/archive poolv401_11
#
# poolv401_12  - 1.2 T
FS_fdata_dev_sis_rs_mon_rnd   275G                    /appsdata/dev/sis/rs_monthly/rnd poolv401_12
FS_fdata_dev_sis_rsmon_rnd2  375G                    /appsdata/dev/sis/rs_monthly/rnd2 poolv401_12
FS_apdata_dev_sis_seeds     375G                    /appsdata/dev/sis/seeds  poolv401_12
#
# poolv401_13 - 1.2T
FS_fmcdt_dev_sis_sds_arch   375G                    /appsdata/dev/sis/seeds_archive poolv401_13
FS_appsdata_dev_sis_work2   650G                    /appsdata/dev/sis/work2  poolv401_13
#
# poolv401_14 - 800 GB
FS_appsdata_dev_sis_work   790G                    /appsdata/dev/sis/work  poolv401_14
#
# poolv401_15 - 1TB
FS_apdata_dev_sis_work3   495G                    /appsdata/dev/sis/work3  poolv401_15
FS_fmd_dev_sis_wrsi_noreo   495G                    /appsdata/dev/sis/wrsi_noreo poolv401_15
# ------------------ Prod ----------------
# poolv401_16 - 1TB
FS_fmdt_prod_arch_1year  195G                    /appsdata/prod/archive/oneyear  poolv401_16
FS_fmdt_prod_arch_7year  195G                    /appsdata/prod/archive/sevenyear poolv401_16
FS_appsdata_prod_sis_archive  595G                    /appsdata/prod/sis/archive  poolv401_16
#
# poolv401_17  - 1.2 TB
FS_appsdata_prod_sis_arch2  595G                    /appsdata/prod/sis/archive2  poolv401_17
FS_fmd_prod_sis_archive3  595G                    /appsdata/prod/sis/archive3  poolv401_17
#
# poolv401_18 - 1.2T
FS_appsdata_prod_sis_data   400G                    /appsdata/prod/sis/data  
poolv401_18
FS_fdata_p_sishvedat_sds_rawdat  400G                    /appsdata/prod/sis/hve/data/seeds/rawdata
poolv401_18
FS_fmdp_sisd_sds_raw_firsta  300G                    /appsdata/prod/sis/hve/data/seeds/rawdata/firsta
poolv401_18
#
# poolv401_19 - 1TB
FS_fdata_p_seedsrawdat_acx   500G                    /appsdata/prod/sis/hve/data/seeds/rawdata/acxiom
poolv401_19
FS_fmdt_prd_sis_hve_dt_fdrout  250G                    /appsdata/prod/sis/hve/data/fdrout  poolv401_19
FS_fmd_prd_shve_sd2_rawd   170G                    /appsdata/prod/sis/hve/data/seeds2/rawdata
poolv401_19
#
# poolv401_20 - 1.2 TB
FS_appsdata_prod_sis_hve_retro3  400G                    /appsdata/prod/sis/hve/retro3  poolv401_20
FS_appsdata_prod_sis_nplqc   10G                     /appsdata/prod/sis/nplqc  poolv401_20
FS_apdata_prod_sis_retro10   350G                    /appsdata/prod/sis/retro10  poolv401_20
FS_fmd_prod_sis_retro11   350G                    /appsdata/prod/sis/retro11  poolv401_20
#
# poolv401_21 - 1TB
FS_fmd_prod_sis_retro12  350G                    /appsdata/prod/sis/retro12  poolv401_21
FS_appsdata_prod_sis_retro1  600G                    /appsdata/prod/sis/retro1  poolv401_21
#
# poolv401_22  - 1.2T
FS_sis_retro13    595G                    /appsdata/prod/sis/retro13  poolv401_22
FS_appsdata_prod_sis_retro2  595G                    /appsdata/prod/sis/retro2  poolv401_22
#
# poolv401_23 - 1.2T
FS_fdata_prod_sis_retro4    595G                    /appsdata/prod/sis/retro4  poolv401_23
FS_appsdata_data_sis_retro5  595G                    /appsdata/prod/sis/retro5  poolv401_23
#
# poolv401_24  - 1.2T
FS_appsdata_prod_sis_retro6  595G                    /appsdata/prod/sis/retro6  poolv401_24
FS_appsdata_prod_sis_retro7  595G                    /appsdata/prod/sis/retro7  poolv401_24
#
# poolv401_25 - 800GB
FS_appsdata_prod_sis_retro8   350G                    /appsdata/prod/sis/retro8 poolv401_25
FS_apdata_prod_sis_retro9  350G                    /appsdata/prod/sis/retro9 poolv401_25
#
# poolv401_26  - 1.2TB
FS_sis     22G                     /sis  poolv401_26
FS_sis_cbrtr     250G                    /sis/cbrtr poolv401_26
FS_sis_hve      700G                    /sis/hve poolv401_26
FS_sis_income    150G                    /sis/income poolv401_26
#
# poolv401_27 - 1TB
FS_sis_hve_archive   595G                    /sis/hve/archive poolv401_27
FS_sis_hve_archive2     395G                    /sis/hve/archive2 poolv401_27
#
# poolv401_28  - 1.2TB
FS_sis_hve_data   495G                    /sis/hve/data  poolv401_28
FS_sis_hve_data_acxiom   195G                    /sis/hve/data/acxiom poolv401_28
FS_sis_hve_data_comps   195G                    /sis/hve/data/comps poolv401_28
FS_appraise_latest      299G                    /sis/hve/data/property/appraisal/latest  poolv401_28
#
# poolv401_29  - 1.2TB
FS_sis_hve_data_firsta      200G                    /sis/hve/data/firsta   poolv401_29
FS_sis_hve_data_property_firsta   390G                    /sis/hve/data/property/firsta  poolv401_29
FS_sis_hve_data_p_fir_rawdata    600G                    /sis/hve/data/property/firsta/rawdata poolv401_29
#
# poolv401_30  - 1.2TB
FS_firsta_latest                    300G                    /sis/hve/data/property/firsta/latest
poolv401_30
FS_sis_hve_data_prop_fir_pscrub    500G                    /sis/hve/data/property/firsta/prescrub
poolv401_30
FS_sis_hve_data_prop_idm     300G                    /sis/hve/data/property/idm  poolv401_30
#
# poolv401_31 - 1TB
FS_idm_latest     300G                    /sis/hve/data/property/idm/latest poolv401_31
FS_sis_hve_data_prop_idm_prescr   275G                    /sis/hve/data/property/idm/prescrub poolv401_31
FS_sis_hve_data_rs   400G                    /sis/hve/data/rs   poolv401_31
#
# poolv401_32 - 1TB
FS_sis_hve_data_prop_idm_rawdat  495G                    /sis/hve/data/property/idm/rawdata poolv401_32
FS_sis_hve_retro    495G                    /sis/hve/retro    poolv401_32
#
# poolv401_33 - 1TB
FS_sis_hve_data_seeds    250G                    /sis/hve/data/seeds  poolv401_33
FS_sis_hve_data_seeds_raw    280G                    /sis/hve/data/seeds/raw  poolv401_33
FS_sis_hve_distress  300G                    /sis/hve/distress  poolv401_33
FS_sis_hve_ffs    5.0G                    /sis/hve/ffs   poolv401_33
#
# poolv401_34 - 1TB
FS_sis_hve_forecast   300G                    /sis/hve/forecast  poolv401_34
FS_sis_hve_hedonic   140G                    /sis/hve/hedonic  poolv401_34
FS_sis_hve_rnd2   350G                    /sis/hve/rnd2   poolv401_34
FS_sis_hve_tablescrap          150G                    /sis/hve/tablescrap  poolv401_34
#
# poolv401_35 - 600GB
FS_sis_hve_testdata    300G                    /sis/hve/testdata poolv401_35
FS_sis_rnd     200G                    /sis/rnd  poolv401_35
# ================================================================================
# df -h | grep z01 | awk '{print $1 "\t\t\t" $2 "\t\t\t" $6}'
# for i in `cat /tmp/a`; do df -h $i | tail -1; done



Once your config file is ready use the following script to create fs.

Copy the following script to /var/tmp and run the script
# cd /var/tmp; vi create_zfs.sh; chmod u+x create_zfs.sh; ./create_zfs.sh


# cat var/tmp/create_zfs.sh
#!/bin/sh
# Sam Bhusal; Only for personal use
# Automate FS creation task using zfs. This script tested and verified on Solaris 10.
# Mon Feb 24 12:13:24 EST 2014
# Update: Thu Aug 14 09:55:12 EDT 2014
#
# This is a config file for sybase FS.
# Volume       Size (GB) mPoint         pool
#-------------------------------------------------------
#FS_opt_oracle  10G     /opt/oracle     z01p03
#opt_sasbi      25G     /opt/sasbi      z01p03
#pkgs           50G     /pkgs           z01p03
if [ `/usr/bin/whoami` != "root" ]
then
        echo "You must be root to run this script"
        exit 1
fi
# Creating LVM.
# Read the config file
/bin/cat mypool_config.txt | grep -v "^#" | while read myvol mysize mymnt mypool
do
        # create FS
        zfs create -o mountpoint=${mymnt} -o quota=${mysize} ${mypool}/${myvol}
#       zfs create -o mountpoint=/tmp/abcde -o quota=10G poolv401_1/FS_TMP_ABCDE
# For raw device
#       zfs create -V ${mysize} ${mypool}/${myvol}
        # Check the condition if the process is successful.
        if [ $? -eq 0 ]; then
                echo "Successfully Created ${mymnt} fileystem on ${mypool} pool."
                df -h ${mymnt}
                continue
        else
                echo "Failed, please review the error"
                # exit
        fi
echo " ----------------end----------------"
done
# Backout Plan
# List your LVMs
# zfs list
# zfs destroy /dev/${myvg}/${myfs}



Once fs are created, verify each and everything such as size, mountpoint.
then change the ownership. to change it run the script.
./chpermission.sh
done