摘要 |
The present invention relates to the field of network attached storage. A method and device for protecting stored data. The method comprises: receiving an attribute setting instruction that requests setting of a file snapshot level attribute of a file in a file system; setting the file snapshot level attribute of the file according to the attribute setting instruction; receiving a snapshot creation instruction that carries a file snapshot level attribute parameter of a file to be protected; and creating, for the file system according to the snapshot creation instruction, a redirect-on-write (ROW) read-only snapshot that uses the ROW technology, a read-only snapshot level attribute of the ROW read-only snapshot being set according to the file snapshot level attribute parameter. The file snapshot level attribute is set, a snapshot level of a file to be protected by a read-only snapshot is specified when the read-only snapshot is created for the system file, files in the file system for which snapshots should be created are determined according to the application scenario, the using space of the snapshots is controlled, and the space, occupied by the read-only snapshots, of the file system is reduced. |