How To: Rename a Volume

Sunday, November 25 2007 @ 10:28 AM EST

Contributed by: Tim Burton

Recently I faced migrating our main production volume onto new storage. With thousands of FCP projects on the volume I really did not want to spend the next 6 months reconnecting media. This meant the new volume had to have the same name as the volume it was replacing. I decided the cleanest way was to rename the current volume, so I could create the new volume with the correct name. This is something the Xsan literature says can't be done, however it is relatively easy within terminal. Here's how...

Note: I did this procedure using Xsan 1.4.1. I would imagine the principles are the same using other versions.

  1. BACKUP your 'volumename.cfg' file!

    This file lives in /Library/Filesystems/Xsan/config/.

  2. Unmount all clients and stop the volume.

  3. Check the volume cvfsck:

    Use the following commands:

    1. sudo cvfsck -jv volumename
    2. sudo cvfsck -nv volumename

    Ensure the volume is reported to be 'clean'. If reported 'dirty' or that if cvfsck had not been run in read only mode then there would have been changes; run cvfsck -wv to fix the corruption.

    Only proceed with the following steps once the volume is 'clean'.

    Digression: what do those cvfsck flags mean?

    -j Execute journal recovery and then exit. Running journal recovery will ensure all operations have been committed to disk, and that the metadata state is up to date. It is recommended that cvfsck is run with the -j flag before any read-only checks or volume reports are run. -n This option allows a volume to be checked in a read-only mode. The modifications that would have happened are described but are not actually performed. A read-only volume check may display errors if there are journaled volume transactions which have not yet been committed. It is recommended that cvfsck is run with the -j flag before a read-only check is run. -v As default cvfsck runs in verbose mode, however when using the flags above you have to manually add the v flag.
  4. Do the actual renaming

    1. Navigate to /Library/Filesystems/Xsan/config/
    2. Rename the file volumename.cfg to desiredname.cfg
    3. Use a text editor to update the file fsmlist. Replace occurrences of volumename with desiredname.

    Repeat this procedure on each of your metadata controllers.

  5. Fix the ICB mismatch

    To fix the ICB mismatch we caused by changing the name, you will need to run cvfsck in interactive mode. Just type sudo cvfsck with no flags or quoted volumes. Follow the on screen screen prompt and select your renamed volume. Cvfsck will ask if you want to fix the ICB mismatch, reply 'yes'.

  6. Start the volume and remount the clients!

I did a trial run a on a test volume I created, just so I was sure of the outcome before I changed our main volume name. I strongly suggest doing the same!

6 comments



http://www.xsanity.com/article.php?story=20071125064731410