Use Resource Allocation From the Command Line
Quantum recommends that you perform resource allocation using the StorNext GUI. However, if your operating system does not support using the GUI for this feature (or if you are operating in a failover environment,) you can accomplish the following tasks from the command line interface (CLI):
- Add a Stripe Group Without Migrating
- Add and Move a Data Stripe Group
- Move a Metadata/Journal Stripe Group
Caution: When you add a new disk or stripe group to your SAN, often an OS-dependent operation must be run to make the added device recognizable by a host. Some of these utilities can disrupt access to existing disks, causing access hangs or failures. To avoid this, stop all file system operations on the affected host before rescanning for the new device.
Caution:
Before you use the Resource Allocation feature, Quantum strongly recommends running the cvfsck
command on the file system you will be using. This step could take a considerable amount of time to complete, but your file system should be in good condition before you attempt to expand it or move stripe groups.
Caution: If you do not run the cvfsck
command to check your file system before attempting file system expansion, irreparable file system damage could occur.
Use the following procedure to expand the file system by adding a stripe group, and not migrating.
Caution: Do not use this procedure if the file system was created with the Windows Simple Config Tool.
Note: Changes to the configuration file must be manually copied to the peer MDC if you have a pair of Windows MDCs or if your Linux MDCs are not using a dedicated shared HA file system, also known as RPM-only StorNext install.
- Label disks for the new stripe groups you want to add to the file system.
-
If your StorNext configuration includes a failover environment, you must first shut down any standby FSMs that would start when you shut down the primary FSM. The movement procedure will not complete successfully unless all FSMs are shut down.
Caution: If you do not shut down standby FSMs, file system corruption or data loss could occur.
Note: Beginning with StorNext 6, stopping the file system is not required if you use the
sgadd
command. -
(Optional) Run the
cvfsck
command on the file system. See Check the File System.Note: Beginning with StorNext 6, this step is not required since the file system is not stopped if you use the
sgadd
command and the commandcvfsck
is not as effective when running on an active file system. -
Add the new stripe groups to the file system.
Note: Beginning with StorNext 6, execute the command
sgadd
. - Stop the File System Manager (FSM).
- Run the
cvupdatefs
command. - Restart the FSM.
New functionality has been added to the snfsdefrag
utility to support operations on multiple stripe groups.
Beginning with StorNext 6, Quantum recommends using the command sgoffload
to move data from one stripe group to one or more other stripe groups. In addition, the command sgdefrag
is also available, which is different from the command snfsdefrag
.
Note: During Stripe Group Movement, affinities are preserved when files are moved from one stripe group to another. When you create a new stripe group to use with the Stripe Group Movement feature, the new stripe group must include sufficient space for its affinities. You must add any affinities from the source stripe group to the new stripe group.
Beginning with StorNext 6, use the following procedure to add a new stripe group, move data off the old stripe group and vacate the old stripe group.
Note: The file system remains available to all clients while this operation takes place.
- Label disks for the new stripe group.
- Execute the command
cvadmin –e
to get the fsmpm to reload its view of the StorNext disks. -
Execute the command
sgadd
to add the new stripe group.Sgadd –f <fs> --disks <disks> --sb <stripe breadth> -
Execute the command
sgoffload
to move data off the old stipe group and mark it vacant.Sgoffload –f <fs> -g <stripe group> --vacateNote: The
metadataArchive
configuration variable must be set to true in order to use thesgoffload
utility.
For StorNext releases prior to StorNext 6, use the following procedure to add new stripe groups, and then move data off of the old stripe group.
- Label disks for the new stripe groups you want to add to the file system.
-
If your StorNext configuration includes a failover environment, you must first shut down any standby FSMs that would start when you shut down the primary FSM. The move procedure will not complete successfully unless all FSMs are shut down.
Caution: If you do not shut down standby FSMs, file system corruption or data loss could occur.
- (Optional) Run the
cvfsck
command on the file system. See Check the File System. - Unmount all clients to prevent applications that are writing to preallocated files from trying to do IO to the now read-only stripe group.
- Add the new stripe groups to the file system configuration and mark the old stripe groups as read-only. (Make sure the old stripe group is write disabled.)
- Stop the File System Manager (FSM) for the desired file system.
- Run
cvupdatefs
. - Restart the FSM.
- Run
snfsdefrag -G <n> -m 0 -r /filesystemroot
, where<n>
is the zero-based number of the source stripe group from which the move starts, andfilesystemroot
is the file name of the file system tree’s root. You can specify multiple-G
options to use multiple source stripe groups. - Remount all clients since all pre-allocated blocks have now been moved to the stripe group.
- Verify that no data remains on the original stripe groups.
- Edit the file system configuration to mark the old stripe groups as "Disabled".
- Stop the FSM.
-
Restart the FSM.
Note: The old stripe groups marked "Disabled/Readonly" must be left in the file system configuration file.
As files are created, written to and removed, file system free space can become fragmented. The cvfsck utility has an option to create a free space fragmentation report for each stripe group. The sgdefrag utility can be used to defragment the free space on a stripe group. It does this by retrieving the extent list for each file that has extents on the given stripe group. It moves the file’s data, extent by extent to one or more target stripe groups. This has the effect of making fewer extents overall and grouping free space into larger chunks.
Metadata movement is performed on a LUN level, meaning you must specify the source LUN and the destination LUN. The sndiskmove
command that accomplishes metadata movement has two arguments: a source and destination LUN.
Caution: You can only use the sndiskmove
command if both the source and destination LUNs have EFI labels. VTOC labels are not supported in StorNext 6. Use the special CLI command /usr/cvfs/bin/cvlabel_compat_5 to convert VTOC labels to EFI labels before attempting to use sndiskmove
. The cvlabel_compat_5 command is a StorNext 5 version of cvlabel that supports the conversion of VTOC to EFI labels.
After movement is complete, the physical source disk can be removed.
Note: Although a stripe group can consist of multiple disks or LUNs, the sndiskmove
command moves only a single disk or LUN. Consequently, references to “stripe group” in this section refer to a single disk or LUN when migrating metadata with sndiskmove
.
Caution: The command, sndiskmove
, only works on disks or LUNs of the same size. For instance, if the destination LUN is smaller than the source LUN, then the command fails. However, if the destination LUN is larger than the source, then the additional capacity is ignored.
Caution: The metadata/journal stripe group you want to move cannot contain data. sndiskmove
treats metadata and journal stripe groups the same way, so it doesn’t matter whether the stripe group you want to move is a metadata stripe group, a journal stripe group, or a combined metadata and journal stripe group. The only caveat is that stripe groups used for movement cannot contain data.
If you attempt to move a metadata/journal stripe group that contains data, data loss could occur.
Beginning with StorNext 6, use the Metadata Archive feature and cvmkfs
to replace a metadata stripe group. Use the cvupdatefs
utility to move the journal from one stripe group to a new stripe group.
You can replace a metadata stripe group using all new disks and geometry. The metadata archive backs up all metadata to a database.
Note: The metadata stripe group must not contain user data. If it does, use the sgoffload
utility to offload the data and turn it into an exclusive metadata stripe group. This procedure applies to an unmanaged file system only.
- Ensure that the metadataArchive configuration variable exists and is set to true. Use
sncfgedit
to modify the configuration file for the file system. If this variable is created or changed from false to true, you must restart the FSM and build the database. Once the FSM is restarted, monitor the cvlog file and wait for “Metadata archive creation is complete” to appear in the log. - Unmount the file system from all clients.
- Stop the file system.
- Replace the configuration file for the file system keeping all user data stripe groups intact and removing or replacing exclusive metadata stripe groups.
- Execute the command
cvmkfs –e –r
to initialize the new metadata stripe group. - Start the FSM and mount the file system. Initially, not all files are able to be listed with
ls
. As they are restored from the metadata archive, the namespace eventually completes. While the archive is being reloaded, if an application accesses a file with a full path, that part of the namespace is replaced on-demand. When “Metadata-restore: restore complete” appears in the cvlog, all files are visible and available.
For StorNext releases prior to StorNext 6, use the following procedure to move a metadata/journal stripe group from a source LUN to a destination LUN.
- Stop the File System Manager (FSM) for the file system.
-
If your StorNext configuration includes a failover environment, you must shut down any standby FSMs that would start when you shut down the primary FSM. The movement procedure will not complete successfully unless all FSMs are shut down.
Caution: If you do not shut down standby FSMs, file system corruption or data loss could occur.
- (Optional) Run the
cvfsck
command on the file system. See Check the File System. -
Run
sndiskmove <source-LUN-label-name> <destination-LUN-label-name>
, where<source-LUN-label-name>
is the source stripe group from which the move starts, anddestination-LUN-label-name
is the destination stripe group to which you want to move data.During the move process StorNext appends “
.old
” to the source stripe group name. This is to avoid confusion because the destination stripe group is given the same name as the original stripe group. Both stripe group names remain in the configuration file.For example:
source-LUN-label-name
(the original stripe group name) becomessource-LUN-label-name.old
destination-LUN-label-name
(the new stripe group name) becomessource-LUN-label-name
(the same name as the original stripe group)Note: When you run
sndiskmove
, it could take a considerable amount of time to copy the data between disks, depending on disk size and performance. - Only if your system includes a standby FSM: After you run
sndiskmove
, rescan the disks on the standby FSM’s host by runningcvadmin -e 'disks refresh'
. You must runcvadmin -e 'disks refresh'
on all systems on which you have a configured FSM for the file system involved in the move. - Restart the FSM.
- Only if your system includes a standby FSM: Restart the standby FSM.