Está en la página 1de 4

JFS and JFS2

This sections covers both.


The Journal File System:

• Journal means boot time file system checks are avoided


• File system changes are logged and replayed at boot time after a crash
• Data changes are not logged
• A large filesystem check (fsck)can take hours avoiding this is means crash recovery
faster
• This can make IBMers too cavalier about power off without shutdown

JFS logs
When a JFS or JFS2 is created a JFS log is creates

• AIX/LVM will create a jfslog device (LV)


• This is small - typically one PP
• This is where the changes are written
• Only one jfslog per volume group (default)
• Extra logs or large logs can be created but this is not common.

When a JFS is created the number of inodes it determined.

• AIX has defaults depending on the filesystem size


• If JFS for millions of tiny files increase the inodes
• If for database = small number of large files decrease the number
• Generally the defaults are fine

When a JFS2, no inodes are created as they are created dynamically.


This means JFS2 creation is very quick.

Two ways to create a file system


A JFS can be created Directly

• Have to accept many defaults for underlying LV


• Fine for low use or temporary file systems

A JFS can be created into a previously defined logical volume

• This allows full control for example: mirroring, strips, number of disks etc.

The smit short cut is: smitty jfs


A JFS supports - Compressed file systems

• OK for single user workstation


• Fine for off-line backup areas
• Otherwise avoid - eats CPU time
A JFS supports - Large file File system

• Don't us it unless you need large files due to small performance overhead
• it is best to test that this helps your workload before using lots of them

Maximum Sizes
What is the max. size of a JFS?
What is the max. size of a file?
This increases with every new AIX version.
Check the AIX Strength to Strength document for the latest numbers:
Note: 32 bit apps cannot address more than 2 GB

• unless they are recoded to use special system calls


• 64 bit applications can access larger files

A JFS can be Large File Enabled to allow file >2GB but generally these are best avoided.
It is now best to use JFS2 in AIX 5L

Mounting
Once JFS created you need to mount the jfs
AIX does not do the automatically!!
For example as root: $ mount /scratch
To "see" the filesystems you can:

• use smit
• use df -k (-k = KB as the POSIX standard forces a default of 512 bytes blocks!!)
• use mount

With AIX you can ask for all file system to be mounted in one command - which can be useful
if you just created lots: mount all

Filesystem definitions
Filesystems details are within: /etc/filesystems
It contains mount point, LV and options

Renaming a JFS = new mount point


1. unmount the jfs: umount /scratch
2. edit: vi /etc/filesystems
3. mount it again in the new place: mount /temporary

To change the placement on the disk of a jfs, you actually just need to move the LV that it is
placed in.
You can do this while it is mounted.

Chaning a filesystem - online


A filesystem can be grown and online. This increases the LV and the JFS structure at the same
time.
This needs to be at least a single PP usually 8MB, 16 MB or 32MB or more with modern disks.
Use: smit jfs
or
Use: smitty jfs2
to do this as it makes it very simple to do.
You can use the underlying AIX commands but way waste time.
With smit it is easy to double the size put a plus sign before the current size and hit return.
If the data does not need high performance I/O just take the JFS and JFS2 commands or
smitty to create the filesystem in your choosen disk volume group.
It you want extra preformance (and are not using a disk subsystem to spread data for
performence):

• Stripe data across lots of disks


• Create a striped LV on 8 to 16 disks
• Mirror the LV onto other disks (faster reads)
Do this by creating the JFS within the LV that you have layed out as above.

To remove a file system


For eample /scratch

• unmount: umount /scratch


• delete the jfs: smit jfs

If you can't unmount, the file system as it is in use by


an open file
an open directory via user with a shell
Use: fuser -xuc /scratch
If it is not obvious who or what it is - you may need to reboot but first set filesystem to not
be mounted on reboot

Defrag
Typically AIX does not need this!
If you have lots of file create and delete activity, it might be worth doing as follows:

• smitty jfs or jfs2


• Select Defragment a Journaled File System
And use:
• perform
• query
• report
Note for it can be much quicker to unmount, delete and recreate a filesystem like
our /scratch example.

Commands
There is a full set of fs and jfs/jfs2 commands but most people use smitty to manage
filesystems.
If you need to create lots of them it is often quicker to use smitty to work out the commands
(use F6).
The regular UNIX command work plus:
List file systems: lsfs
Full details: lsfs -q
Note:

• bf = big file support


• ag = allocation group

También podría gustarte