1) Creation of Filesystem:

The crfs command creates a file system on a logical volume within a previously created volume group.

A new logical volume is created for the file system unless the name of an existing logical volume is specified using the -d. An entry for the file system is put into the /etc/filesystems file.

Commands

##With an existing logical volume:

# crfs -v jfs2 -d <lv> -m <mountpoint> -A yes

-v vfs type (Specifies the virtual file system type)
-d Specifies the device name of a device or logical volume on which to make the file system.
-m Specifies the mount point, which is the directory where the file system will be made available
-A Specifies whether the file system is mounted at each system restart:yes:File system is automatically mounted at system restart.no:File system is not mounted at system restart (default value).

Note: start of changeThe crfs command accesses the first letter for the auto mount -A option.end of change

Note: there are two types of filesystems jfs and jfs2, jfs2 allows you to decrease the filesystem size , you cannot reduce a jfs filesystem.

2) mount/unmount Filesystems:

mount is the command used to mount filesystems

mount [<fs>|<lv>]
mount -a
mount all

To unmount filesystem use "umount"

umount <fs>
Note: You can't write into or read any content from filesystem when its in unmounted state
-f unmount filesystem forcibly
umount -f <fs>
for v7.1 onwards you can use name for "unmount" command as well.
umountall: Unmounts groups of dismountable devices or filesystems ( applicable to v7.1)

3) List Filesystems:

To list filesysem use "lsfs" or "mount"

lsfs Lists all filesystems in the /etc/filesystems entry
lsfs -a To list all filesystems (default)
lsfs -q <fs> (detailed)
lsfs -q List all filesystems with detailed info (shows size of FS and LV in it. so we can check whether size of LV=size os FS)
lsfs -l Specify the output in list format
lsfs -c Specify the output in column format
lsfs -v jfs Lists all jfs filesystems
mount (to list all mounted filesystems)
mount <fs> ( to list the mounted filesysem)
Note: use the '-q' to see if the logical volume size is bigger than the filesystem size

4) Display Filesystem usage:

To display information about all mounted file systems, enter: df

Command Examples

1) If your system has the /, /usr, /site, and /usr/venus file systems mounted, the output from the df command resembles the following:

7) Remove Filesystems:

Note1: You need to unmount the filesyem before removing.
Note2: if all filesystems have been removed from a logical volume then the logical volume is removed as well.

8) Freeze File System:

If you don't want your file system to perform any writes for a period of time, maybe due to an admin task like a split copy or a backup, you can freeze the file system. After the admin tasks are completed, you can thaw the file system.

11) fuser & filesystem:

fuser /etc/passwd lists the process numbers of local processes using the /etc/passwd file

fuser -cux /var shows which processes are using the given filesystem

fuser -cuxk /var it will kill the above processes

fuser -dV /tmp shows deleted files (inode) with process ids which were open by a process (so its space could not be freed up)

(-V: verbose will show the size of the files as well)
if we rm a file, while it is opened by a process its space will not free up.
solution: kill the process, wait for the process to finish or reboot the system