bajt na
inode;
opcii -c ili -l nuzhny dlya ukazaniya
togo, vyvodit' li informaciyu v formate
kolonok ili stanz, sootvetstvenno;
opcii -v
ili -u ispol'zuyutsya dlya ukazaniya
neobhodimosti vyvoda informacii tol'ko ob
opredelennyh fajlovyh sistemah (v
zavisimosti ot tipa ili tochki montirovaniya,
sootvetstvenno).
Ukazanie v komande lsfs imeni opredelennoj fajlovoj sistemy vyvedet informaciyu tol'ko o trebuemoj fajlovoj sisteme. Dlya polucheniya etoj zhe informacii vy mozhete ispol'zovat' komandu smit fs.
Komanda mount ispol'zuemaya bez parametrov vyvodit spisok vseh smontrovannyh v tekushchij moment fajlovyh sistem.
# mount
node | mounted | mounted over | vfs | date | options |
/dev/hd4 | / | jfs | Jul 11 20:14 | rw,log=/dev/hd8 | |
/dev/hd2 | /usr | jfs | Jul 11 20:15 | rw,log=/dev/hd8 | |
/dev/hd9var | /var | jfs | Jul 11 20:15 | rw,log=/dev/hd8 | |
/dev/hd3 | /tmp | jfs | Jul 11 20:15 | rw,log=/dev/hd8 | |
/dev/hd1 | /home | jfs | Jul 11 20:16 | rw,log=/dev/hd8 | |
/dev/lv00 | /home/john | jfs | Jul 11 20:16 | rw,log=/dev/hd8 |
S pomoshch'yu SMIT mozhno poluchit' etu informaciyu vybrav:
SMIT -> File System -> List all Mounted File Systems
Dlya sozdaniya fajlovoj sistemy na predvaritel'no opredelennom logicheskom tome rekomenduetsya ispol'zovat' instrument SMIT, kotoryj da£t vysokij uroven' kontrolya za ukazaniem vseh neobhodimyh parametrov i pozvolyaet izbezhat' oshibok pri sozdanii fajlovoj sistemy.
|tot process formatiruet logicheskij tom dlya ispol'zovaniya fajlovoj sistemoj.
# smit crjfslv
Add a File System on a Previously Defined Logical Volume
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* LOGICAL VOLUME name
* MOUNT POINT
[]
+
Mount AUTOMATICALLY at system
restart no
+
PERMISSIONS
read/write
+
Mount OPTIONS
[]
+
Start Disk Accounting?
no
+
Fragment Size (bytes) 4096
+
Number of bytes per inode
4096
+
Compression algorithm
no
+
F1=Help
F2=Refresh
F3=Cancel
F4=List
F5=Reset
F6=Command
F7=Edit
F8=Image
F9=Shell
F10=Exit
Enter=Do
# smit crjfs
Add a Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Volume group name
rootvg
* SIZE of file system (in 512-byte blocks)
[]
#
* MOUNT POINT
[]
Mount AUTOMATICALLY at system restart
no
+
PERMISSIONS
read/write
+
Mount OPTIONS
[]
+
Start Disk Accounting?
no
+
Fragment Size (bytes) 4096
Number of bytes per inode
4096
Compression algorithm
no
F1=Help
F2=Refresh
F3=Cancel
F4=List
F5=Reset
F6=Command
F7=Edit
F8=Image
F9=Shell
F10=Exit
Enter=Do
Dlya sozdaniya zhurnal'noj fajlovoj sistemy, krome SMIT, vy mozhete vospol'zovat'sya vysokourovnevoj komandoj crfs s ukazaniem neobhodimyh parametrov.
Ne putajte komandu crfs s komandoj mkfs. V otlichie ot komandy mkfs, komanda crfs sozda£t, esli eto neobhodimo, logicheskij tom ispol'zuya komandu mklv, zatem stroit na n£m strukturu fajlovoj sistemy, ispol'zuya komandu mkfs i proizvodit vse neobhodimye izmeneniya v baze ODM i fajle /etc/filesytems dlya sootvetstvuyushchih logicheskogo toma i fajlovoj sistemy.
Pri sozdanii zhurnal'noj fajlovoj sistemy s pomoshch'yu komandy crfs vy dolzhny budete ukazat':
-g volgrp - imya gruppy tomov, na kotoroj
budet sozdan logicheskij tom. Konechno, eta
gruppa tomov dolzhna imet' neobhodimoe
svobodnoe prostranstvo dlya sozdaniya novogo
logicheskogo toma;
-a size=SIZE - razmer fajlovoj sistemy v 512-ti
bajtovyh blokah;
-m mntpt - tochka montirovaniya fajlovoj
sistemy (imya direktorii v sushchestvuyushchej
fajlovoj sisteme). V osnovnom tochka
montirovaniya ne ukazyvaetsya;
-a yes|no - ukazanie neobhodimosti
avtomontirovaniya novoj fajlovoj sistemy
pri perezapuske sistemy. Pri ukazannoj
tochke montirovaniya po umolchaniyu (sm. vyshe)
fajlovaya sistema mozhet byt' pomechena kak
avtomontiruemaya. Ob etom delaetsya zapis'
mount=true v stanze fajlovoj sistemy fajla /etc/filesystems.
-p rw|ro - rezhim dostupa. Vse fajlovye
sistemy mogut byt' smontirovany s rezhimom
dostupa chtenie/zapis' (rw) ili tol'ko dlya
chteniya (ro). Dopolnitel'nym vyborom dlya
montirovaniya fajlovoj sistemy (Mount Options)
mozhet byt' ukazanie na zapreshchenie
vypolneniya setuid i setgid programm (vybor nosuid)
ili zapreshchenie otkryvat' sistemnye vyzovy
ustrojstv s fajlovyh sistem s etoj tochkoj
montirovaniya (vybor nodev).
-a fragment=size - ukazanie razmera fragmenta
zhurnal'noj fajlovoj sistemy v bajtah.
Razmer fragmenta mozhet prinimat' znacheniya
512, 1024, 2048 ili 4096. Znachenie po umolchaniyu - 4096
bajt.
-a nbpl=value - ukazanie kolichestva bajt na
odin inode. Vliyaet na obshchee kolichestvo inodes v
fajlovoj sisteme. |tot parametr mozhet imet'
znacheniya 512, 1024, 2048, 4096, 8192 ili 16384. Znachenie po
umolchaniyu - 4096 bajt.
-a compress={no|LZ} - ukazanie algoritma
kompressii dlya fajlovoj sistemy. Znachenie
po umolchaniyu - no.
# smit mountfs
Mount a File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
FILE SYSTEM name
[]
DIRECTORY over which to mount
[]
TYPE of file system
FORCE the mount?
no
REMOTE NODE containing the file system
to mount
[]
Mount as a REMOVABLE file system?
no
Mount as a READ-ONLY system?
no
Disallow DEVICE access via this mount?
no
Disallow execution of SUID and sgid programs
in this file system?
no
F1=Help
F2=Refresh
F3=Cancel
F4=List
F5=Reset
F6=Command
F7=Edit
F8=Image
F9=Shell
F10=Exit
Enter=Do
Obychnye pol'zovateli mogut montirovat' fajlovye sistemy, esli oni yavlyayutsya chlenami gruppy system i imeyut prava dostupa na zapis' v tochke montirovaniya.
Sistemnye administratory dlya montirovaniya fajlovyh sistem takzhe dolzhny imet' prava dostupa na zapis' v tochke montirovaniya, no pri etom tochki montirovaniya dolzhny byt' opredeleny v fajle /etc/filesystems.
Pol'zovatel' root mozhet montirovat' fajlovye sistemy v lyubom meste ierarhii direktorij v nezavisimosti ot ustanovlennyh prav dostupa.
Change/Show Characteristics of a Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
File system name
/home
NEW mount point
[/home]
SIZE of file system (in 512-byte blocks)[8192]
Mount GROUP
[]
Mount AUTOMATICALLY at system restart
yes
+
PERMISSIONS
read/write
+
Mount OPTIONS
[]
+
Fragment Size (bytes) 4096
Number of bytes per inode
4096
Compression algorithm
no
F1=Help
F2=Refresh
F3=Cancel
F4=List
F5=Reset
F6=Command
F7=Edit
F8=Image
F9=Shell
F10=Exit
Enter=Do
Razmer zhurnal'noj fajlovoj sistemy mozhet byt' uvelichen v lyuboe vremya (pri etom avtomaticheski uvelichivaetsya razmer logicheskogo toma). Tol'ko takuyu operaciyu nel'zya delat' dlya umen'sheniya e£ razmera.
Pri neobhodimosti umen'shit' razmer fajlovoj sistemy luchshim vyhodom yavlyaetsya sozdanie novoj fajlovoj sistemy nuzhnogo razmera s udaleniem staroj.
Dlya udaleniya zhurnal'noj fajlovoj sistemy, krome sredstv SMIT, vy mozhete vospol'zovat'sya vysokourovnevoj komandoj rmfs. |ta komanda, naryadu s udaleniem samoj fajlovoj sistemy, udalyaet vsyu informaciyu o nej iz bazy dannyh ODM i fajla /etc/filesystems. Kogda udalyaetsya fajlovaya sistema, to takzhe udalyaetsya i logicheskij tom, na kotorom ona nahodilas'.
Zadachi administratora po upravleniyu diskovym prostranstvom fajlovyh sistem sleduyushchie:
ž slezhenie za rostom fajlovyh sistem;
ž obnaruzhenie problem;
ž kontrol' nad bystrorastushchimi fajlami;
ž kontrol' nad ispol'zovaniem diskovogo
prostranstva pol'zovatelyami;
ž pri neobhodimosti defragmentaciya i
kompressiya fajlovyh sistem.
Ne smotrya na to, chto v chetvertoj versii AIX sushchestvuet dinamicheskoe uvelichenie razmera fajlovyh sistem, takoe uvelichenie ne proishodit avtomaticheski. Sistemnyj administrator dolzhen postoyanno otslezhivat' ispol'zovanie diskovogo prostranstva fajlovoj sistemy i uvelichivat' e£ razmer, kogda ona budet polnost'yu zapolnena.
Dlya prosmotra informacii ob obshchem i ispol'zuemom diskovom prostranstve ispol'zuetsya komanda df. Dlya pokaza razmera diskovogo prostranstva v kilobajtah etu komandu neobhodimo zapuskat' s klyuchom -k.
Bystrorastushchie sistemnye fajly dolzhny byt' postoyanno pod kontrolem i s cel'yu ekonomii diskovogo prostranstva periodicheski ochishchat'sya.
Prezhde vsego, neobhodimo kontrolirovat' sleduyushchie fajly:
ž /var/adm/wtmp
ž /var/spool/*.*
ž /smit.log
ž /smit.script
ž /etc/security/failedlogin
ž /var/adm/sulog
Fajly /var/adm/wtmp i /var/adm/failedlogin chitayutsya komandoj who -a imya_fajla. Ostal'nye fajly redaktiruyutsya s pomoshch'yu lyubogo tekstovogo redaktora.
Sistema kvot (ogranichenij) diskovogo prostranstva baziruetsya na Berkeley Disk Quota System i pozvolyaet administratoru kontrolirovat' kolichestvo fajlov i blokov dannyh pol'zovatelej ili ih grupp.
|ta sistema ispol'zuetsya v sleduyushchih sluchayah:
ž ogranichennoe diskovoe prostranstvo v sisteme;
ž fajlovaya sistema trebuet povyshennoj bezopasnosti;
ž pri vysokom ispol'zovanii fajlovoj sistemy (naprimer, v universitete).
Predely kvot ustanavlivayutsya tremya parametrami:
Soft limits - opredelyaet kolichestvo blokov po 1KB ili fajlov, na kotoroe pol'zovatel' mozhet prevysit' na opredelennyj period (grace period).
Hard limits - maksimal'noe kolichestvo blokov po 1KB ili fajlov, kotoroe pol'zovatel' ne mozhet prevysit'
Grace period - vremya na kotoroe pol'zovatel' mozhet prevysit' otpushchennoe emu po soft limits diskovoe prostranstvo ili kolichestvo fajlov. Po umolchaniyu - 7 dnej.
Vnimanie: Dlya zapuska vseh komand, svyazannyh s ustanovkoj i upravleniem kvotami neobhodimo imet' polnomochiya pol'zovatelya root. Ostal'nye pol'zovateli mogut tol'ko prosmotret' lichnye kvoty s pomoshch'yu komandy quota zapuskaemoj v komandnoj stroke.
1 shag - Vklyuchenie rezhima kvot Dlya ukazaniya togo, chto dlya dannoj fajlovoj sistemy ustanovlen rezhim kvot, neobhodimo vstavit' v e£ stanzu fajla /etc/filesystems sleduyushchuyu stroku: dlya rezhima kvot pol'zovatelej: quota=userquota dlya rezhima kvot pol'zovatelej i grupp: quota=userquota,groupquota
2 shag - Ustanovka kvot Dlya sozdaniya i redaktirovaniya kvot ispol'zuetsya komanda edquota. |ta komanda sozda£t vremennyj fajl, kotoryj soderzhit informaciyu obo vseh tekushchih kvotah kazhdogo pol'zovatelya i gruppy.
Sintaksis komandy edquota sleduyushchij:
edquota [-u username|-g groupname] [-p prototype]
gde: opciya -u ispol'zuetsya dlya redaktirovaniya kvoty pol'zovatelya username; opciya -g ispol'zuetsya dlya redaktirovaniya kvot gruppy groupname; opciya -p ispol'zuetsya dlya ukazaniya prototipa kvoty (pol'zovatelya ili gruppy, imya kotoryh neobhodimo ukazat'), kotoryj ispol'zuetsya dlya kopirovaniya ranee ustanovlennyh kvot.
Vnimanie: Dlya ispol'zovaniya komandy edquota dolzhna byt' ustanovlena peremennaya EDITOR (dlya primera, export EDITOR=/usr/bin/vi).
3 shag - Ustanovka Grace Period Dlya ustanovki Grace Period takzhe ispol'zuetsya komanda edquota s parametrami: -t - dlya vseh pol'zovatelej i grupp; -tg - dlya vseh grupp; -tu - dlya vseh pol'zovatelej.
Grace Period mozhno ustanavlivat' v sekundah, minutah, chasah ili dnyah. Ustanovka Grace Period v razmere 1-j sekundy pokazyvaet, chto Grace Period ne predostavlyaetsya. Ustanovka 0 opredelyaet Grace Period po umolchaniyu.
Vklyuchenie rezhima kvot Dlya vklyucheniya rezhima kvot ispol'zuetsya komanda quotaon s parametrami: -u - ustanovka rezhima kvot tol'ko dlya pol'zovatelej; -g - ustanovka rezhima kvot tol'ko dlya grupp; -a - ustanovka rezhima kvot dlya pol'zovatelej i grupp. Posle parametra mozhno ukazat' imya konkretnoj fajlovoj sistemy, dlya kotoroj neobhodimo vklyuchit' mehanizm kvot. Po umolchaniyu rezhim kvot vyklyuchen.
Vyklyuchenie rezhima kvot Dlya vyklyucheniya rezhima kvot ispol'zuetsya komanda quotaoff. Mozhno otklyuchit' rezhim kvot dlya vseh fajlovyh sistem (s parametrom -a) ili dlya konkretnoj fajlovoj sistemy (ukazat' e£ imya).
Proverka rezhima kvot Komanda quotacheck ispol'zuetsya dlya proverki korrektnosti raboty mehanizma kvot. Komanda repquota ispol'zuetsya dlya proverki ispol'zovaniya tekushchih pol'zovatel'skih ili gruppovyh kvot.
Dlya defragmentacii obyazatel'no smontirovannoj fajlovoj sistemy ispol'zuetsya komanda defragfs:
/usr/sbin/defragfs [-q|-r] FILESYSTEM
opciya -q pokazyvaet otchet o tekushchem statuse fajlovoj sistemy; opciya -r pokazyvaet otchet o tekushchem statuse fajlovoj sistemy i o vozmozhnom sostoyanii fajlovoj sistemy, posle defragmentacii .
Fajlovye sistemy mogut byt' provereny ispol'zuya komandu fsck. Ee sintaksis:
fsck [-p|-y|-n] [-f] [FILE SYSTEM]
Opciya -p ukazyvaet na provedenie proverki i ispravlenie fajlovoj sistemy bez informirovaniya pol'zovatelya obo vseh izmeneniyah i bez zaprosov na sovershenie takih izmenenij. Pri zapuske proverki fajlovyh sistem iz SMIT ispol'zuetsya eta opciya. Opcii -y ili -n ispol'zuyutsya dlya otvetov yes ili no na vse voprosy vydavaemye komandoj.
Proverka fajlovoj sistemy proizvoditsya v neskol'ko stadij: proverka zhurnala na predmet obnaruzheniya soobshchenij ob oshibkah, proverka inodes, kosvennyh blokov, blokov dannyh, svobodnyh blokov, proverka razmerov fajlov, proverka soderzhimogo direktorij.
Esli yavno ne ukazana fajlovaya sistema dlya proverki, to proveryayutsya vse fajlovye sistemy, dlya kotoryh v fajle /etc/filesystems ustanovlen atribut check v true. Komanda vyvodit otchet o svoej rabote v direktoriyu /lost+found.
ž Zapuskajte komandu lsfs.
ž Otslezhivajte soderzhimoe fajla /etc/filesystem.
ž Zapuskajte komandu df dlya proverki
ispol'zovaniya diskovogo prostranstva.
ž Proveryajte vse smontirovannye fajlovye
sistemy komandoj mount.