0% found this document useful (0 votes)
147 views

Chfs Examples

The document provides examples for using the chfs, crfs, mkfs, and mklv commands to manage file systems and logical volumes. The chfs command can change file system attributes like size, mount point, and accounting. The crfs command creates file systems with options to specify volume group, mount point, size, and attributes. The mkfs command formats devices to create file systems with customizable options. The mklv command creates logical volumes with options to specify volume group, number of partitions, copies, physical volumes, and striping parameters.

Uploaded by

csdhiman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
147 views

Chfs Examples

The document provides examples for using the chfs, crfs, mkfs, and mklv commands to manage file systems and logical volumes. The chfs command can change file system attributes like size, mount point, and accounting. The crfs command creates file systems with options to specify volume group, mount point, size, and attributes. The mkfs command formats devices to create file systems with customizable options. The mklv command creates logical volumes with options to specify volume group, number of partitions, copies, physical volumes, and striping parameters.

Uploaded by

csdhiman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Chfs Examples

1. To change the file system size of the /test Journaled File System, enter:
chfs -a size=24576 /test

This command changes the size of the /test Journaled File System to 24576 512-byte blocks, or
12MB (provided it was previously no larger than this).

2. To increase the size of the /test Journaled File System, enter:


chfs -a size=+8192 /test

This command increases the size of the /test Journaled File System by 8192 512-byte blocks, or 4 MB.

3. To convert a JFS2 file system to a version which can support NFS4 ACLs, type:

chfs -a ea=v2 /test

4. To change the mount point of a file system, enter:

chfs -m /test2 /test

This command changes the mount point of a file system from /test to /test2.

5. To delete the accounting attribute from a file system, enter:

chfs -d account /home

This command removes the accounting attribute from the /home file system. The accounting
attribute is deleted from the /home: stanza of the /etc/filesystems file.

6. To split off a copy of a mirrored fs and mount it read-only for use as an online backup, enter:

chfs -a splitcopy=/backup -a copy=2 /testfs

This mount a read-only copy of /testfs at /backup.

7. To change the file system size of the /test Journaled File System, enter:
chfs -a size=64M /test

This changes the size of the /test JFS to 64MB (provided it was previously no larger than this).

8. To reduce the size of the /test JFS2 file system, enter:


chfs -a size=-16M /test

9. To freeze a file system, enter:

chfs -a freeze=60 /adl freezes the /adl fs for a maximum of 60 seconds.

10. To thaw a file system, enter:

chfs -a freeze=off /zml This command thaws the /zml file system.

/etc/filesystems Lists the known file systems and defines their characteristics.
Crfs Examples
1. To make a JFS on the rootvg volume group with nondefault fragment size and nondefault nbpi,
enter:

crfs -v jfs -g rootvg -m /test -a \ size=32768 -a frag=512 -a nbpi=1024

This command creates the /test file system on the rootvg volume group with a fragment size of 512
bytes, a number of bytes per i-node (nbpi) ratio of 1024, and an initial size of 16MB (512 * 32768).

2. To make a JFS on the rootvg volume group with nondefault fragment size and nondefault nbpi,
enter:

crfs -v jfs -g rootvg -m /test -a size=16M -a frag=512 -a nbpi=1024

This command creates the /test file system on the rootvg volume group with a fragment size of 512
bytes, a number of bytes per i-node (nbpi) ratio of 1024, and an initial size of 16MB.

3. To create a JFS2 file system which can support NFS4 ACLs, type:

crfs -v jfs2 -g rootvg -m /test -a size=1G -a ea=v2

This command creates the /test JFS2 file system on the rootvg volume group with an initial size of 1
gigabyte. The file system will store extended attributes using the v2 format.

Files
/etc/filesystems Lists the known file systems and defines their characteristics.
Mkfs Examples
1. To specify the volume and file system name for a new file system, type:

mkfs -lworks -vvol001 /dev/hd3

This command creates an empty file system on the /dev/hd3 device, giving it the volume serial
number vol001 and file system name works. The new file system occupies the entire device. The file
system has a default fragment size (4096 bytes) and a default nbpi ratio (4096).

2. To create a file system with nondefault attributes, type:

mkfs -s 8192 -o nbpi=2048,frag=512 /dev/lv01

This command creates an empty 4 MB file system on the /dev/lv01 device with 512-byte fragments
and 1 i-node for each 2048 bytes.

3. To create a large file enabled file system, type:

mkfs -V jfs -o nbpi=131072,bf=true,ag=64 /dev/lv01

This creates a large file enabled JFS file system with an allocation group size of 64 megabytes and 1
inode for every 131072 bytes of disk. The size of the file system will be the size of the logical volume
lv01.

4. To create a file system with nondefault attributes, type:

5. mkfs -s 4M -o nbpi=2048, frag=512 /dev/lv01

This command creates an empty 4 MB file system on the /dev/lv01 device with 512-byte fragments
and one i-node for each 2048 bytes.

6. To create a JFS2 file system which can support NFS4 ACLs, type:

mkfs -V jfs2 -o ea=v2 /dev/lv01

This command creates an empty file system on the /dev/lv01 device with v2 format for extended
attributes.

Files
/etc/vfs Contains descriptions of virtual file system types.
/etc/filesystems Lists the known file systems and defines their characteristics.

Mklv Examples
1. To make a logical volume in volume group vg02 with one logical partition and a total of two copies
of the data, type:

mklv -c 2 vg02 1

2. To make a logical volume in volume group vg03 with nine logical partitions and a total of three
copies spread across a maximum of two physical volumes, and whose allocation policy is not strict,
type:

mklv -c 3 -u 2 -s n vg03 9

3. To make a logical volume in vg04 with five logical partitions allocated across the center sections of
the physical volumes when possible, with no bad-block relocation, and whose type is paging, type:

mklv -a c -t paging -b n vg04 5

4. To make a logical volume in vg03 with 15 logical partitions chosen from physical volumes hdisk5,
hdisk6, and hdisk9, type:

mklv vg03 15 hdisk5 hdisk6 hdisk9

5. To make a striped logical volume in vg05 with a strip size of 64K across 3 physical volumes and 12
logical partitions, type:

mklv -u 3 -S 64K vg05 12

6. To make a striped logical volume in vg05 with a strip size of 8K across hdisk1, hdisk2, and hdisk3
and 12 logical partitions, type:

mklv -S 8K vg05 12 hdisk1 hdisk2 hdisk3

7. To request a logical volume with a minimum size of 10MB, type:

mklv VGNAME 10M #

The mklv command will determine the number of partitions needed to create a logical volume of at
least that size.

You can use uppercase and lowercase letters as follows:

B/b 512 byte blocks

K/k KB

M/m MB

G/g GB

Files
/usr/sbin Directory where the mklv command resides.
/tmp Directory where the temporary files are stored while the command is running.

You might also like