Content-type: text/html
migrate - Moves the location of a file within a file domain
/usr/sbin/migrate [-p pageoffset] [-n pagecount] [-s volumeindex] [-d volumeindex] filename
Specifies the name of the file to migrate.
Specifies the page offset of the first page to migrate. The first page of the file is page 0. The default page offset is 0. Specifies the number of pages to migrate, starting at the pageoffset value. If you do not specify the -n flag, the migrate command migrates pages from the pageoffset value to the end of the file. Specifies the index of the source volume (the volume from which the pages are migrated). You can determine the volume index, which is the number associated with each volume, by using the showfile -x command.
Also, you can use this flag to move pages of a striped file, a segment of the striped file that resides on one volume, to another volume. Specifies the index of the destination volume (the volume to which the pages are migrated). You can determine the volume index, which is the number associated with each volume, by using the showfile -x command.
If you do not specify the -d flag, the pages are moved to any volume or volumes with available space.
The migrate utility moves the specified page or pages of a file to a new location within the file domain. Since there are no read/write restrictions when using this command, you can migrate a file while users are reading it, writing to it, or both. File migration is transparent to users.
When you run the migrate utility with only the -p and -n flags, the utility attempts to allocate the destination pages contiguously. If there are not enough free, contiguous destination blocks, the utility attempts to allocate the pages to the next available blocks on the same volume. If there are not enough destination blocks on the same volume, the utility moves the file to the next available volume or volumes.
You can use the migrate utility to move heavily accessed files or pages of files to a different volume in the file domain. Use the -d flag to indicate a specific volume. Also, you can use the utility to defragment a specific file, because the migrate utility defragments a file whenever possible.
You can only perform one migrate operation on the same file at the same time. When you migrate a striped file, you can only migrate from one source volume at a time.
To access this utility, you must have root privilege and you must register the Advanced File System Advanced Utilities license.
The following examples perform tasks using the migrate utility.
To migrate file abc to a new location in the file domain, enter:
# migrate abc To migrate pages 10 through 99 of file abc to volume 2 of the file domain, enter:
# migrate -p 10 -n 90 -d 2 abc
You can move the pages of a striped file to different volumes within a file domain. For example, if the abc file is striped across three volumes (Volumes 1, 2, 3) of a 6-volume file domain, you can use the migrate utility to move the pages from volume 2 to volume 4. You must specify the page offset and the page count for the pages you want to move in addition to the source volume information. Use the showfile command to determine the page count.
In the following example, volume 2 contains pages between 8 and 39 of the striped file. To migrate the pages so that the abc file is striped across volumes 1, 3, and 4, issue the following command:
# migrate -p 8 -n 32 -s 2 -d 4 abc
The migrate utility does not evaluate your migration decisions. As a result, you can move more than one striped file segment onto the same disk, which defeats the purpose of striping the file.
advfs(4), showfdmn(8), showfile(8), stripe(8).