Tuesday, May 24, 2011

How to create file system in AIX

1) Create Log LV (filesystem type jfs2 need loglv for journaling)

Ex:

mklv -y loglvarchive -t jfs2log appvg 1


2) Create LV (Create Logical Volume with filesystem type jfs2)

Ex:

mklv -y lvarchive -t jfs2 appvg 500M


3) Create FileSystem

Ex:

crfs -v jfs2 -d /dev/lvarchive -a log=/dev/loglvarchive -m /Archive

4) Mount the file system

Ex:

mount /Archive


Full Example

PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 546 325 30..08..69..109..109
hdisk1 active 546 325 30..08..69..109..109
rdmsdweb:/# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 1.00 0.77 24% 2720 2% /
/dev/hd2 3.00 1.18 61% 36458 12% /usr
/dev/hd9var 0.50 0.41 19% 4442 5% /var
/dev/hd3 7.00 6.67 5% 174 1% /tmp
/dev/fwdump 0.25 0.25 1% 4 1% /var/adm/ras/platform
/dev/hd1 0.25 0.25 1% 27 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.25 0.20 21% 946 2% /opt
/dev/lvfix 10.00 4.37 57% 653 1% /fix
/dev/lvsapmnt 10.00 9.53 5% 708 1% /sapmnt/WDD
/dev/lvusrsap 15.00 14.86 1% 251 1% /usr/sap/WDD
/dev/lvinstcd 20.00 13.28 34% 20289 1% /instcd
/dev/lvscript 1.00 0.65 35% 1921 2% /script
/dev/lvperfdata 1.00 1.00 1% 5 1% /perfdata
rdmsdweb:/# lsvg appvg
VOLUME GROUP: appvg VG IDENTIFIER: 00027c120000d7000000010e98d2197a
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1092 (279552 megabytes)
MAX LVs: 512 FREE PPs: 650 (166400 megabytes)
LVs: 9 USED PPs: 442 (113152 megabytes)
OPEN LVs: 9 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per VG: 130048
MAX PPs per PV: 1016 MAX PVs: 128
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
rdmsdweb:/# lsvg -o | lsvg -i -l
appvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
paging00 paging 8 16 2 open/syncd N/A
paging02 paging 8 16 2 open/syncd N/A
paging04 paging 8 16 2 open/syncd N/A
paging06 paging 8 16 2 open/syncd N/A
paging08 paging 8 16 2 open/syncd N/A
lvsapmnt jfs2 40 80 2 open/syncd /sapmnt/WDD
lvusrsap jfs2 60 120 2 open/syncd /usr/sap/WDD
lvinstcd jfs2 80 160 2 open/syncd /instcd
loglv00 jfs2log 1 2 2 open/syncd N/A
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 8 8 1 open/syncd N/A
hd8 jfs2log 1 1 1 open/syncd N/A
hd4 jfs2 4 4 1 open/syncd /
hd2 jfs2 12 12 1 open/syncd /usr
hd9var jfs2 2 2 1 open/syncd /var
hd3 jfs2 28 28 1 open/syncd /tmp
hd1 jfs2 1 1 1 open/syncd /home
hd10opt jfs2 1 1 1 open/syncd /opt
fwdump jfs2 1 1 1 open/syncd /var/adm/ras/platform
lvfix jfs2 40 40 1 open/syncd /fix
paging01 paging 8 8 1 open/syncd N/A
paging03 paging 8 8 1 open/syncd N/A
paging05 paging 8 8 1 open/syncd N/A
paging07 paging 8 8 1 open/syncd N/A
lvscript jfs2 4 4 1 open/syncd /script
lvperfdata jfs2 4 4 1 open/syncd /perfdata
rdmsdweb:/# mklv -y loglvarchive -t jfs2log appvg 1
loglvarchive
rdmsdweb:/# mklv -y lvarchive -t jfs2 appvg 500M
lvarchive
rdmsdweb:/# lsvg -o | lsvg -i -l
appvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
paging00 paging 8 16 2 open/syncd N/A
paging02 paging 8 16 2 open/syncd N/A
paging04 paging 8 16 2 open/syncd N/A
paging06 paging 8 16 2 open/syncd N/A
paging08 paging 8 16 2 open/syncd N/A
lvsapmnt jfs2 40 80 2 open/syncd /sapmnt/WDD
lvusrsap jfs2 60 120 2 open/syncd /usr/sap/WDD
lvinstcd jfs2 80 160 2 open/syncd /instcd
loglv00 jfs2log 1 2 2 open/syncd N/A
loglvarchive jfs2log 1 1 1 closed/syncd N/A
lvarchive jfs2 2 2 1 closed/syncd N/A
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 8 8 1 open/syncd N/A
hd8 jfs2log 1 1 1 open/syncd N/A
hd4 jfs2 4 4 1 open/syncd /
hd2 jfs2 12 12 1 open/syncd /usr
hd9var jfs2 2 2 1 open/syncd /var
hd3 jfs2 28 28 1 open/syncd /tmp
hd1 jfs2 1 1 1 open/syncd /home
hd10opt jfs2 1 1 1 open/syncd /opt
fwdump jfs2 1 1 1 open/syncd /var/adm/ras/platform
lvfix jfs2 40 40 1 open/syncd /fix
paging01 paging 8 8 1 open/syncd N/A
paging03 paging 8 8 1 open/syncd N/A
paging05 paging 8 8 1 open/syncd N/A
paging07 paging 8 8 1 open/syncd N/A
lvscript jfs2 4 4 1 open/syncd /script
lvperfdata jfs2 4 4 1 open/syncd /perfdata
rdmsdweb:/# crfs -v jfs2 -d /dev/lvarchive -a log=/dev/loglvarchive -m /Archive
File system created successfully.
524068 kilobytes total disk space.
New File System size is 1048576
rdmsdweb:/# mount /Archive
rdmsdweb:/# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 1.00 0.77 24% 2725 2% /
/dev/hd2 3.00 1.18 61% 36458 12% /usr
/dev/hd9var 0.50 0.41 19% 4443 5% /var
/dev/hd3 7.00 6.67 5% 174 1% /tmp
/dev/fwdump 0.25 0.25 1% 4 1% /var/adm/ras/platform
/dev/hd1 0.25 0.25 1% 27 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.25 0.20 21% 946 2% /opt
/dev/lvfix 10.00 4.37 57% 653 1% /fix
/dev/lvsapmnt 10.00 9.53 5% 708 1% /sapmnt/WDD
/dev/lvusrsap 15.00 14.86 1% 251 1% /usr/sap/WDD
/dev/lvinstcd 20.00 13.28 34% 20289 1% /instcd
/dev/lvscript 1.00 0.65 35% 1921 2% /script
/dev/lvperfdata 1.00 1.00 1% 5 1% /perfdata
/dev/lvarchive 0.50 0.50 1% 4 1% /Archive
rdmsdweb:/# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 1024.00 783.95 24% 2725 2% /
/dev/hd2 3072.00 1206.83 61% 36458 12% /usr
/dev/hd9var 512.00 414.84 19% 4443 5% /var
/dev/hd3 7168.00 6832.02 5% 174 1% /tmp
/dev/fwdump 256.00 255.64 1% 4 1% /var/adm/ras/platform
/dev/hd1 256.00 255.50 1% 27 1% /home
/proc - - - - - /proc
/dev/hd10opt 256.00 204.74 21% 946 2% /opt
/dev/lvfix 10240.00 4470.87 57% 653 1% /fix
/dev/lvsapmnt 10240.00 9754.66 5% 708 1% /sapmnt/WDD
/dev/lvusrsap 15360.00 15215.25 1% 251 1% /usr/sap/WDD
/dev/lvinstcd 20480.00 13600.27 34% 20289 1% /instcd
/dev/lvscript 1024.00 667.59 35% 1921 2% /script
/dev/lvperfdata 1024.00 1020.51 1% 5 1% /perfdata
/dev/lvarchive 512.00 511.60 1% 4 1% /Archive
rdmsdweb:/# ls- lrt
ksh: ls-: not found.
rdmsdweb:/# ls -lrt
total 2336
drwxr-x--- 2 root audit 256 Jul 08 2006 audit
drwxr-xr-x 2 bin bin 256 Jul 08 2006 mnt
drwxrwxr-x 3 root system 256 Jul 08 2006 .SPOT
drwxrwxr-x 2 root system 256 Jul 08 2006 tftpboot
drwxr-xr-x 3 root system 256 Jul 08 2006 mfg
drwxr-xr-x 2 root system 256 Oct 09 2006 cdrom
drwx------ 3 root system 256 Oct 10 2006 .ssh2
-rw-r----- 1 root system 479 Nov 01 2006 sdtstart.err
drwxr-x--- 3 root system 256 Nov 01 2006 .java
drwxr-xr-x 4 root system 256 Nov 01 2006 sapmnt
drwxr-x--- 2 root system 4096 Nov 01 2006 .sdtgui
-rw-r--r-- 1 root system 9 Feb 06 2007 hn
drwxr-xr-x 6 root system 256 Apr 30 2008 instcd
drwxr-xr-x 2 root system 4096 Apr 30 2008 EMP
-rw------- 1 root system 416 Jul 08 2008 .Xauthority
-rw-r--r-- 1 root system 160 Jul 08 2008 .profile
-rwxr--r-- 1 root system 700 Nov 14 2009 dormant.sh
-rw------- 1 root system 166 Nov 14 2009 .vi_history
-rw-r--r-- 1 root system 1323 Jan 05 17:30 bosinst.data
-rw-r--r-- 1 root system 13610 Jan 05 17:30 image.data.save.altinst
-rw-r--r-- 1 root system 0 Jan 05 18:24 .image.data.removetag
drwx------ 2 root system 256 Jan 05 18:25 lost+found
drwxr-xr-x 11 root system 4096 Jan 05 18:25 fix
drwxr-xr-x 5 bin bin 256 Jan 05 18:25 home
drwxr-xr-x 3 root system 256 Jan 05 18:25 perfdata
drwxr-xr-x 4 root system 4096 Jan 05 18:25 script
drwxr-xr-x 24 bin bin 4096 Jan 05 18:25 var
lrwxrwxrwx 1 bin bin 8 Jan 05 18:25 bin -> /usr/bin
lrwxrwxrwx 1 bin bin 8 Jan 05 18:28 lib -> /usr/lib
lrwxrwxrwx 1 root system 6 Jan 05 18:30 secure -> secure
lrwxrwxrwx 1 root system 21 Jan 05 18:30 unix -> /usr/lib/boot/unix_64
lrwxrwxrwx 1 bin bin 5 Jan 05 18:30 u -> /home
drwxr-xr-x 42 root staff 4096 Jan 06 11:25 usr
drwxr-xr-x 13 root system 4096 Jan 06 11:30 opt
drwxr-xr-x 3 bin bin 256 Jan 06 11:30 sbin
-rw-r--r-- 1 root system 22096 Jan 06 11:43 smit.transaction
-rw-r--r-- 1 root system 12123 Jan 06 11:43 smit.script
drwxr-xr-x 158 bin bin 12288 Jan 06 11:47 lpp
-rw-r--r-- 1 root system 1030903 Jan 06 11:47 smit.log
drwxr-xr-x 29 root system 12288 Jan 06 11:51 etc
drwxr-xr-x 3 root system 256 May 19 16:09 Archive
drwxrwxrwt 14 bin bin 4096 May 19 16:09 tmp
drwxrwxr-x 5 root system 12288 May 19 16:09 dev
dr-xr-xr-x 1 root system 0 May 19 16:12 proc
-rw------- 1 root system 10306 May 19 16:12 .sh_history
rdmsdweb:/# chown wddadm Archive
rdmsdweb:/# chgrp sapsys Archive
rdmsdweb:/# ls -lrt
total 2336
drwxr-x--- 2 root audit 256 Jul 08 2006 audit
drwxr-xr-x 2 bin bin 256 Jul 08 2006 mnt
drwxrwxr-x 3 root system 256 Jul 08 2006 .SPOT
drwxrwxr-x 2 root system 256 Jul 08 2006 tftpboot
drwxr-xr-x 3 root system 256 Jul 08 2006 mfg
drwxr-xr-x 2 root system 256 Oct 09 2006 cdrom
drwx------ 3 root system 256 Oct 10 2006 .ssh2
-rw-r----- 1 root system 479 Nov 01 2006 sdtstart.err
drwxr-x--- 3 root system 256 Nov 01 2006 .java
drwxr-xr-x 4 root system 256 Nov 01 2006 sapmnt
drwxr-x--- 2 root system 4096 Nov 01 2006 .sdtgui
-rw-r--r-- 1 root system 9 Feb 06 2007 hn
drwxr-xr-x 6 root system 256 Apr 30 2008 instcd
drwxr-xr-x 2 root system 4096 Apr 30 2008 EMP
-rw------- 1 root system 416 Jul 08 2008 .Xauthority
-rw-r--r-- 1 root system 160 Jul 08 2008 .profile
-rwxr--r-- 1 root system 700 Nov 14 2009 dormant.sh
-rw------- 1 root system 166 Nov 14 2009 .vi_history
-rw-r--r-- 1 root system 1323 Jan 05 17:30 bosinst.data
-rw-r--r-- 1 root system 13610 Jan 05 17:30 image.data.save.altinst
-rw-r--r-- 1 root system 0 Jan 05 18:24 .image.data.removetag
drwx------ 2 root system 256 Jan 05 18:25 lost+found
drwxr-xr-x 11 root system 4096 Jan 05 18:25 fix
drwxr-xr-x 5 bin bin 256 Jan 05 18:25 home
drwxr-xr-x 3 root system 256 Jan 05 18:25 perfdata
drwxr-xr-x 4 root system 4096 Jan 05 18:25 script
drwxr-xr-x 24 bin bin 4096 Jan 05 18:25 var
lrwxrwxrwx 1 bin bin 8 Jan 05 18:25 bin -> /usr/bin
lrwxrwxrwx 1 bin bin 8 Jan 05 18:28 lib -> /usr/lib
lrwxrwxrwx 1 root system 6 Jan 05 18:30 secure -> secure
lrwxrwxrwx 1 root system 21 Jan 05 18:30 unix -> /usr/lib/boot/unix_64
lrwxrwxrwx 1 bin bin 5 Jan 05 18:30 u -> /home
drwxr-xr-x 42 root staff 4096 Jan 06 11:25 usr
drwxr-xr-x 13 root system 4096 Jan 06 11:30 opt
drwxr-xr-x 3 bin bin 256 Jan 06 11:30 sbin
-rw-r--r-- 1 root system 22096 Jan 06 11:43 smit.transaction
-rw-r--r-- 1 root system 12123 Jan 06 11:43 smit.script
drwxr-xr-x 158 bin bin 12288 Jan 06 11:47 lpp
-rw-r--r-- 1 root system 1030903 Jan 06 11:47 smit.log
drwxr-xr-x 29 root system 12288 Jan 06 11:51 etc
drwxr-xr-x 3 wddadm sapsys 256 May 19 16:09 Archive
drwxrwxrwt 14 bin bin 4096 May 19 16:09 tmp
drwxrwxr-x 5 root system 12288 May 19 16:09 dev
dr-xr-xr-x 1 root system 0 May 19 16:13 proc
-rw------- 1 root system 10360 May 19 16:13 .sh_history
rdmsdweb:/# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 1.00 0.77 24% 2725 2% /
/dev/hd2 3.00 1.18 61% 36458 12% /usr
/dev/hd9var 0.50 0.41 19% 4443 5% /var
/dev/hd3 7.00 6.67 5% 174 1% /tmp
/dev/fwdump 0.25 0.25 1% 4 1% /var/adm/ras/platform
/dev/hd1 0.25 0.25 1% 27 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.25 0.20 21% 946 2% /opt
/dev/lvfix 10.00 4.37 57% 653 1% /fix
/dev/lvsapmnt 10.00 9.53 5% 708 1% /sapmnt/WDD
/dev/lvusrsap 15.00 14.86 1% 251 1% /usr/sap/WDD
/dev/lvinstcd 20.00 13.28 34% 20289 1% /instcd
/dev/lvscript 1.00 0.65 35% 1921 2% /script
/dev/lvperfdata 1.00 1.00 1% 5 1% /perfdata
/dev/lvarchive 0.50 0.50 1% 4 1% /Archive

No comments:

Post a Comment