Home Directory Redistribution

Moving one or a few users

To move a single user, use the movedir script with the syntax:
     movedir -a user [filesystem]
If not specified, movedir will pick the filesystem with the most available space. The -a option will select auto mode which verifies that the user is not logged in and removes all the "Are you sure?" type questions. Movedir needs to run on a cluster member that has access to all the filesystems that have home directories for this cluster. For example, run it on a homer or seuss2, not a generic aesop.

To move a user's web directory, use the -w option on the movedir command. Moving web directories requires that you run the command on seuss2 as root.

Moving many users off a disk

When we have a disk that has gone critical and needs people moved off now, cd to the top level of that disk and run the /usr/local/etc/migrate.sh script. The migrate.sh script will move 30 or 50 random users from the filesystem using movedir -a For example, to free up some space on /rc04 you would run:
     #homer15> cd /rc04
     #homer15> /usr/local/etc/migrate.sh

For a web disk, use the migrate.sh -w command. This command must be run on the master host for the cluster. That would be seuss2 for the /hwXX filesystems or guido05 for the /dwXX filesystems.

Balancing the load on all disks

The /usr/local/etc/migrate [-w] program will balance the load on all the filesystems that are displayed by the dfua [-w] utility. It does this by executing a dfua command and then running the migrate.sh script on the fullest of the disks until they're all within bounds. The bounds are determined by the configuration file /usr/local/etc/migrate.conf. Normally min = 60, max = 75 which tells migrate to stop if all the disks are above 60% full or they're all below 75% full (this is from days when we were more optimistic). If you want to override the default configuration parameters you can specify alternate min and max values on the command line:
     #homer15> /usr/local/etc/migrate -m 75,85
     #guido05> /usr/local/etc/migrate -w -m 80,90
Again, make sure you run the migrate -w command on the appropriate cluster master.

Moving all the users off a disk

If we have a failing disk or we simply want to decommission a disk, we must first move all the users off of it. The first step is to update the qdf so no new users (or worse, the users you're trying to move) get assigned to the disk you're trying to clear. This is done by setting the "N" (new) flag to 0.

The -c option on the migrate.sh script will attempt to move all users off of the current disk. For example:

     #homer15> cd /rc02
     #homer15> /usr/local/etc/migrate.sh -c
or:
     #seuss2> cd /hw12
     #seuss2> /usr/local/etc/migrate.sh -c -w
This simply increases the number of users it moves from the 30 or 50 to an unlimited number and uses the -force parameter on the movedir command rather than -auto. It normally has to be run several times over a period of several days. Eventually, intervening:
     #homer15> isheon -v user
     #homer15> rsh homerxx ps -fu user
     #homer15> rsh homerxx kill -HUP PID
type commands may be required at appropriate times (try to warn the user first if they're current sessions).


Ken Lowe
Email -- ken@u.washington.edu
Web -- http://staff.washington.edu/krl/