A method for controlling a storage apparatus having a plurality of logical volumes, each of the plurality of logical volumes providing a data storage area to an external device, the storage apparatus having a storage device providing a physical storage area, and a storage controller managing the storage device, the method comprising:
- creating, by the storage controller, a plurality of unit physical storage areas from the storage device;
- operating, by the storage controller, each of the logical volumes as a virtual volume in which, in response to a data input/output (I/O) request from the external device, a unit physical storage area of the plurality of unit physical storage areas is added to each of the logical volumes;
- selecting, by the storage controller, any one of the logical volumes as a primary volume, selecting any one of the rest of the logical volumes as a secondary volume, the primary volume and the secondary volume being configured as a copy pair in which data in the primary volume can be copied to the secondary volume;
- providing the storage controller with a differential bitmap for managing whether or not there is a difference between data in an area in the primary volume and data in an area in the secondary volume corresponding to the area in the primary volume;
- when the primary volume receives from the external device a discarding request for a first unit physical storage area of the plurality of unit physical storage areas, determining, by the storage controller, whether or not the first unit physical storage area exists in the secondary volume corresponding to the first unit physical storage area which a target of the discarding request;
- when it is determined that the first unit physical storage area exists in the secondary volume corresponding to the unit physical storage area which is the target of the discarding request, transmitting, by the storage controller, to the secondary volume an instruction for discarding the first unit physical storage area assigned to the secondary volume;
- and
- in synchronizing the primary volume and the secondary voltume, referring, by the storage controller, to the differential bitmap, and when there is data difference between the area in the primary volume and the area in the secondary volume corresponding to the area in the primary volume, and when none of the unit physical storage areas is assigned to the area in the primary volume, discarding, by the storage controller, the unit physical storage area assigned to the area in the secondary volume.