Patent ID: 8291190

Claim:
A method for writing data to a disk of a disk drive that is configured to access said disk based on large-sized data sectors and that includes a host interface configured to support both large-sized data sectors and small-sized data sectors, said method comprising: receiving a write command; identifying a data sector size of said write command; determining whether a beginning and an end of a rewrite area specified by said write command agree with boundaries of large-sized data sectors on said disk if said data sector size of said write command is a data sector size of a small-sized data sector; reading a head data sector that includes said beginning of said rewrite area from said disk, and making a backup of said head data sector in a first non-volatile memory area if said beginning of said rewrite area does not agree with a boundary of a large-sized data sector on said disk; reading a tail data sector that includes said end of said rewrite area from said disk, and making a backup of said tail data sector in a second non-volatile memory area if said end of said rewrite area does not agree with said boundary of said large-sized data sector on said disk; setting data in a third non-volatile memory area indicating a start of backups before starting said backups into said first non-volatile memory area and said second non-volatile memory area; setting data in a fourth non-volatile memory area indicating a completion of said backups after completing said backups into said first non-volatile memory area and said second non-volatile memory area; starting a rewrite of said rewrite area after completing said backups into said first non-volatile memory area and said second non-volatile memory area; determining a state stage by using said data in said third non-volatile memory area indicating said start of said backups, said data in said fourth non-volatile memory area indicating said completion of said backups, data in said first and said second non-volatile memory areas, and data in said head data sector and said tail data sector in said rewrite area if a power shut-down occurs during execution of a process of said write command; and executing a recovery process in accordance with said determined state stage.