CN116466871A - Method for accessing storage device and related product - Google Patents

Method for accessing storage device and related product Download PDF

Info

Publication number
CN116466871A
CN116466871A CN202210459306.8A CN202210459306A CN116466871A CN 116466871 A CN116466871 A CN 116466871A CN 202210459306 A CN202210459306 A CN 202210459306A CN 116466871 A CN116466871 A CN 116466871A
Authority
CN
China
Prior art keywords
storage device
storage
command
host
space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210459306.8A
Other languages
Chinese (zh)
Inventor
李小凤
王祎磊
何蒙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Starblaze Technology Co ltd
Original Assignee
Chengdu Starblaze Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Starblaze Technology Co ltd filed Critical Chengdu Starblaze Technology Co ltd
Publication of CN116466871A publication Critical patent/CN116466871A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Abstract

The present application relates to a method for accessing a storage device and related products, the method comprising initializing the storage device, obtaining a storage capacity of the storage device; in response to determining that the storage capacity of the storage device has changed, checking whether a partition table of the storage device is abnormal; and in response to checking out the partition table abnormality of the storage device, if the correct partition table is found at the designated location of the storage space of the storage device, accessing the storage space before the designated location using the first method and accessing the storage space after the designated location using the second method. According to the technical scheme, the storage space at different positions inside the storage device is accessed in different modes, so that required data can be accurately and effectively obtained.

Description

Method for accessing storage device and related product
Technical Field
The present application relates generally to the field of storage technology. More particularly, the present application relates to a method for accessing a storage device, and a host and a computer readable storage medium performing the aforementioned method.
Background
FIG. 1A illustrates a block diagram of a solid state storage device. The solid state storage device 102 is coupled to a host for providing storage capability for the host. The host and solid state storage device 102 may be coupled by a variety of means including, but not limited to, connecting the host to the solid state storage device 102 via, for example, SATA (Serial Advanced TechnoLogy Attachment ), SCSI (Small Computer System Interface, small computer system interface), SAS (Serial Attached SCSI ), IDE (Integrated Drive Electronics, integrated drive electronics), USB (Universal Serial Bus ), PCIE (Peripheral Component Interconnect Express, PCIE, peripheral component interconnect Express), NVMe (NVM Express), ethernet, fibre channel, wireless communications network, and the like. The host may be an information processing device capable of communicating with the storage device in the manner described above, such as a personal computer, tablet, server, portable computer, network switch, router, cellular telephone, personal digital assistant, or the like. The storage device 102 (hereinafter, solid-state storage device will be simply referred to as storage device) includes an interface 103, a control section 104, one or more NVM chips 105, and a DRAM (Dynamic Random Access Memory ) 110.
The NVM chip 105 includes common storage media such as NAND flash memory, phase change memory, feRAM (Ferroelectric RAM, ferroelectric memory), MRAM (Magnetic Random Access Memory, magnetoresistive memory), RRAM (Resistive Random Access Memory, resistive memory), and the like.
The interface 103 may be adapted to exchange data with a host by way of, for example, SATA, IDE, USB, PCIE, NVMe, SAS, ethernet, fibre channel, etc.
The control unit 104 is used for controlling data transmission among the interface 103, the NVM chip 105 and the DRAM110, and also for memory management, host logical address to flash physical address mapping, erase balancing, bad block management, etc. The control component 104 can be implemented in a variety of ways, such as software, hardware, firmware, or a combination thereof, for example, the control component 104 can be in the form of an FPGA (Field-programmable gate array, field programmable gate array), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), or a combination thereof. The control component 104 may also include a processor or controller in which software is executed to manipulate the hardware of the control component 104 to process IO (Input/Output) commands. Control unit 104 may also be coupled to DRAM110 and may access data of DRAM 110. FTL tables and/or cached data of IO commands may be stored in the DRAM.
The control section 104 includes a flash interface controller (or referred to as a media interface controller, a flash channel controller) coupled to the NVM chip 105, which issues commands to the NVM chip 105 in a manner conforming to an interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives a command execution result output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI", and the like.
FTL (Flash Translation Layer ) is utilized in the storage device 102 to maintain mapping information from logical addresses (LBAs) to physical addresses. The logical addresses constitute the memory address space of the solid state memory device as perceived by upper level software such as the operating system. The physical address is an address for accessing a physical storage unit of the solid state storage device. Address mapping may also be implemented in the related art using an intermediate address modality. For example, logical addresses are mapped to intermediate addresses, which in turn are further mapped to physical addresses. The table structure storing mapping information from logical addresses to physical addresses is called FTL table. FTL tables are important metadata in a storage device. The entries of the FTL table record address mapping relationships in units of data pages in the storage device.
FTLs of some storage devices are provided by a host to which the storage device is coupled, FTL tables are stored by a memory of the host, and FTLs are provided by a CPU executing software of the host. Still other storage management devices disposed between a host and a storage device provide FTLs. In these cases, the read/write command received by the storage device indicates a physical address.
Commands provided by the host to the storage device may access logical addresses corresponding to one or more entries of the FTL table. And the control component may change the form of the command received from the interface 103 (e.g., split the command according to the logical address space size corresponding to the FTL entry) and process the command to change the form. For clarity purposes, herein, access to a single FTL entry by a read/write command received by a storage device is described as an example.
FIG. 1B shows a schematic diagram of a prior art logical address space. In the prior art, a logical address space is a storage address space provided by a storage device, and a host can access the storage device using elements (logical addresses) in the logical address space. In general, the logical address (Logical Block Addressing, LBA) space that can be accessed by the host is the same size as the LBA space that can be provided by the storage device. For a logical address space, the storage device manages the mapping between logical and physical addresses through FTL tables.
FIG. 1C illustrates a schematic diagram of a host accessing a storage device. In fig. 1C, the host sends an IO command (read/write command) to the storage device, the IO command indicating a logical address (LBA address) to be accessed, the storage device converts the LBA address into a physical block address (Physical Block Address, PBA) based on the FTL table managed in the control section, and then the control section accesses the NVM chip according to the PBA address.
With the increasing data storage technologies, various data are stored in a storage device, such as user data, an operating system, application data, or data required for restoring factory settings of a host, and some data are not desired to be seen by a user (such as data required for restoring factory settings of a host) in order to improve the security of the data, and the data may be stored in a hidden manner in the storage device, where the hidden manner refers to that the data cannot be accessed by the user or the application on the host side.
Disclosure of Invention
The hidden stored data in the prior art is usually hidden from the application program of the host, but is visible to the operating system of the host, and if the operating system is invaded or misoperated, the hidden stored data is also subject to risks such as tampering or deletion. In the related art, in order to improve security of the hidden and stored data, the hidden and stored data in the storage device is hidden to both the host application program and the operating system, and the host cannot normally access and modify the hidden and stored data through the application program or the operating system, and only when the hidden and stored data is needed to be used, the host can access the hidden and stored data, for example, when the host needs to restore factory settings, the host can access the data needed by the host in the storage device to restore factory settings, so as to execute the factory settings.
The storage device can set different working modes according to different requirements, for example, the working mode of the storage device is a hidden mode under normal conditions, and the working mode of the storage device is a common mode under the condition that the hidden stored data is required to be used; in addition, the storage capacity set by the storage device in the normal mode is different from that in the hidden mode, and the storage capacity set in the normal mode is larger than that in the hidden mode. To enable access to the hidden stored data or to the hidden part of the data, the storage device may be switched between a hidden mode and a normal mode. Since the storage capacities corresponding to the different operation modes are different, the storage capacity of the storage device acquired by the host changes when the hidden mode and the normal mode are switched.
When a host accesses a storage device and writes data, a corresponding operation needs to be performed according to a partition table stored in a storage space of the storage device, where the partition table is generally stored in a storage space at the head and/or tail of the storage space of the storage device. When the working mode of the storage device is switched from the normal mode to the hidden mode or from the hidden mode to the normal mode, the storage capacity of the storage device changes, and when the host needs to access or write data to the storage device, the host cannot search the partition table from the head or tail of the storage space, so that the access or write data to the storage device fails. Therefore, the present application expects that the storage device can switch between the hidden mode and the normal mode, so that when the storage capacity of the storage device changes, the host can still successfully access the storage device.
In order to successfully acquire required data (for example, data visible to a host or data hidden to the host), after acquiring the storage capacity of the storage device, the host needs to determine whether the storage capacity of the storage device changes, check whether a partition table of the storage device is normal when the storage capacity is changed, and access the storage space of the storage device by using different access modes according to specific abnormal conditions of the partition table, so that the required data can be successfully acquired from the storage device.
Further, in the scheme provided by the embodiment of the application, for the storage space part which can be accessed by the host in the hidden mode or the common mode, the storage space part can be accessed by using the file system existing in the storage space part; for the storage space part which can be accessed by the host only in the normal mode, the host cannot directly use the existing file system to access, and the created block device, partition or the logical address of the part can be used for accessing the storage space part, so that the access requirement of data when the storage capacity is changed in transmission is met.
Further, in the scheme provided by the embodiment of the application, when the working mode of the storage device is switched from the normal mode to the hidden mode, the partition table backed up in the hidden mode can be written back to the designated position and the head of the storage address space of the storage device, so that the abnormal partition table caused by the change of the working mode of the storage device is avoided.
Further, in the prior art, the operating system sets that the host triggers the initialization of the storage device to acquire the storage capacity of the storage device when the host is started, and cannot trigger the operation of acquiring the storage capacity of the storage device at other moments. That is, when the operation mode of the storage device is switched to change the storage capacity during the operation of the host, the host cannot know whether the storage capacity is changed or still accesses the storage device according to the storage capacity before the change during the operation. When the storage capacity of the storage device changes, an abnormality may occur in the partition table, so that the host fails to access the storage device. In order to enable the host to acquire the changed storage capacity in real time after the storage capacity of the storage device is changed. In the scheme provided by the embodiment of the application, the command for adjusting the working mode of the storage equipment can be registered so as to adjust the time for storing and acquiring the storage capacity of the storage equipment, so that the host can send the Identify command to the storage equipment at any time according to the requirement so as to acquire the storage capacity of the storage equipment.
Furthermore, in the scheme provided by the embodiment of the application, the abnormal error condition of the partition table can be distinguished by combining the mode switching mark. Specifically, if the correct partition table can be found at the designated position and the mode switching mark can be found, it is indicated that the abnormal error of the partition table is caused by the change of the working mode of the storage device at this time, the host does not need to process the abnormal error of the partition table, so that the problem that the storage device cannot be used normally due to further processing of the host can be avoided. If the correct partition table is not found or the mode switching mark is not found at the designated position, the fault is indicated, and the fault is reported at the moment so that the subsequent maintenance can be timely carried out.
According to a first aspect of the present application, there is provided a first method for accessing a storage device according to the first aspect of the present application, comprising: initializing the storage equipment to obtain the storage capacity of the storage equipment; in response to determining that the storage capacity of the storage device has changed, checking whether a partition table of the storage device is abnormal; and in response to checking out the partition table abnormality of the storage device, if the correct partition table is found at the designated location of the storage space of the storage device, accessing the storage space before the designated location using the first method and accessing the storage space after the designated location using the second method.
According to a first method for accessing a storage device according to a first aspect of the present application, there is provided a second method for accessing a storage device according to the first aspect of the present application, accessing a storage space before the specified location using a first manner comprising: and accessing the storage space before the specified position by utilizing the file system existing in the storage space before the specified position.
According to a first method for accessing a storage device according to a first aspect of the present application, there is provided a third method for accessing a storage device according to the first aspect of the present application, accessing a storage space after the specified location using a second manner includes: creating a block device related to a storage space after the specified location and accessing the block device according to the block device; or creating a partition of the storage space after the specified location and accessing the partition according to the partition; or directly accessing the storage space after the designated position according to the logic address of the storage space after the designated position.
According to a third method for accessing a storage device according to the first aspect of the present application, there is provided a fourth method for accessing a storage device according to the first aspect of the present application, creating a block device with respect to a storage space after the specified location, and accessing it according to the block device, comprising: creating the block device using a storage space after the specified location; mounting the block device to a designated path of a file system; and accessing the storage space behind the specified position according to the specified path.
According to a third method for accessing a storage device according to the first aspect of the present application, there is provided a fifth method for accessing a storage device according to the first aspect of the present application, creating a partition regarding a storage space after the specified location, and accessing it according to the partition includes: updating a partition table of the storage device to create a partition corresponding to the storage space after the specified position; and accessing the storage space after the specified location from the partition.
According to one of the first to fifth methods for accessing a storage device according to the first aspect of the present application, there is provided a sixth method for accessing a storage device according to the first aspect of the present application, further comprising: backing up the partition table at the appointed position of the storage space before updating the partition table of the storage device; and in response to detecting that the working mode of the storage device is switched to the hidden mode, writing the backed-up partition table back to the designated position.
According to a sixth method for accessing a storage device according to the first aspect of the present application, there is provided a seventh method for accessing a storage device according to the first aspect of the present application, further comprising: and restoring the updated partition table in the storage device by using the backed-up partition table.
According to a seventh method for accessing a storage device according to the first aspect of the present application, there is provided a method for accessing a storage device according to the eighth aspect of the present application, wherein restoring the updated partition table in the storage device using the backed-up partition table includes: and writing the backed-up partition table back to the designated position and the head of the storage address space of the storage device.
According to one of the first to eighth methods for accessing a storage device according to the first aspect of the present application, there is provided a ninth method for accessing a storage device according to the first aspect of the present application, further comprising: and sending a command triggering the storage device to adjust the working mode, wherein the command comprises a mode switching command or a Set Feature command defined by NVMe protocol.
According to a ninth method for accessing a storage device according to the first aspect of the present application, there is provided a method for accessing a storage device according to the tenth method of the first aspect of the present application, further comprising, before issuing a command to trigger an adjustment of an operation mode thereof to the storage device: registering the mode switching command to associate the mode switching command with the Identify command.
According to a tenth method for accessing a storage device according to the first aspect of the present application, there is provided a method for accessing a storage device according to the eleventh aspect of the present application, further comprising: and in response to sending the registered mode switching command to a storage device, sending the Identify command to the storage device to acquire the storage capacity of the storage device.
According to one of the ninth to eleventh methods for accessing a storage device according to the first aspect of the present application, there is provided the twelfth method for accessing a storage device according to the first aspect of the present application, further comprising: in response to issuing the mode switch command, a mode switch flag is recorded.
According to a twelfth method for accessing a storage device according to the first aspect of the present application, there is provided a thirteenth method for accessing a storage device according to the first aspect of the present application, further comprising: responding to the detection of the abnormal partition table of the storage device, and if the correct partition table is found at the designated position of the storage space of the storage device and the mode switching mark is found, ignoring the abnormal partition table error; or in response to detecting that the partition table of the storage device is abnormal, if the correct partition table is not found in the designated position of the storage space of the storage device or the mode switching mark is not found, reporting an error.
According to a twelfth method for accessing a storage device according to the first aspect of the present application, there is provided a fourteenth method for accessing a storage device according to the first aspect of the present application, further comprising: determining a storage address space range of the storage device according to the storage capacity of the storage device; and responding to the IO command to be sent to the storage device, and refusing to send the IO command to the storage device if the address of the storage space after the designated position is accessed in the IO command exceeds the storage address space range of the storage device.
According to one of the twelfth method for accessing a storage device to the fourteenth method for accessing a storage device of the first aspect of the present application, there is provided the fifteenth method for accessing a storage device according to the first aspect of the present application, further comprising: and deleting the mode switching mark.
According to a second aspect of the present application, there is provided a host according to the second aspect of the present application for implementing one of the first to fifteenth methods for accessing a storage device of the first aspect of the present application.
According to a third aspect of the present application, there is provided a computer readable storage medium according to the third aspect of the present application, which when executed by a processor, causes one of the first to fifteenth methods for accessing a storage device of the first aspect of the present application to be implemented.
Drawings
For a clearer description of embodiments of the present application or of the solutions of the prior art, reference will be made below to the accompanying drawings, which are used in the description of embodiments or of the prior art, it being obvious that the drawings in the description below are only some embodiments described in the present application, from which other drawings can also be obtained for a person skilled in the art;
FIG. 1A illustrates a block diagram of a solid state storage device;
FIG. 1B illustrates a schematic diagram of a prior art logical address space;
FIG. 1C illustrates a schematic diagram of a host accessing a storage device;
FIG. 1D is a schematic diagram of a LBA space presented to a host by a hidden-mode storage device according to an embodiment of the present application;
FIG. 2A is a schematic diagram of a storage space visible to a hidden mode host according to an embodiment of the present application;
FIG. 2B is a schematic diagram of a storage space visible to a normal mode host according to an embodiment of the present application;
FIG. 3 illustrates a flow chart of a method for accessing a storage device according to an embodiment of the present application;
FIG. 4 illustrates a flow chart of another method for accessing a storage device provided by embodiments of the present application; and
FIG. 5 illustrates a schematic diagram of a logical address space of a memory device provided by an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application, taken in conjunction with the accompanying drawings, clearly and completely describes the technical solutions of the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In order to improve the security of the data stored in a hidden manner, the data stored in the storage device is hidden to both the host application program and the operating system, and the host cannot access and modify the data stored in the hidden manner through the application program or the operating system under normal conditions, and can access the data stored in the hidden manner only when the data stored in the hidden manner is required to be used. For this reason, in practical applications, the operation modes of the storage device may be set to various modes, including at least a hidden mode and a normal mode. Wherein in the hidden mode, the storage device provides a portion, but not all, of its logical address space to the host, such that the host is aware of only a portion of the storage device's logical address space. And, if the host attempts to access a logical address space that is present in the storage device but not provided to the host, the storage device will reject such access requests by the host and report errors.
The normal mode is a working mode opposite to the hidden mode, and the normal mode refers to a working mode in which part or all of the hidden logical address space is visible to the host, that is, in the scheme provided by the embodiment of the application, for the storage device in different modes, the size of part of the logical space of the storage device known by the host is dynamically changed. Optionally, in the normal mode, the logical address space hidden in the hidden mode is provided to the host entirely, and at this time, the storage device is provided to the logical address space of the host, which is the same as or smaller than the logical address space maintained inside the storage device. It will be appreciated that in some embodiments, the portion of the hidden logical address space maintained by the storage device in the hidden mode is not visible to the host, either in the normal mode or the hidden mode.
For ease of understanding and explanation, embodiments of the present application introduce a set of concepts of logical address space and logical address space that are visible to a host. Where the logical address space (LBA space) is the storage address space provided by the storage device, and the host accesses the storage device using the logical address as an element of the logical address space. Since the storage device can switch between normal mode and hidden mode, in hidden mode the storage device hides portions of the logical address space from the host. Further, the embodiment of the application introduces a set of concepts of a logical address space visible to the host (LBA space visible to the host) and a hidden logical address space (hidden LBA space) on the basis of the logical address space, where the logical address space visible to the host is a storage address space in the logical address space that is reported to the host by a storage device in the logical address space and is accessed by the host according to the block device, and the hidden LBA space is a storage address space in the logical address space that is not reported to the host by the storage device in the hidden mode and is not accessed by the host according to the block device.
FIG. 1D illustrates a schematic view of a LBA space presented to a host by a hidden-mode storage device provided by embodiments of the present application. As shown in fig. 1D, the LBA space includes a LBA space visible to the host and a hidden LBA space, where the LBA space visible to the host is part or all of the storage address space of the LBA space. By way of example, the logical address space visible to the host provided by embodiments of the present application is a dynamically variable memory address space. When the storage device is in normal mode, the hidden LBA space is visible or accessible to applications and/or operating systems in the host, and the host visible logical address space is the full logical address space, which is the same size as the logical address space. When the storage device is in the hidden mode, the hidden LBA space is a "LBA space" that is invisible or inaccessible to applications and/or operating systems in the host, and the logical address space visible to the host is a portion of the logical address space that is smaller in size than the logical address space.
The following describes the acquisition of storage space information of a storage device by a host in different operation modes with reference to fig. 2A and 2B.
Fig. 2A illustrates a schematic diagram of a host acquiring storage space information of a storage device in a hidden mode of the storage device according to an embodiment of the present application. As shown in fig. 2A, when the host initializes the storage device, for example, during startup, storage space information of the storage device, such as a storage capacity provided by the storage device, a starting address of a hidden storage space, and the like, may be acquired. For example, the storage device may be in a hidden mode when delivered to a customer, i.e., a portion of the storage device's LBA space is visible to the host (referred to as host-visible LBA space), i.e., LBA space that is accessible in IO commands provided by the host to the storage device, and a portion is invisible to the host (referred to as hidden LBA space), i.e., LBA space that is not accessible by the host or known to the host application, operating system, or file system.
For example, referring to fig. 2A, the LBA space size of the storage device is 356GB, the LBA space size visible to the host and the LBA space size hidden from the host may be set at the manufacturing stage of the storage device, e.g., the LBA space size visible to the host is 256GB, the LBA space size hidden from the host is 100GB, where the LBA space hidden from the host is located after the LBA space visible to the host, i.e., in the logical address space maintained by the storage device, the logical address range of the LBA space visible to the host is 0-256GB, and the logical address range of the LBA space hidden from the host is 256GB-356GB. In addition, LBA space visible to the host may store user data/operating system/applications, LBA space hidden from the host may store data needed for the host to restore factory settings. In hidden mode, the storage device sets its storage capacity according to the LBA space size visible to the host, i.e. at this point the storage device sets its storage capacity to 256GB. When the host initializes the storage device, the storage space information of the storage device is acquired, for example, the host may acquire that the storage capacity of the storage device is 256GB and/or the starting address of the hidden LBA space is lba=256 GB. When the host acquires the storage capacity of the storage device as 256GB, the host knows that the accessible logical address space is 0-256GB, the host operating system, the application program or the disk manager can access the data in the range of 0-256GB in the logical address space of the storage device, and the host operating system, the application program or the disk manager cannot access the data in the range of 256-356 GB in the logical address space of the storage device, so that in the hidden mode, the 256-356 GB in the logical address space of the storage device is invisible to the host operating system, the application program or the disk manager.
Fig. 2B illustrates a schematic diagram of a host acquiring storage space information of a storage device in a normal mode of the storage device according to an embodiment of the present application. The normal mode mentioned in fig. 2B is compared to the hidden mode in fig. 2A, where the host cannot access the hidden LBA space, and in the normal mode, the storage device sets the storage capacity in combination with the LBA space visible to the host and the hidden LBA space size, i.e. the storage device sets its storage capacity to 356GB. When the host initializes the storage device, the storage space information of the storage device is acquired, for example, the host may acquire the storage capacity of the storage device to be 356GB. When the host acquires the storage capacity of the storage device to be 356GB, the host knows that the accessible logical address space is 0-356GB, and the host operating system, the application program or the disk manager can access the data in the range of 0-356GB in the logical address space of the storage device. Further, in the normal mode, the host may access the hidden LBA space in addition to the LBA space visible to the host. That is, in normal mode, the host can access the LBA space of the entire storage device.
In addition, metadata (e.g., partition tables) for certain storage systems is recorded at the head and end of storage space of the storage capacity provided by the storage device. For example, in the hidden mode, the storage capacity provided by the storage device is 256GB, and metadata is stored at the tail of 256GB of space. As can be seen from fig. 2A and 2B, the storage capacity of the storage device in different operation modes may change, and when the storage device mode is switched (from the hidden mode to the normal mode), the LBA space of the storage device changes from 256GB to 356GB. In the process of accessing the storage device, the host computer does not have original metadata at the tail of the changed storage space due to the large storage capacity of the storage device, and the operating system tries to acquire the metadata (such as a partition table) from the tail of the LBA space (near 356 GB) after recognizing that the storage device is 356GB in size, but fails to acquire the metadata, namely, the partition table of the storage device is checked to be abnormal. Since the above failure in acquiring metadata is caused by switching the operation modes of the storage device, the present application is expected to avoid the problem that the host fails to access the storage device due to the failure in acquiring metadata caused by switching the operation modes of the storage device as much as possible. In view of this, the present application provides a scheme for accessing a storage device as follows.
Fig. 3 illustrates a flow chart of a method 300 for accessing a storage device according to an embodiment of the present application. As shown in fig. 3, at step S301, a storage device may be initialized and a storage capacity of the storage device may be acquired. As one implementation, the host may obtain the storage capacity of the storage device by querying the storage device (for a specific acquisition of storage capacity, see below). Thus, the host can determine the storage capacity of the storage device from the range of LBA addresses visible to the host. By acquiring the storage capacity of the storage device, it is possible to determine whether the storage device switches the operation mode according to the storage capacity.
At step S302, in response to determining that the storage capacity of the storage device has changed, it may be further checked whether the partition table of the storage device is abnormal. For example, the partition table may be detected from a tail region of LBA space provided by the storage device that is visible to the host, and if the partition table cannot be looked up, the partition table is declared abnormal. By way of example, a change in storage capacity of a storage device is a change in storage capacity of a storage device currently being initially acquired for the storage device as compared to the storage capacity of the storage device last being initially acquired for the storage device. Also by way of example, the host initializing the storage device is typically the host startup phase.
In response to checking the partition table of the storage device for anomalies, if the correct partition table is found at the specified location of the storage space of the storage device, then the storage space before the specified location is accessed in a first manner and the storage space after the specified location is accessed in a second manner, at step S303. It is understood that the specified location in the present invention may be understood as a tail region of the LBA space visible to the host provided by the storage device in the hidden mode, so that the storage space before the specified location is visible to the host, while the storage space after the specified location is visible to the host in the normal mode and is hidden from the host in the hidden mode. For example, in fig. 2A and 2B, the storage device has an LBA space size of 356GB, such as 256GB (0-256 GB) for LBA space size visible to the host, and 100GB (256-356 GB) for hidden LBA space size. The designated location is understood to be a 256GB partition location, and the storage space before the designated location is 0 to 256GB, and the storage space after the designated location is 256 to 356GB.
According to the embodiment of the application, when the abnormal partition table of the storage device is detected, it is indicated that the partition table cannot be found in the tail area of the LBA space visible to the host provided by the storage device in the current working mode, and meanwhile, the correct partition table can be found from the specified position, which indicates that the storage capacity of the storage device acquired by the host is increased, and the storage capacity of the storage device is increased due to the fact that the storage device is switched from the hidden mode to the normal mode. In addition, since the storage capacity of the storage device becomes large, particularly, a logical address space corresponding to after the specified location cannot be accessed by the same access manner as a logical address space corresponding to before the specified location, for example, a file system manner.
By way of example, access to the storage space prior to the specified location may be implemented using file system access already existing within the storage space prior to the specified location. From the foregoing, it will be appreciated that the storage space before the specified location is always visible to the host, i.e., the file system in the host will record information about the storage space before the specified location. Thus, access can be made directly with the existing file system.
By way of example, the manner of access to the memory space after the specified location may include a variety of. As can be seen from the foregoing description, the storage space following the specified location is hidden from the host in the hidden mode, and is visible to the host in the normal mode. Thus, the file system of the host computer does not record information about the storage space after the specified location, and the file system cannot directly access the partial storage space.
As an embodiment, a block device may be created with respect to the storage space after the specified location and accessed according to the block device. Specifically, the block device may be created using the storage space after the aforementioned designated location. Then, the block device is mounted to a specified path of the file system, and a storage space after the specified position is accessed according to the specified path.
As another implementation, a partition may also be created for storage space after a specified location and accessed according to the partition. Specifically, the partition table of the storage device may be updated to create a partition corresponding to the storage space after the specified location to access the storage space after the specified location from the partition. After the storage device is switched from the hidden mode to the normal mode, the storage capacity provided by the storage device becomes larger at this time, and when the storage space after the specified position is accessed according to the partition by creating the partition related to the storage space after the specified position, the partition table which is updated is required to be updated to the already existing partition table, wherein the updated partition table can access the storage space with the larger storage capacity.
As a further embodiment, it is also possible to access the memory space directly from its logical address after the specified location. For example, the logical address range corresponding to the memory space after the specified location is 256GB-356GB. Thus, the corresponding logical address can be used directly for access.
Further, by way of example, the partition table of the storage device at the specified location may be backed up prior to updating the partition table of the storage device to write the backed up partition table back to the specified location upon detecting that the operating mode of the storage device is switched to the hidden mode. Thus, when the operation mode of the storage device is switched back to the hidden mode, the partition table in the hidden mode can be found and the storage device can be accessed according to the partition table in the hidden mode.
By way of example, further, the updated partition table in the storage device may also be restored using the backed up partition table. As one implementation, the backed-up partition table may be written back to a specified location and the header of the storage address space of the storage device. Therefore, the storage device can be ensured to work normally after being switched from the normal mode to the hidden mode.
Further, for example, to control the storage device to switch operating modes, the host may also issue a command to the storage device that triggers the host to adjust the operating modes. As one embodiment, the command may include a mode switch command. The mode switching command is a custom command and is not a protocol-defined command. However, the format of the mode switch command conforms to a protocol (e.g., NVMe protocol). By way of example, the mode switch command includes a "command code" having a specified value with an optional "command parameter" command code to indicate that the current command is a mode switch command. The host specifies the content or parameter value of the mode switch command. By way of example, the mode switch command provided by the host to the storage device includes only a command code (without specifying a command parameter). The storage device recognizes that the received command is a mode switch command based on the command code, and changes the mode of the current storage device, for example, if the storage device is currently in a hidden mode, to a normal mode in response to receiving the mode switch command; and/or if the storage device is currently in the normal mode, changing to the hidden mode in response to receiving the mode switch command. In yet another example, a mode switch command provided by a host to a storage device includes a command code and a command parameter. The storage device recognizes that the received command is a mode switching command according to the command code, and further determines a mode to be entered by the storage device according to the command parameter. The switch from the hidden mode to the normal mode is indicated when the command parameter is, for example, 0, and the switch from the normal mode to the hidden mode is indicated when the command parameter is, for example, 1.
The content of the host defines the mode switching command to instruct the storage device to execute the working mode switching operation after receiving the mode switching command, or configures parameters of the mode switching command, for example, the host instructs the storage device to execute the working mode switching operation after receiving the mode switching command by setting a value of a command parameter in the mode switching command.
When the host defines the content of the mode switching command, the storage device switches the current working mode according to the mode switching command, and as an example, in response to receiving the mode switching command in the normal mode, the storage device switches from the normal mode to the hidden mode; or in response to receiving the mode switch command in the hidden mode, the storage device switches from the hidden mode to the normal mode. When the host configures the command parameter of the mode switching command, the storage device switches the operation mode according to the value of the command parameter, for example, the command parameter of the host configures the mode switching command to be configured according to the operation mode of the current storage device, for example, the operation mode of the current storage device is a hidden mode, and in order to control the storage device to switch to the normal mode, the command parameter is configured to be 0, and the storage device switches the operation mode to the normal mode according to the value of the command parameter; the current working mode of the storage device is a normal mode, and in order to control the storage device to switch to a hidden mode, the command parameter is configured to be 1, and the storage device switches the working mode to the hidden mode according to the command parameter value.
By way of example, the specific format of the host-defined mode switch command may also include a command code and two or more command parameters to implement further functions.
In one embodiment, the mode switch command instructs the storage device to: set to hidden mode, set to normal mode, and set to hidden LBA space size. Wherein the function set to the hidden mode and the function set to the normal mode are suitable for use during operation of the storage device, and the function set to the size of the hidden LBA space is suitable for use when the storage device is manufactured to provide the storage device with a specified size of the hidden space to a user. When the mode switch command indicates that the hidden LBA space size is set, the value of the hidden LBA space size is also described by a further command parameter.
Further, a command parameter of the mode switch command is used to indicate the data length to be transmitted by the current command, so as to meet the requirements of the host and the storage device. The host and/or storage device determines whether processing of the current command is complete by identifying the data length to be transmitted by the current command indicated in the command parameters. Since the mode switch command does not require data transfer between the host and the storage device, the command parameter is set to 0 in the mode switch command.
Similarly, a further command parameter of the mode switch command is used to indicate the length of metadata to be transmitted by the current command, which command parameter is also set to 0 in the mode switch command in accordance with embodiments of the present application.
When the mode switch command indicates that the hidden LBA space size function is set, it is also indicated by one or more command parameters, for example, whether the hidden LBA space is initialized, whether the hidden LBA space requires 4KB alignment, etc.
As another implementation manner, the aforementioned command for triggering the storage device to adjust the operation mode may also be a Set Feature command defined by the NVMe protocol. The Set Feature command of the NVMe protocol can Set a variety of different "features" by a command parameter. For a specific storage device, some "features" are not supported, so that when it receives a Set Feature command for such features (functions), it is not necessary to perform processing, so that a Set Feature command indicating such features (functions) can be utilized as a mode switching command, so that it is not necessary to add a new command.
By way of example, the "LBA Range Type" is one of the features that a Set feature command may indicate, and some current storage devices do not support. Thus, a Set Feature command with an "LBA Range Type" command parameter is used as a mode switch command according to an embodiment of the present application. For this purpose, in the Set Feature command, one or more command parameters are carried in addition to the "LBA Range Type" command parameter, so that the mode switch command instructs the storage device to: set to hidden mode, set to normal mode, and set to hidden LBA space size. And when the mode switch command indicates that the hidden LBA space size function is set, also indicates, for example, by one or more command parameters, whether the hidden LBA space is to be initialized, whether the hidden LBA space requires 4KB alignment, and so forth. Specifically, the "Data Structure Entry" field of the Set Feature command with the "LBA Range Type" command parameter is utilized to describe one or more parameters for the mode switch command.
In yet another example, the Set Feature command indicates two logical address intervals LBA0 through LAB100, LBA200 through LBA 300. According to the embodiment of the application, on the basis that the function of the Set Feature command for indicating one or more sections of logical address intervals is defined by using the existing NVMe protocol, one or more sections of logical address intervals indicated by the Set Feature command are Set as logical address intervals accessible to a host or as logical address intervals inaccessible to the host, so that part of logical address spaces in the storage device are hidden or displayed for the host. Further, the operation mode of the storage device and the value indicating the storage capacity of the storage device may be Set according to one or more sections of the logical address section indicated by the Set Feature command. By way of example, the one or more logical address intervals may be Set by a user via a Set Feature command. It can be appreciated that, in some embodiments, the user may also directly Set the Set Feature command defined by the NVMe protocol, so that the Set Feature command instructs the storage device to perform mode switching, that is, after the storage device receives the Set Feature command, the storage device enters the hidden mode or exits the hidden mode according to the switching mode indicated by the Set Feature command.
As an example, in acquiring the storage capacity of the storage device, for the storage device following the NVMe protocol, the host may acquire the storage capacity of the storage device from the response of the command by sending the Identify command to the storage device. In the prior art, the host triggers the initialization of the storage device and acquires the storage capacity of the storage device when in startup, and the operation of acquiring the storage capacity of the storage device is not actively triggered at other moments. That is, when the working mode of the storage device is switched during the operation of the host, the host includes the operating system, the file system, and other components during the operation of the host, which do not know whether the storage capacity of the storage device is changed or still access the storage device according to the storage capacity before the change, and when the storage capacity of the storage device is changed, the partition table may be abnormal, so that the host fails to access the storage device, or the host cannot use the increased storage space because the storage space is not known to be increased. In order to enable the host to acquire the changed storage capacity in real time after the storage capacity of the storage device is changed. As an example, further, the mode switch command may be registered before the mode switch command is issued, so as to associate the mode switch command with a specified command (e.g., an Identify command). The registration is a function provided by an operating system of the host or a driver of the storage device, and the mode switching command and the specified command are associated through registration, so that after the host sends the mode switching command, the operating system or the driver of the storage device can spontaneously send the registered specified command to the storage device again, thereby adjusting the sending time of the Identify command, and after the registered mode switching command is sent to the storage device, the host can send the Identify command to the storage device at any time according to the requirement to acquire the storage capacity of the storage device.
The Identify command may indicate a variety of command parameters. As an example, in the case where the storage device does not support "NameSpace", the storage capacity of the storage device is acquired with an Identify command indicating the "NameSpace" parameter, or further information related to the hidden LBA space is further acquired. Therefore, the processing of the Identify command with other command parameters by the storage device is not changed, so that the storage device meets the requirement of being compatible with the NVMe protocol. When the storage device according to the embodiment of the present application processes the Identify command indicating the "NameSpace" parameter, information hiding the logical address space is added to the result of the Identify command. Alternatively, since the storage device does not support "NameSpace", the NSID of "NameSpace" is set to, for example, NS0 in the Identify command indicating the "NameSpace" parameter.
Also by way of example, in the case where a Set Feature command indicating "LBA Range Type" is used as the mode switch command, a Get Feature command indicating "LBA Range Type" may be used accordingly to acquire the current operation mode (in normal mode or hidden mode) of the storage device, and optionally the size of the hidden LBA space. A Set Feature command indicating "LBA Range Type" is also registered to be associated with the mode switch command.
According to the embodiment of the application, the mode switching command is indicated by a custom command or by an existing command in a standard, so that a new function or a function different from the standard is provided for the command. While the storage devices to which the hosts are coupled may come from different vendors or different batches, and may or may not support mode switch commands. Support needs to be provided to assist the host in identifying whether the storage device supports mode switch commands. Also as an example, the command sent to the storage device by the corresponding host, for example, an NVMe command or a custom command, may reflect the effect generated by each command through the Log page. "Log Page" is a data structure defined by NVMe protocol, which reflects the effect generated after each command is processed by the storage device, so that the difference of the effect of processing the command between the storage devices is reflected by the data corresponding to each command in "Log Page". For example, one storage device may change the storage capacity size after processing a Set Feature command indicating "LBA Range Type" while another storage device may not; for another example, one storage device may change the storage capacity after processing the custom mode switch command, while another storage device does not support the custom mode switch command. Thus, the effect that a command will produce can be obtained through the Log page to identify whether one or more storage devices connected to the host support hiding from part of the logical address space. Specifically, the host sets an identifier for the mode switching command in the Log Page to indicate an effect generated by the mode switching command, and returns a relevant identifier when a Get Log Page command (a Log Page of a corresponding mode switching command is acquired) in the NVMe protocol is received. For example, in the data of the Log Page corresponding to the mode switch command, the CSUPP/LBCC/NCC/NIC/CCC/CSE field specified by the NVMe protocol is set to 1.
Before issuing a mode switching command to a storage device, a host firstly inquires through a Get Log command, if the mode switching command for a certain storage device is found to change the storage capacity, the mode switching command of the storage device is correspondingly registered in an operating system or a driver of the storage device so as to be related to an Identify command, a Get Feature command indicating an LBA Range Type, and the like; if it is found that the storage capacity is not changed for a certain storage device mode switch command, the mode switch command is not registered for that storage device.
After registering the mode switch command, the host may acquire the storage capacity of the storage device by issuing a command Identify namespace or Get Feature command after the driver captures that the mode switch command is issued.
As an example, further, a mode switch flag may be recorded when a mode switch command is issued. Thus, it may be convenient to determine, by the mode switch flag, that the partition table exception is caused by the mode switch of the storage device when the partition table exception is checked later, so as to perform corresponding processing on the partition table exception result, e.g., directly ignore the partition table exception error. Accordingly, as an example, the mode switching mark can be deleted according to the requirement, so as to meet different use requirements of the user.
Further, if a correct partition table is found at a specified location and a mode switch flag can be found at the same time when detecting a partition table abnormality of the storage device, it is further clear that the partition table abnormality is caused by the storage device mode switch, and at this time, the partition table abnormality error is ignored. If the correct partition table is not found or the mode switching mark is not found in the designated position of the storage space of the storage device, the fact that the partition table is abnormal due to certain faults possibly stored is indicated, and at the moment, errors are reported, so that timely maintenance can be facilitated.
In an alternative embodiment, in the process of sending an IO command to the storage device in the hidden mode, if the address of the storage space after accessing the designated location in the IO command exceeds the storage address space range of the storage device, the storage device driver of the host refuses to send the IO command to the storage device, so as to avoid error occurrence, avoid meaningless command sending and processing, and effectively save system resources. Alternatively or in addition, if for some reason (e.g., a virus infection) the host issues an IO command to access the hidden LBA space to the storage device in hidden mode, the storage device also refuses to process such IO command and reports an error to the host, e.g., an access logical address out of range error.
Still optionally, the storage device refuses to process the erase command and/or the format command to the hidden LBA space to protect the data of the hidden LBA space. For example, in hidden mode, the storage device refuses to process erase commands and/or format commands to the hidden LBA space; in the normal mode, the storage device may execute the erase command and/or the format command to the hidden LBA space after verifying the authority of the host, and delete the data of the hidden LBA space in response. In yet another example, after the storage device is manufactured and the required data is written to the hidden LBA space, the erase command and/or format command from the host to the hidden LBA space is never accepted to ensure that the data of the hidden LBA space is continuously available. It will be appreciated that, for wear leveling, data reliability, etc., the control unit may implement garbage collection on the physical address corresponding to the hidden LBA space within the storage device, but ensure that the data of the hidden LBA space is valid.
Still alternatively, the operating mode (hidden mode or normal mode) of the storage device is not changed by powering down/up the storage device. Or adopting a processing mode of hiding mode priority, and after restarting the storage device in the hiding mode, still being in the hiding mode; after the storage device in the normal mode is restarted, the storage device enters a hidden mode so as to improve the safety of hiding the LBA space. After the storage device is powered down/powered up or restarted, the information related to the hidden LBA space size, log Page and the like is kept unchanged.
Fig. 4 illustrates a flow chart of another method 400 for accessing a storage device provided by an embodiment of the present application. It should be noted that the method 400 may be understood as further refinement and addition to the steps in the method 300. The foregoing detailed description in connection with diagram 300 is therefore equally applicable to the following.
As shown in fig. 4, at step S401, the host is started. Specifically, the OS kernel of the host system is loaded. At step S402, the storage device may be initialized and the storage capacity of the storage device may be acquired. By way of example, the host may send an Identify command or a get feature command, etc., to the storage device to obtain the storage capacity of the storage device feedback. The transmission timing of the Identify command may be the host start or restart phase, or may be any period after the registered mode switch command is issued.
At step S403, it may be checked whether the secondary GTP partition table is normal. If so, step S404 is performed to complete the file system startup. If so, step S405 is performed.
The detection process of the partition table is further described below in conjunction with fig. 5.
FIG. 5 illustrates a schematic diagram of a logical address space of a memory device provided by an embodiment of the present application. As shown in FIG. 5, the logical address spaces of the storage devices are LBA 0-LBAm, where the logical address spaces visible to the host are LBA 0-LBAn and the hidden logical address spaces are LBAn-LBAm. The Protective MBR is a Protective main boot partition table, and a globally unique identification partition table (GUID Partition Table, GPT) is divided into a Primary GPT at the head and a Secondary GPT at the tail. As described above, when the operation mode of the storage device is changed, the storage address space visible to the host is changed due to the different operation modes (normal mode or hidden mode). For example, when the storage device is switched from the mode (e.g., from the hidden mode to the normal mode), since the LBA space of the storage device is 356GB, and the original secondary GTP partition table does not exist at the tail portion of the storage device, the operating system may attempt to acquire the secondary GTP partition table from the tail portion (near 356 GB) of the LBA space after recognizing that the storage device is 356GB, and at this time, the acquisition of the secondary GTP partition table fails, that is, it is checked that an exception occurs in the secondary GTP partition table. In some embodiments, if the acquisition of the secondary GTP partition table fails, a loss of the secondary GTP partition table may be prompted. In practical applications, the user may simply ignore the prompt.
After detecting the second GTP partition table exception, return to FIG. 4. Next, at step S405, it may be checked whether there is a second GTP partition table at the specified location. As previously described, the specified location may be understood as the tail region of LBA space visible to the host provided by the storage device in hidden mode. A secondary GTP partition table is stored at a designated position in the hidden mode. If it is checked that the secondary GTP partition table exists, step S406 may be continued. If the secondary GTP partition table is detected to be absent, the storage device is possibly in error.
At step S406, it may be detected whether a mode switching flag is present. In some embodiments, the mode switch flag is recorded when the host issues a command to the storage device that triggers its mode switch (e.g., a mode switch command or a Set Feature command). Thereby, it can be judged whether the storage device changes the operation mode by the mode switching flag. If the mode switch flag is present, it indicates that the storage device is switched from the hidden mode to the normal mode, and the storage space after the specified location (i.e., the logical address space hidden in the hidden mode) can be accessed, and specifically, the storage space can be accessed through step S407. If the mode switch flag is not present, it is indicated that the storage device may be in error.
At step S407, the hidden data may be accessed by creating a new partition or block device, and may also be accessed directly by specifying the logical address of the storage space after the location. The specific access procedure may refer to the relevant description in the foregoing, and will not be described in detail here. Thus, accurate and efficient access to data in different storage spaces within the storage device, particularly to data in storage spaces after a specified location, is achieved in different ways.
The application also provides a host, comprising a processor; a memory storing computer instructions for accessing a storage device, causing the host to execute the schemes associated with figures 3 and 4. In addition, the present application also provides a computer readable storage medium, which when executed by a processor, causes implementation of the schemes related to fig. 3 and 4.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application. It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. A method for accessing a storage device, comprising:
initializing the storage equipment to obtain the storage capacity of the storage equipment;
in response to determining that the storage capacity of the storage device has changed, checking whether a partition table of the storage device is abnormal; and
in response to checking out a partition table abnormality of the storage device, if a correct partition table is found at a specified location of a storage space of the storage device, accessing the storage space before the specified location using a first manner and accessing the storage space after the specified location using a second manner.
2. The method of claim 1, wherein accessing the storage space prior to the specified location using the first means comprises:
and accessing the storage space before the specified position by utilizing the file system existing in the storage space before the specified position.
3. The method of claim 1, wherein accessing the memory space after the specified location using the second means comprises:
creating a block device related to a storage space after the specified location and accessing the block device according to the block device; or alternatively
Creating a partition of the storage space behind the specified position and accessing the partition according to the partition; or alternatively
And directly accessing the storage space after the designated position according to the logic address of the storage space after the designated position.
4. A method according to claim 3, wherein creating a partition of the storage space after the specified location and accessing it according to the partition comprises:
updating a partition table of the storage device to create a partition corresponding to the storage space after the specified position; and
and accessing the storage space after the designated position from the partition.
5. The method as recited in claim 4, further comprising:
backing up the partition table at the appointed position of the storage space before updating the partition table of the storage device; and
and in response to detecting that the working mode of the storage device is switched to the hidden mode, writing the backed-up partition table back to the designated position.
6. The method according to any one of claims 1 to 5, further comprising, before issuing a command to the storage device to trigger its adjustment of the operating mode:
and responding to the command for adjusting the working mode as a mode switching command, and registering the mode switching command so as to correlate the mode switching command with an identification command.
7. The method as recited in claim 6, further comprising:
in response to issuing the mode switch command, a mode switch flag is recorded.
8. The method as recited in claim 7, further comprising:
responding to the detection of the abnormal partition table of the storage device, and if the correct partition table is found at the designated position of the storage space of the storage device and the mode switching mark is found, ignoring the abnormal partition table error; or alternatively
And responding to the detection of the abnormal partition table of the storage device, and if the correct partition table is not found in the designated position of the storage space of the storage device or the mode switching mark is not found, reporting an error.
9. The method according to any one of claims 1 to 8, further comprising:
determining a storage address space range of the storage device according to the storage capacity of the storage device; and
responding to an IO command to be sent to the storage device, and refusing to send the IO command to the storage device if the address of the storage space after the designated position is accessed in the IO command exceeds the storage address space range of the storage device.
10. A host, comprising:
a processor; and
a memory storing computer instructions for accessing a storage device, which when executed by the processor, cause the host to perform the method of any one of claims 1-9.
CN202210459306.8A 2022-01-18 2022-04-27 Method for accessing storage device and related product Pending CN116466871A (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210056544 2022-01-18
CN2022100565444 2022-01-18
CN202210331664 2022-03-30
CN2022103316640 2022-03-30

Publications (1)

Publication Number Publication Date
CN116466871A true CN116466871A (en) 2023-07-21

Family

ID=87172306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210459306.8A Pending CN116466871A (en) 2022-01-18 2022-04-27 Method for accessing storage device and related product

Country Status (1)

Country Link
CN (1) CN116466871A (en)

Similar Documents

Publication Publication Date Title
US8407514B2 (en) Method of achieving high reliability of network boot computer system
US9934108B2 (en) System and method for optimizing mirror creation
EP2849048B1 (en) Data sending method, data receiving method and storage device
JP5636034B2 (en) Mediation of mount times for data usage
US9501231B2 (en) Storage system and storage control method
JP5768277B2 (en) Dismount storage volume
WO2014051639A1 (en) Storage architecture for server flash and storage array operation
US7478267B2 (en) Access control device and interface installed in same
US8560775B1 (en) Methods for managing cache configuration
JP2010044635A (en) File server system and file server system boot method
US20220091755A1 (en) Techniques for command execution using a state machine
JP6972202B2 (en) Computer system and memory management method
CN116466871A (en) Method for accessing storage device and related product
US20210311654A1 (en) Distributed Storage System and Computer Program Product
US11797404B2 (en) Techniques for peer node recovery
US11256435B2 (en) Method and apparatus for performing data-accessing management in a storage server
CN116501663A (en) Method for accessing hidden space and related product
CN114968630A (en) Failed die management method for improving storage device availability
US9189160B2 (en) Transport agnostic sequential drive recovery with mode data snooping
CN116501239A (en) Method for managing storage device and storage controller
TWI731515B (en) Computer system and boot controlling method for storage apparatus
US11740838B2 (en) Array-based copy utilizing one or more unique data blocks
CN117311591A (en) Method for accessing storage device and related product
CN117311594A (en) Method for managing NVM chip and related product
WO2023249713A1 (en) Proactive hardening of data storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination