A file migration method, device and storage device

A storage device and file migration technology, applied in the storage field, can solve problems such as fragmentation of disk storage space

CN105637491BActive Publication Date: 2017-06-20HUAWEI TECH CO LTD
3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Publication Date
2017-06-20

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

Embodiments of the present invention provide a file migration method, device and storage device. Wherein, the method includes: the storage device obtains a snapshot of the metadata of the target file, the snapshot includes the logical addresses of the multiple data blocks and the first writing time of the multiple data blocks; from the Among the logical addresses of multiple data blocks and the first write time of the multiple data blocks, determine the logical address of the target data block and the first write time of the target data block; according to the logic of the target data block The address obtains the second write time corresponding to the logical address of the target data block from the metadata of the target file, wherein the metadata of the target file includes the logical address of the target data block and the second write time When determining that the first writing time is the same as the second writing time, migrating the target data block to a pre-allocated continuous storage space. The target file can be migrated to the pre-allocated continuous storage space, thereby achieving the purpose of disk defragmentation.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] Embodiments of the present invention relate to the field of storage technology, in particular to a file migration method, device and storage device. Background technique

[0002] A file system is a data structure that stores and organizes user data, providing users with easy and convenient data access. For a storage device with a file system, the storage space on the disk is transparent to the user. The user does not need to care about the specific location of the data stored in the disk, and can access the data only by accessing the directory or file.

[0003] Write redirection (full name: Redirection On Write, abbreviation: ROW) file system refers to a file system that uses redirection on write to write data. When new user data is written or the original user data is modified, the new data will not overwrite the original old data, but allocate new space on the storage device to write the data, and release it after the new data is successfully writte...

Examples

Embodiment Construction

[0054] Embodiments of the present invention provide a file migration method, a file migration device and a storage device, capable of migrating a target file into a continuous storage space, so as to achieve the purpose of defragmenting the storage space of a disk.

[0055] In the prior art, when defragmenting the storage space in units of files, the files often need to be locked during the migration process to prevent users from modifying the files. Since the file contains several data blocks, in the prior art, the file cannot be unlocked until each data block has been migrated sequentially, which will affect the user's access to the file. However, the embodiment of the present invention can not only achieve the purpose of defragmentation, but also can not lock the file during the migration process of the file, but obtain a snapshot of the metadata of the file that has not been modified after the snapshot. The data blocks are migrated to the pre-allocated continuous storage s...