*JFS2 structural components
- Superblock: The superblock maintains informaition about the entire file system.
- i-nodes: Each file and directory has an i-node that contains access information such as file type, access permissions, owner's ID, and number of links to that file.
- Data blocks: Contains file data; Each file system has a user settable fixed block size attribute -- 512, 1024, 2048 or 4096 bytes.
- Allocation maps: Record the location and allocation of all i-nodes and the allocation state of each data block.
- Allocation groups: Responsible for dividing the file system space into chunks so related data blocks and i-nodes can be clustered together to achieve good locality.
*Listing i-node and block size information
(1) To view i-node information:
# ls -li
total 0
73863 -rw-rw-r-- 1 root system 0 Mar 26 16:06 newfile
# istat newfile
Inode 73863 on device 10/7 File
Protection: rw-rw-r--
Owner: 0(root) Group: 0(system)
Link count: 1 Length 0 bytes
Last updated: Mon Mar 26 16:16:05 GMT+08:00 2012
Last modified: Mon Mar 26 16:06:59 GMT+08:00 2012
Last accessed: Mon Mar 26 16:06:59 GMT+08:00 2012
(2) To view file system block size informaiton:
# lsfs -cq /
#MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct
/:/dev/hd4:jfs2::bootfs:155189248:rw:yes:no
(lv size 155189248:fs size 155189248:block size 4096:sparse files yes:inline log no:inline log size 0:EAformat v1:Quota no:DMAPI no:VIX yes:EFS no:ISNAPSHOT no:MAXEXT 0)
*Creating a JFS2 file system
# crfs -v jfs2 -g datavg -a size=1G -m /pdmdata (or)
# smitty crfs_j2
Add an Enhanced Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Volume group name datavg
SIZE of file system
Unit Size Gigabytes +
* Number of units [1] #
* MOUNT POINT [/pdmdata]
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Block Size (bytes) 4096 +
Logical Volume for Log +
Inline Log size (MBytes) [] #
Extended Attribute Format +
ENABLE Quota Management? no +
Enable EFS? no +
Allow internal snapshots? no +
Mount GROUP []
# lsfs /pdmdata
Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/fslv01 -- /pdmdata jfs2 629145600 -- no no
# lsvg -l datavg
datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
datelv01 jfs2 600 600 1 closed/syncd N/A
loglv00 jfs2log 1 1 1 closed/syncd N/A
fslv01 jfs2 1200 1200 2 closed/syncd /pdmdata
*Mounting a file system and the /etc/filesystems file
# grep -p /pdmdata /etc/filesystems
/pdmdata:
dev = /dev/fslv01
vfs = jfs2
log = /dev/loglv00
mount = false
account = false
# mount /pdmdata
# mount | egrep '(/pdmdata|node)'
node mounted mounted over vfs date options
/dev/fslv01 /pdmdata jfs2 Mar 27 14:32 rw,log=/dev/loglv00
*JFS2 logging options
For JFS2 file systems, there are three logging options:
(1) Use the global JFS log for the volume group.
(2) Create a specific JFS log for each file system.
- 1 LP in size
- Format the log using the logform command.
# mklv -y my_jfs2_log -t jfs2log datavg 1
# logform /dev/my_jfs2_log
logform: destroy /dev/my_jfs2_log (y) ? y
# crfs -v jfs2 -g datavg -a size=1G -m /data -a logname=my_jfs2_log
(3) Create an inline log inside the file system: 0.4% of the file system space will be reserved for this option.
# crfs -v jfs2 -g datavg -a size=1G -m /data -a logname=INLINE [(or) -a logsize=<value in MB>]
*Creating a file system on a previously defined logical volume
# crfs -v jfs2 -d lv_for_data -m /data2 -A yes (or)
# smitty crfs_j2
Add an Enhanced Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* LOGICAL VOLUME name lv_for_data +
* MOUNT POINT [/data2]
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Block Size (bytes) 4096 +
Logical Volume for Log +
Inline Log size (MBytes) [] #
Extended Attribute Format +
ENABLE Quota Management? no +
Enable EFS? no +
Allow internal snapshots? no +
Mount GROUP []
*Changing the size of a JFS2 file system
- To increase the size of a file system:
# chfs -a size=+1G /data2
- To shrink the size of a file system:
# chfs -a size=-500M /data2
- Using SMIT:
# smitty chjfs2
Change / Show Characteristics of an Enhanced Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
File system name /pdmdata
NEW mount point [/pdmdata]
SIZE of file system
Unit Size Gigabytes +
Number of units [600] #
Mount GROUP []
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Start Disk Accounting? no +
Block Size (bytes) 4096
Inline Log? no
Inline Log size (MBytes) [0] #
Extended Attribute Format [v1]
ENABLE Quota Management? no +
Allow Small Inode Extents? yes +
Enable EFS? no +
*Removing a JFS2 file system
(1) The file system must first be unmounted
(2) Using SMIT:
# smitty rmfs
Remove an Enhanced Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* FILE SYSTEM name /data2 +
Remove Mount Point no +
(3) The syntax of the rmfs command:
rmfs [-r] [-i] Filesystem
-r : Removes the mountpoint of the file system
-i : Displays warning and prompts the user before removing the file system