Forum Discussion

kodaali's avatar
kodaali
Level 3
14 years ago

vxresize to shrink FS and to free a disk

Hello, I have to shrink this file system so that disk ndg01 is out of this volume. I tried vxresize different combinations, never got the expected result. # df -h /nmnt Filesystem ...
  • g_lee's avatar
    14 years ago

    Please provide the platform and filesystem type in order to investigate further.

    For filesystem type, provide the output of:

    # fstyp -v /dev/vx/rdsk/ndg/nvol

    eg: if this is a Solaris machine, and the filesystem is ufs (not vxfs), the filesystem cannot be shrunk, as this is a limitation of ufs filesystems.

    If the filesystem is a type (eg: vxfs) that can be shrunk, please provide the exact commands you ran to try to shrink the filesystem, to determine if it was a problem with the syntax/inputs provided to the command.

    EDIT: Apologies, I missed the requirement to shrink the volume off the disk ndg01.

    Presumably when you attempted to shrink the volume earlier, it shrank off ndg03 instead?

    ndg01 is the first subdisk in the volume, so shrinking it won't remove that disk / will shrink off the other/subsequent subdisks first.

    If you have a spare disk, you could evacuate the ndg01 to that disk to free up the space on ndg01. Presumably this is not the case since you're looking to shrink the volume to free up the space.

    A horrible, convoluted way of doing it is:
    1. shrink the volume to 4G (so it will be on ndg01, ndg02)
    2. create a new subdisk on ndg03 (where the extra 2G used to be)
    3. move the subdisk on ndg01 to the new subdisk ndg03

    Note: if you do wish to proceed with this approach, would recommend performing during a downtime window, or at the very least during a quiet period / when the system is not fully loaded

    Commands:
    --------------------
    1. # vxresize -F <fstype> -g ndg nvol 8343552   ## absolute size in sectors, minus space on ndg03

    2. # vxdg -g ndg free
    #### there should be 4173824 sectors free on ndg03 since this has been freed up now

    Make the new subdisk on ndg03 (see vxmake man page for further options/details)
    # vxmake -g ndg sd ndg03-<XX> medianame,<offset>,4169728

    where <XX> is subdisk number, <offset> is offset from vxdg free output, 4169728 is the length of the subdisk being replaced on ndg01

    3. Move the subdisk on ndg01 to ndg03 (see vxsd man page for further options/details)
    # vxsd -g ndg mv ndg01-01 ndg03-<XX>
    --------------------

    If this still does not work, or you are unsure of the offsets/values to use, please provide the platform and SF version being used and the output of the following to determine what values/course of action should be used:

    # vxdg -g ndg free
    # vxprint -qhtrg ndg