AIX 5L SysAdmin I: (Unit 07) – Working with File Systems

Identify the components of an AIX file system
Add an enhanced journaled file system
Change characteristics of a file system

Structure of a Journaled File System:
1. Superblock (Structure of the File System)
–> File system size and identification
–> Free list, fragment size, nbpi

2. inodes
–> File size, ownership, permissions, times
–> Pointers to data blocks

3. Blocks
–> Data blocks – contain data
–> Indirect blocks – contain pointers to data blocks

Structure of an Inode:
ls -l (Long list that shows the inode information)
ls -i (shows the inode number)
no. of links
type of file
user Id
group Id
file size
address of blocks
fimte modified
time accessed
time changed
access control info.
reserved other

File System Fragmentation:
4096 bytes – the smallest space size allocated to each file

1. No Fragmentation (Used for large files)
File size = 2000 bytes
The other 2096 bytes of free space cannot be used by another file.

2. Fragmentation Enabled (Used when you have lots of small files)
File size = 2000 bytes
Assign Fragment size = 1024
The two free fragments of 1024 space can be used by other files.

Variable Number of Inodes:
When a file system is created it creates an inode table. The number of inodes created in the table is determined by the “nbpi” value.

If you are anticipating more small files in the file system, the nbpi value can be set to 1024 which will tell the system that you are going to have more files and thus more inodes in the inode table. (one inode for each 1024 bytes of space).

On the other hand, if you are going to have only large files in the file system, you can set the nbpi value to 4096 so that fewer inodes are created in the inode table. (one inode for each 4096 bytes of space) You may want to increase the nbpi value above 4096 if you are going to have fewer large files like with database files.

With the default nbpi = 4096, an inode will be created for every 4096 bytes in the file system.

Using a value nbpi = 1024, an inode will be created for every 1024 bytes in the file system.

nbpi – Number of bytes per inode (only for jfs not jfs2)
Note: The “nbpi” value should be the same as the “fragment size” value.
Note: Each file uses one inode regardless of the file size.
Note: The idea is to make sure that you have enough inodes to handle the number of expected files that will be in the file system. Otherwise, you may run out of inodes even though there is still free disk space available.

Allocation Group Size:
Parts of the inode table are spread out over the disk for efficiency depending upon the allocation group size assigned. The default agsize is 8MB.

Groupings of related inodes and disk blocks.
agsize = 16MB
16 MB – Disk Block (inode)
16 MB – Disk Block (Inode)
16 MB – Disk Block (Inode)

agsize = 64MB
64 MB – Disk Block (Inode)
64 MB – Disk Block (Inode)
64 MB – Disk Block (Inode)

Note: This setting is normally not changed very often.
If you have part of the inode table located every 16MB then you know that you will only have 16MB of continuous disk space before another portion of the inode table interupts the continuous space.

JFS vs. JFS2 File Systems:
—————————————– JFS JFS2
1. Maximum File Size 64 Gig/ 64 Gig 4 Petabytes/ 1 Terabyte
Architectural / Tested
2. Maximum File System Size 1 Tera/ 1 Tera 4 Peta/ 1 Tera
Architectural /Tested
3. Inode size 128 Bytes 512 Bytes
4. Number of inodes Fixed, set at creation Dynamic
5. Fragments / Block Size 512 / 4096 512 / 4096
6. Online defragmentation Yes Yes
7. Available on Itanium No Yes
8. Available on POWER Yes, default Yes

Note: JFS2 uses extent based allocation for high performance and large file size.

File and File System Sizes:
Maximum Individual File Size Limits
AIX Version 4.1 (JFS) = 2 GB
AIX Version 4.2 and later (JFS – Large File Enabled) = 64 GB
AIX Version 5 (JFS2) = 1 TB

JFS File System Limit Calculation
Maximum file system size limit in bytes = fragment size * 2^28
Maximum file system size limit in bytes = nbpi * s^24

The issue is that you run out of pointers – 4K vs 128K
4K Data Block * 1024 Pointers * 512 each = 2 GB (JFS)
128K Data Block * 1024 Pointers * 512 each = 64 GB (JFS – Large File Enabled)

Compressed File Systems:
Compression = LZ (yes) – Compression algorithym is on.
fragment size = 1024

Note: You should avoid using compression because you will take a large performance hit. Only use if out of disk space and performance isn’t important.

Large File Enabled File Systems:
File = 132 MB
(1024 * 4 KB blocks) + (1024 * 128 KB blocks) = 132 MB
4 MB + 128 MB = 132 MB

Journal Log:
To protect the integrity of each file in the file system by first writing changes to the inode to the journal log, then updating the inode itself, then verifying that they are both the same before rolling it off the top of the journal log. If something happens to your system the inode may become corrupt if it occurs when updating the inode. Thus the Journal Log can be used to restore the inode if it is corrupted due to system problems. When an inode is corrupt you loose access to the file.

1. inode changes to log
2. Commit to log
3. Update inode
4. Sync log

Note: No journaling of data blocks – only journals inode information (and indirect block information.)

File Systems:
smit fs

Listing File Systems:

Note: Size is measured in 512 K blocks, so you divide the size by two to get the actual size. Also the mount point only refers to where you said that you were going to mount it not where it is currently mounted.

List All Mounted File Systems:
mount – list all the files systems that are currently mounted

Use smit to create, change or remove JFS and JFS2 file systems.

System Storage Review:
To add a disk
1. Install the disk
2. Configure it as a device
3. Add it to a VG – Volume Group
4. Create LV – Logical Volumes to map to the disk space
5. Create a File System or Raw Space or Journal Log or Paging Space
6. Mount the File System

rmdir – remove a directory
rmfs – remove a file system

Check Point:
1. Will the size of the file system change when the size of the logical volume it is on is increased? No – The logical volume is a container with the file system inside as the contents. The container size can increase without the contents increasing.

2. If a file system is the same size as the logical volume on which it sits, will the size of the logical volume increase when the size of the file system that is sitting on it increases? Yes – This happens automatically.

3. If you remove a logical volume, will the file system that is sitting on it be removed as well? Not Completely – Must use an rmfs to remove the file system.

Q: Is there any other way (besides ls -l) to view the inode information of a file?
A: You can use the “istat” command. It labels all the information it displays
Q: Can the filesystems on my machine have different fragmentation sizes?
A: Yes. When you create the file system, you specify the fragmentation size.

Q: After creating the jfs filesystem with a fragment size of 4K, I realize that most of the files are amaller than 1K. Can I change the fragment size?
A: No, at least not in one simple step on jfs. You will need to backup the filesystem, remove the existing one, and create a new one setting the frag size to the value you want. Then, mount the filesystem and restore back the data. Fragment size is a value that cannot be changed after creation.?? But on jfs2 you can change the fragment size.

Q: Can I change my NBPI value on a jfs filesystem? I am close to running out of Inodes.
A: No. This value is set at creation. To change you need to remove the old filesystem and create a new one. Make sure you backup the data first.? On a jfs2 filesystem inodes are created dynimcally.? You will not run out!

Q: Do I have to create the journaled log LV?
A: No. When you create the first file system in a VG, the log LV is automatically created. Any other file systems created in that VG will use the same log LV.

Q: Can having only one log LV in a VG cause problems?
A: Not usually. Sometimes, if you have a significant amount of changes occurring in the file systems in the same VG, it is possible that the log LV can become a bottleneck for performance. It is possible to create more than one log LV in a VG to eliminate this potential problem. This is fairly uncommon and goes beyond the scope of this class. If this is something you feel is a problem on your machines, check out the AIX Performance and Tuning Guide.

Q: Does lsfs show where the file system is mounted?
A: No. The lsfs shows the file system information as defined in the /etc/filesystems file. Even if the file system is not mounted, lsfs will display the information. The mount command will show the where it the file system is mounted.

Q: Is there any way to tell if I mount a file system over a directory that is not empty?
A: No. So be careful that you don’t do this. If is very difficult to discover this has occurred.

Q: What will the mount command show if I mounted two file systems at the same location?
A: In the “mounted over” column, you would see the same directory twice. This is fairly easy to spot.

Q: I added a file system without first adding the logical volume and I don’t like where it was placed on the disk. Can I move it?
A: Sure. You need to change the characteristics of the LV. Set the policies to what you want. Then, make sure you reorganized the VG or the LV will not move.

Q: Can I also change the LV name?
A: You can change the LV name on any LV. You must first unmount the file system to perform this operation however.

mount filesystem
chown wltest.staff /home/wltest/filesystem
umount filesystem

Must do both commands to remove a logical volume:
rmlv -f lv00 – must unmount the filesystem before removing a logical volume
rmfs -r /home/wltest/filesystem

Create mirrored copy of a logical volume
Change characteristics of a LV from parallel to sequential
syncvg -l lvname – syncs the data on the new mirrored copy

Leave a Reply

Your email address will not be published. Required fields are marked *