IA/System Admin

HP SnA 3일차 오후 - M8. 파일시스템 관리

kiostory 2012. 6. 20. 17:07

# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1048576  235880  806368   23% /
/dev/vg00/lvol1    1835008  190792 1631456   10% /stand
/dev/vg00/lvol8    4587520  460272 4102568   10% /var
/dev/vg00/lvol7    6856704 3225072 3603336   47% /usr
/dev/vg00/lvol6    1179648   20840 1149760    2% /tmp
/dev/vg00/lvol5    10723328 5690976 4993104   53% /opt
/dev/vg00/lvol4    1179648   21848 1148856    2% /home

root@rx233   [/]
# mount -v
/dev/vg00/lvol3 on / type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000003 on Mon Jun 18 15:37:54 2012
/dev/vg00/lvol1 on /stand type vxfs ioerror=mwdisable,nolargefiles,log,tranflush,dev=40000001 on Mon Jun 18 15:37:59 2012
/dev/vg00/lvol8 on /var type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000008 on Mon Jun 18 15:38:26 2012
/dev/vg00/lvol7 on /usr type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000007 on Mon Jun 18 15:38:26 2012
/dev/vg00/lvol6 on /tmp type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000006 on Mon Jun 18 15:38:26 2012
/dev/vg00/lvol5 on /opt type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000005 on Mon Jun 18 15:38:26 2012
-hosts on /net type autofs ignore,indirect,nosuid,soft,nobrowse,dev=4000002 on Mon Jun 18 15:38:54 2012
/dev/vg00/lvol4 on /home type vxfs ioerror=mwdisable,largefiles,delaylog,dev=40000004 on Tue Jun 19 10:19:20 2012

root@rx233   [/]

# cd /etc/default

# cat fs
LOCAL=vxfs

root@rx233   [/etc/default]


# fstyp -v /dev/vg00/lvol4  --> 슈퍼블럭 정보 보기
vxfs   --> 파일시스템 타입
version: 6
f_bsize: 8192   --> system 권고 블럭사이즈
f_frsize: 8192  --> 실제 블럭 사이즈
f_blocks: 147456
f_bfree: 144725
f_bavail: 143595
f_files: 36704
f_ffree: 36160
f_favail: 36160
f_fsid: 1073741828
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 16
f_fsindex: 9
f_size: 147456

root@rx233   [/etc/default]


# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1048576  235472  806776   23% /
/dev/vg00/lvol1    1835008  190792 1631456   10% /stand
/dev/vg00/lvol8    4587520  460272 4102576   10% /var
/dev/vg00/lvol7    6856704 3225072 3603336   47% /usr
/dev/vg00/lvol6    1179648   20840 1149760    2% /tmp
/dev/vg00/lvol5    10723328 5690976 4993104   53% /opt
/dev/vg00/lvol4    1179648   21848 1148856    2% /home

 

** LINK

1) hard link : # ln

                 --> 여러이름(a,b...), 동일데이터(inode, data)를 가리킴

                 --> 하나 삭제해도 상관없다

                 --> 동일 파일시스템 내에서만 사용가능

                 --> 디렉토리를 하드링크로 만들지 못함

2) Symbolic : # ln -s

                 --> 여러이름, 링크하고 있는 파일을 가리킴

                 --> 원본 삭제하면 링크가 쓸모없다. 원본이 없으니...링크는 존재하긴 한다.

 

하드링크

root@rx233   [/home]
# cd /

root@rx233   [/]
# touch fileA

root@rx233   [/]
# ll fileA
-rw-r--r--   1 root       sys              0 Jun 20 16:45 fileA

root@rx233   [/]
# ll -i fileA
  2520 -rw-r--r--   1 root       sys              0 Jun 20 16:45 fileA

root@rx233   [/]
# ln fileA fileA.ln

root@rx233   [/]
# ll -i fileA*
  2520 -rw-r--r--   2 root       sys              0 Jun 20 16:45 fileA
  2520 -rw-r--r--   2 root       sys              0 Jun 20 16:45 fileA.ln

root@rx233   [/]
# echo "inode no is the same"
inode no is the same

root@rx233   [/]
# echo "file type is the same"
file type is the same

root@rx233   [/]
# echo " link count is the same"
 link count is the same

root@rx233   [/]
# echo "file size is the same"
file size is the same

root@rx233   [/]
# echo " file link count is increased from 1 to 2"
 file link count is increased from 1 to 2

root@rx233   [/]
# echo hello >> fileA.ln

root@rx233   [/]
# ll -i fileA*
  2520 -rw-r--r--   2 root       sys              6 Jun 20 16:48 fileA
  2520 -rw-r--r--   2 root       sys              6 Jun 20 16:48 fileA.ln

root@rx233   [/]
# cat fileA*
hello
hello

root@rx233   [/]

# rm fileA

root@rx233   [/]
# ll -i fileA*
  2520 -rw-r--r--   1 root       sys              6 Jun 20 16:48 fileA.ln

 

심볼릭링크

# touch fileA

root@rx233   [/]
# ln -s fileA fileA.sym

root@rx233   [/]
# ll -i fileA*        
  2520 -rw-r--r--   1 root       sys              0 Jun 20 16:56 fileA
  2525 lrwxr-xr-x   1 root       sys              5 Jun 20 16:57 fileA.sym -> fileA

 

# swlist |grep -i jfs
  B3929FB               B.05.00.02     onlineJFS for Veritas File System 5.0 Bundle

 

 

# cat /etc/fstab
# System /etc/fstab file.  Static information about the file systems
# See fstab(4) and sam(1M) for further details on configuring devices.
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand vxfs tranflush 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2