A system and method for managing disk space in a thin-provisioned storage
subsystem. If a number of free segments in a free segment pool at a
storage subsystem is detected as below a desired minimum, one or more of
the following is performed: selecting and adding logical devices (LDEVs)
from an internal storage as free segments to the free segment pool,
transitioning LDEVs to a virtual device (VDEV), and/or selecting and
adding LDEVs from an external storage as free segments to the free
segment pool. The transitioning includes identifying partially used or
completely used LDEVs and transitioning these to the VDEV. Data migration
may also occur by: selecting a source segment at a VDEV for migration,
reading data from the source segment, writing the data to a target
segment, the target segment being a free segment from the free segment
pool, and assigning the target segment to the VDEV.