Blogs

IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies.A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at ibm.com/legal/copytrade.shtml.

Tags

Convert a Version 1.4 Aggregate and a v4 Directory Using zfsadm convert -path

We used the zfsadm convert –path on a mounted version 1.4 aggregate to convert a directory to an extended (v5) directory. This converted the aggregate to a version 1.5 aggregate and converted the directory indicated in the -path to an extended (v5) directory.

We mounted a version 1.4 aggregate.

$ mount -t zfs -f OMVSSPN.PET3.ZFS.FS /pet3

Using zfsadm fileinfo, we see that the directory is a version v4.

$ zfsadm fileinfo -path /pet

path: /pet

*** global data ***

fid 83,1 anode 701,5052

length 8192 format BLOCKED

1K blocks 8 permissions 755

uid,gid 0,0 access acl 0,0

dir model acl 0,0 file model acl 0,0

user audit F,F,F auditor audit N,N,N

set sticky,uid,gid 0,0,0 seclabel none

object type DIR object linkcount 11

object genvalue 0x00000000 dir version 4

dir name count na dir data version 9

dir tree status na dir conversion na

file format bits na,na,na file charset id na

file cver na charspec major,minor na

direct blocks 0x0000585D

indirect blocks none

mtime Jul 8 13:26:53 2013 atime Jul 21 18:57:59 2013

ctime Jul 8 13:26:53 2013 create time Jul 24 13:56:01 2008

reftime none

Using zfsadm convert –path we converted the /pet3 directory to an extended (v5) directory.

Using the zfsadm fileinfo command we see that the /pet3 directory was converted to an extended (v5) directory, and the aggregate was converted to version 1.5. The other v4 directories remained v4.

$ zfsadm fileinfo -path /pet3

path: /pet3

*** global data ***

fid 1,1 anode 79,516

length 8192 format BLOCKED

1K blocks 8 permissions 777

uid,gid 0,0 access acl 0,0

dir model acl 0,0 file model acl 0,0

user audit F,F,F auditor audit N,N,N

set sticky,uid,gid 0,0,0 seclabel none

object type DIR object linkcount 4

object genvalue 0x00000000 dir version 5

dir name count 6 dir data version 4

dir tree status VALID dir conversion na

file format bits na,na,na file charset id na

file cver na charspec major,minor na

direct blocks 0x0000A710

indirect blocks none

mtime Jul 26 14:07:24 2013 atime Jul 26 14:50:48 2013

ctime Jul 26 14:07:24 2013 create time Jul 12 14:34:46 2002

reftime none

Using the zfsadm aggrinfo command, with the –long option, we see that the aggregate was converted to version 1.5.

$ zfsadm aggrinfo -aggregate OMVSSPN.PET3.ZFS.FS -long

OMVSSPN.PET3.ZFS.FS (R/W COMP): 1960807 K free out of total 1961280

version 1.5

auditfid E2E2F0F0 F7F909ED 0000

sysplex-aware

245100 free 8k blocks; 7 free 1K fragments

112 K log file; 56 K filesystem table

280 K bitmap file

Convert a Version 1.4 Aggregate on First Read-Write Using converttov5

A version 1.4 aggregate can be changed to a version 1.5 aggregate on the first primary read-write mount if IOEPRMxx option converttov5=on is set, or if the CONVERTTOV5 MOUNT PARM is specified. The default is off. The aggregate is changed to a version 1.5 aggregate and each existing directory is converted to an extended (v5) directory as it is referenced.

The CONVERTTOV5 or NOCONVERTTOV5 specifies whether a zFS read/write file system is assigned the converttov5 attribute. If it is assigned the converttov5 attribute and the aggregate is a version 1.5 aggregate, zFS automatically converts directories from v4 to extended (v5) as they are accessed. If the converttov5 attribute is assigned at primary mount time, a version 1.4 aggregate is changed to a version 1.5 aggregate. If automatic directory conversion for a directory fails, the conversion is not attempted again until the file system is unmounted and mounted again. The converttov5 attribute can also be assigned if the MOUNT option is not specified but the converttov5 specification in the IOEFSPRM file is on when the file system is mounted or remounted. The default is NOCONVERTTOV5. The CONVERTTOV5 parameter can also be assigned to a mounted zFS file system.

We mounted a version 1.4 aggregate as read/write (RDWR) with the CONVERTTOV5 mount parameter. This converted the aggregate to a version 1.5 aggregate.

MOUNT FILESYSTEM('OMVSSPN.VER14.TO.VER15.ZFS') TYPE(ZFS)

MODE(RDWR) MOUNTPOINT('/zfspetmounts/ver14tover15')

PARM('CONVERTTOV5')

Since the file system was mounted with the CONVERTTOV5 mount parameter, it shows as a version 1.5 aggregate using the zfsadm aggrinfo with the –long option display.

$ zfsadm aggrinfo -aggregate OMVSSPN.VER14.TO.VER15.ZFS -long

OMVSSPN.VER14.TO.VER15.ZFS (R/W COMP): 1263 K free out of total 1440

version 1.5

auditfid E2E2F0F0 F1F41A4E 0000

sysplex-aware, converttov5

157 free 8k blocks; 7 free 1K fragments

112 K log file; 16 K filesystem table

8 K bitmap file

Using the df and D OMVS commands we can see the CONVERTTOV5 mount parameter.

We used zfsadm fileinfo to check the directories. Fileinfo accesses the v4 directories, and automatically converts them to extended (v5) directories.

$ zfsadm fileinfo -path /zfspetmounts/ver14tover15/origv14dir1

$ zfsadm fileinfo -path /zfspetmounts/ver14tover15/origv14dir2

$ zfsadm fileinfo -path /zfspetmounts/ver14tover15

With zfsadm fileinfo all show as extended (v5) directories.

...

object genvalue 0x00000000 dir version 5

...

Convert an Aggregate and All Directories Using IOEFSUTL

We converted a version 1.4 aggregate to a version 1.5 aggregate, converting all directories to extended (v5) directories using IOEFSUTL converttov5. This requires the file system to be unmounted and executed on z/OS V2R1.

We needed to ensure that the version 1.4 file system was unmounted.

UNMOUNT FILESYSTEM('OMVSSPT.VER.CONVERT.ZFS') IMMED

We executed a batch job to run IOEFSUTL converttov5. Here are Excerpts from the JCL.

IOEZ00808I Successfully converted all directories in aggregate OMVSSPT.VER.CONVERT.ZFS to version 5.

Note:aggrversion_only was not defined, so all directories were converted to extended (v5) directories also.

We then mounted the file system and used zfsadm fileinfo and zfsadm aggrinfo with the –long option to see if it was converted to a version 1.5 aggregate and all the directories were converted to extended (v5) directories.

MOUNT FILESYSTEM('OMVSSPT.VER.CONVERT.ZFS') TYPE(ZFS)

MODE(RDWR) MOUNTPOINT('/pet')

$ zfsadm fileinfo -path /pet

path: /pet

*** global data ***

fid 1,1 anode 703,516

length 8192 format BLOCKED

1K blocks 8 permissions 356

uid,gid 0,0 access acl 0,0

dir model acl 0,0 file model acl 0,0

user audit F,F,F auditor audit N,N,N

set sticky,uid,gid 1,0,0 seclabel none

object type DIR object linkcount 5

object genvalue 0x00000000 dir version 5

dir name count 5 dir data version 3

dir tree status VALID dir conversion na

file format bits na,na,na file charset id na

file cver na charspec major,minor na

direct blocks 0x00001781

indirect blocks none

mtime Mar 18 13:47:07 2013 atime Mar 18 13:48:07 2013

ctime Mar 18 13:47:07 2013 create time Mar 18 13:30:42 2013

reftime none

$ zfsadm fileinfo -path /pet/origv4dir

path: /pet/origv4dir

*** global data ***

fid 2,1 anode 703,768

length 8192 format BLOCKED

1K blocks 8 permissions 775

uid,gid 0,0 access acl 0,0

dir model acl 0,0 file model acl 0,0

user audit F,F,F auditor audit N,N,N

set sticky,uid,gid 0,0,0 seclabel none

object type DIR object linkcount 2

object genvalue 0x00000000 dir version 5

dir name count 2 dir data version 0

dir tree status VALID dir conversion na

file format bits na,na,na file charset id na

file cver na charspec major,minor na

direct blocks 0x000018F9

indirect blocks none

mtime Mar 18 13:37:28 2013 atime Mar 18 13:37:28 2013

ctime Mar 18 13:37:28 2013 create time Mar 18 13:37:28 2013

reftime none

$ zfsadm fileinfo -path /pet/dirfromz1when14

path: /pet/dirfromz1when14

*** global data ***

fid 4,1 anode 703,1272

length 8192 format BLOCKED

1K blocks 8 permissions 775

uid,gid 0,0 access acl 0,0

dir model acl 0,0 file model acl 0,0

user audit F,F,F auditor audit N,N,N

set sticky,uid,gid 0,0,0 seclabel none

object type DIR object linkcount 2

object genvalue 0x00000000 dir version 5

dir name count 3 dir data version 1

dir tree status VALID dir conversion na

file format bits na,na,na file charset id na

file cver na charspec major,minor na

direct blocks 0x00001EDE

indirect blocks none

mtime Mar 18 13:47:29 2013 atime Mar 18 13:48:23 2013

ctime Mar 18 13:47:29 2013 create time Mar 18 13:47:07 2013

reftime none

$ zfsadm aggrinfo -aggregate OMVSSPT.VER.CONVERT.ZFS -long

OMVSSPT.VER.CONVERT.ZFS (R/W COMP): 71175 K free out of total 72000

version 1.5

auditfid D7F2E4E2 F6F11C30 0000

sysplex-aware

8896 free 8k blocks; 7 free 1K fragments

720 K log file; 40 K filesystem table

16 K bitmap file

Convert a v4 Directory Using Copy (cp)

We mounted a version 1.4 aggregate, converted it to a version 1.5 aggregate, and then used copy (cp) to create a copy of an existing v4 directory. It created the target directory as an extended (v5) directory.

Note: The move (mv) command does not create a new directory if the target is in the same parent directory and file system, thus the directory remains the same version. If the target is in a different version 1.5 file system, and the directory is created as a result of the move, the v4 directory will be converted to an extended (v5) directory.

We mounted a version 1.4 aggregate.

$ mount -t zfs -f OMVSSPN.ZFSFMT.ZFS /mnt1

Using zfsadm aggrinfo, we see it is a version 1.4 aggregate.

$ zfsadm aggrinfo -aggr OMVSSPN.ZFSFMT.ZFS -long

OMVSSPN.ZFSFMT.ZFS (R/W COMP): 559 K free out of total 720

version 1.4

auditfid E2E2F0F0 F1F70808 0000

sysplex-aware

69 free 8k blocks; 7 free 1K fragments

112 K log file; 16 K filesystem table

8 K bitmap file

Using the zfsadm convert command we converted the aggregate to a version 1.5 aggregate and verified with zfsadm aggrinfo –long and zfsadm fileinfo.

We tried to convert by using the move (mv) command for a directory in the same parent directory and file system. However, this did not cause the directory to be converted to an extended (v5) directory.

$ mv /mnt1/dir1 /mnt1/dir2

$ zfsadm fileinfo -path /mnt1/dir2

...

object genvalue 0x00000000 dir version 4

...

We used copy (cp) to convert the target directory. This caused the target directory to be converted to an extended (v5) directory.

$ cp -r /mnt1/dir2 /mnt1/dir1

$ zfsadm fileinfo -path /mnt1/dir1

...

object genvalue 0x00000000 dir version 5

...

We converted by using the move (mv) command with the source being a v4 directory and the target being a new directory in a different version 1.5 file system. This caused the source v4 directory to be converted to an extended (v5) directory at the target location.

With /mnt1/dir1 as a v4 directory and using a target directory in another version 1.5 file system that does not exist (/pet/dir1), we issued the following: