This application claims priority under 35 U.S.C. §119 to Patent Application No. 200910130300.0 filed Mar. 31, 2009, the entire text of which is specifically incorporated by reference herein.
The various embodiments described herein relate to remote system management with network storage. In particular, the various embodiments relate to an apparatus and method for mounting and reading files or directories by using a virtual device image.
A remote drive presents storage devices (e.g., a floppy drive, a CD-ROM drive, a USB drive, and device image files) of a local computer to a remote host as physical devices directly attached to the remote host. Hardware devices of the remote drive are connected to the remote host via its USB interface. Client software of the remote drive on the local computer presents devices or device images of the local computer to the remote host via hardware and related software on the remote host. Moreover, the client software transfers commands and data between the local computer and the remote host. The remote host considers the storage devices loaded via the remote drive as native physical devices, and the remote drive provides storage devices or images of the local computer as native physical devices of the remote host.
The remote drive can be used to install an operating system, update firmware, and exchange files. The remote drive is available in multiple products for system management purposes.
The remote host 103 may directly access files on the storage device of the local computer 101 presented to the remote host 103 via the remote drive. The remote host 103 can access files that are not on storage devices mounted to the remote host 103 by encapsulating such files as ISO 9660 image files and directly mounting them to the remote host 103. ISO 9660 is a widely-supported image file format. The ISO 9660 specification defines a file system for CD-ROM media and supports different computer operating systems such as UNIX, Windows, and Mac OS so that data may be exchanged among different platforms.
Although conventional remote drive technology allows a local computer to share device images with a remote host, there are significant limitations regarding the conventional technology. Firstly, a remote drive cannot mount arbitrary files or directories of the local computer directly to a remote host; rather, the remote drive can only mount physical devices or device image files (e.g., floppy disk drive, CD-ROM drive, USB drive, ISO 9660 image, etc.) to a remote host. If the remote drive in accordance with the conventional technology is to share arbitrary files or directories of the local computer, a first method involves copying the files to be shared onto the physical storage device of the local computer provided to the remote host by the remote drive. A second method involves encapsulating the files into a device image file so that the files are made available to the remote host after the device image file is mounted via the remote drive.
Secondly, if the second aforementioned method is used, i.e. the files to be mounted are encapsulated into a device image file in order to share files or directories with the host via the remote drive, a new floppy or ISO image file that contains specific files must be created and manually mounted, even if only one or a few files are to be shared. If there is no ready-to-use ISO/floppy image maker tool, arbitrary file and directory sharing via the remote drive operation is impossible. Furthermore, creation of an image file requires special knowledge of ISO image and related tool software.
Finally, creation of a large ISO image file takes substantial time and occupies at least the same amount of disk space as its original contents. For instance, sharing a 4 GB file will require at least 4 GB of additional space for generating an ISO image file that includes the file to be shared, and creating the ISO image file takes substantial time.
Locally encapsulating ISO image files also may be necessary in situations other than remote sharing. For example, some software requires loading via CD-ROM; in such case, if the local computer does not contain a CD-ROM drive, an ISO image file may be needed.
As previously mentioned, the conventional method for creating such image file involves copying all of the contents of the selected files and directories into the image file, which may take substantial time and may result in almost double storage space for selected files on the storage system. Thus, the conventional method may result in a waste of significant time and storage space. If the purpose for creating the image file is merely to temporarily mount files to the host, creating a real ISO image file may be unduly inconvenient.
According to one aspect of the various embodiments described herein, a method is provided for mounting at least one file to a local or remote host. The method comprises creating a virtual device image comprising a logical block address table; writing information regarding a block address and a size of an occupied space of the at least one file into the logical block address table, the information being calculated according to a format of a normal device image file system; recording in the logical block address table a file address map relationship comprising a map from the block address of the at least one file to a real position of the at least one file located outside of the virtual device image; and mounting the virtual device image to the local or remote host. The virtual device image further may comprise a virtual image file header. Additionally, the method may comprise generating a directory record of the at least one file in the virtual image file header and writing the information regarding the block address and the size of the occupied space of the at least one file into the directory record of the at least one file.
Moreover, the method may comprise writing information regarding a block address and a size of an occupied space of at least one directory to be mounted into the logical block address table, the information being calculated according to a format of a normal device image file system. The method further may comprise recording in the logical block address table a directory address map relationship comprising a map from the block address of the at least one directory to a real position of the at least one directory in the virtual image file header. Furthermore, the method may comprise generating a directory record of the at least one directory in the virtual image file header and writing the information regarding the block address and the size of the occupied space of the at least one directory into the directory record of the at least one directory. Additionally, the method may comprise placing the at least one directory into the real position of the at least one directory according to the directory address map relationship.
Further, the virtual image file header may comprise a volume descriptor, and the method may comprise adjusting a position of the volume descriptor in the virtual image file header from a block address of the volume descriptor to a real position of the volume descriptor in the virtual image file header. Also, information regarding the block address and a size of an occupied space of the volume descriptor, as well as a map from the block address of the volume descriptor to the real position of the volume descriptor, may be recorded in the logical block address table.
According to a further aspect of the various embodiments described herein, an apparatus is provided for mounting at least one file to a local or remote host. The apparatus comprises a creation unit for creating a virtual device image comprising a logical block address table. The apparatus further comprises a processing unit for writing information regarding a block address and a size of an occupied space of the at least one file into the logical block address table, the information being calculated according to a format of a normal device image file system. In addition, the processing unit records in the logical block address table a file address map relationship comprising a map from the block address of the at least one file to a real position of the at least one file located outside of the virtual device image. Furthermore, the apparatus comprises a drive for mounting the virtual device image to the local or remote host. The virtual device image further may comprise a virtual image file header. Additionally, the apparatus may comprise a directory record generation unit for generating a directory record of the at least one file in the virtual image file header and for writing the information regarding the block address and the size of the occupied space of the at least one file into the directory record of the at least one file.
Moreover, the processing unit of the apparatus may write information regarding a block address and a size of an occupied space of at least one directory to be mounted into the logical block address table, the information being calculated according to a format of a normal device image file system. Also, the processing unit may record in the logical block address table a directory address map relationship comprising a map from the block address of the at least one directory to a real position of the at least one directory in the virtual image file header. Further, the directory record generation unit of the apparatus may generate a directory record of the at least one directory in the virtual image file header and may write the information regarding the block address and the size of the occupied space of the at least one directory into the directory record of the at least one directory. In addition, the processing unit may place the at least one directory into the real position of the at least one directory according to the directory address map relationship.
Furthermore, the virtual image file header may comprise a volume descriptor, and the processing unit may adjust a position of the volume descriptor in the virtual image file header from a block address of the volume descriptor to a real position of the volume descriptor in the virtual image file header. Additionally, information regarding the block address and a size of an occupied space of the volume descriptor and a map from the block address of the volume descriptor to the real position of the volume descriptor may be recorded in the logical block address table.
According to a further aspect of the various embodiments described herein, a method is provided for reading a virtual device image used to mount at least one file to a local or remote host. The method comprises receiving a command from a read device regarding content to be read; in response to a determination that a device to be read is a virtual device image, obtaining a real position of the content to be read in the virtual device image according to a file address map relationship comprising a map from a block address of the at least one file to a real position of the at least one file located outside of the virtual device image; and reading the content from the real position of the at least one file. Moreover, a logical block address table of the virtual file image may comprise the file address map relationship and information regarding the block address and a size of an occupied space of the at least one file, the information being calculated according to a format of a normal device image file system. Furthermore, the virtual device image may comprise a virtual image file header including a generated directory record of the at least one file, and the directory record of the at least one file may comprise the information regarding the block address and the size of the occupied space of the at least one file.
Additionally, the logical block address table may comprise information regarding a block address and a size of an occupied space of at least one directory to be mounted, the information being calculated according to a format of a normal device image file system. Furthermore, the logical block address table may comprise a directory address map relationship including a map from the block address of the at least one directory to a real position of the at least one directory in the virtual image file header. Further, the virtual image file header may comprise a generated directory record of the at least one directory, and the directory record of the at least one directory may comprise the information regarding the block address and the size of the occupied space of the at least one directory. Also, a position of the at least one directory in the virtual image file header may be adjusted from the block address of the at least one directory to the real position of the at least one directory.
According to a further aspect of the various embodiments described herein, an apparatus is provided for reading a virtual device image used to mount at least one file to a local or remote host. The apparatus comprises a command reception unit for receiving a command from a read device regarding content to be read and for determining whether a device to be read in accordance with the command is a virtual device image. The apparatus further comprises a address transformation unit for obtaining, in response to a determination that the device to be read is a virtual device image, a real position of the content to be read in the virtual device image according to a file address map relationship comprising a map from a block address of the at least one file to a real position of the at least one file located outside of the virtual device image. In addition, the apparatus comprises a read unit for reading the content from the real position of the at least one file.
Via the various embodiments described herein, one or more files and/or directories may be mounted more conveniently to a host via the remote drive. By utilizing a virtual image file in accordance with the various embodiments, it is unnecessary to create a real device image including the content of the selected files and/or directories. Instead, only a virtual image is created to reference the content, and thus no real storage space need be allocated. Mounting arbitrary files and/or directories to a remote host via the various embodiments may save time and storage space, regardless of the size of the files and/or directories.
From the following detailed description of exemplary embodiments, aspects and advantages of the various embodiments will become apparent. The various embodiments are to be explained further with reference to the attached drawings, in which:
Technical aspects of the various embodiments are described in detail herein with reference to exemplary embodiments. However, these exemplary embodiments may be modified in various formats, and the scope of the various embodiments is not limited to these specific exemplary embodiments. A method for mounting at least one file and/or directory to a host in accordance with an exemplary embodiment involves selecting the at least one file and/or directory to be mounted, transforming the least one file and/or directory into a virtual device image (file), (e.g., a virtual floppy image, a virtual ISO image, or a virtual device image), and then mounting the resulting virtual device image to the host via a remote drive. Subsequently, the host may detect the remote drive and may find the corresponding file and/directory thereon.
The virtual device image presented by the various embodiments described herein is different from a normal (i.e., real) device image. The virtual device image includes only minimal necessary file system information, i.e., a logical block address table and optionally a virtual image file header.
The virtual device image does not include specific content of the file. Different types of drives (file systems) have different virtual image formats. For example, a virtual ISO image file is used to simulate a CD/DVD drive. However, the virtual device image in accordance with the various embodiments is applicable to any format of device image.
Terms to be used throughout the description are explained immediately below.
A block address (offset address) refers to a logical address for respective components of the virtual device image, such as a volume descriptor, respective directories, files, etc. The block addresses discussed regarding the virtual device image herein are analogous to block addresses within a normal device image. When reading or writing data associated with these components, a local or remote host can only identify the block addresses for these components. The above block addresses are recorded in the logical block address table and/or directory records of the above components. Here, the block address for a directory refers to the block address for specific content of the directory. The content of the directory refers to information included in the directory itself (e.g., a hierarchical structure of the directory, the files included in the directory, etc.), but the specific content of a file is not included in the directory.
In addition, a map refers to the relationship between the block addresses for the respective components of the virtual device image and the real positions of these components, which are recorded in corresponding locations in the logical block address table.
A link between a record in the virtual device image and the content of the corresponding file may comprise the address for the first block (i.e., the block address) of the file in that virtual device image and the number of blocks that the file occupies. According to another exemplary embodiment, such a link also may be the full path for the external file. For example, the path for the file A1 is “/A1”, the path for the file B1 is “/B/B1”, and the path for the file B2 is “/B/B2”. These paths indicate the actual files accessible by a local computer (e.g., the local computer 101).
Specifically, since the block addresses for files and/or directories to be mounted are adjusted with respect to a normal device image when the virtual device image 501 is created, their real positions and their block addresses in the virtual device image 501 may be different from those in a normal device image. Therefore, maps from the block addresses in a normal device image for the files and/or directories to be mounted to their real positions in the virtual device image 501 are formed in the logical block address table 502.
The real positions of the specific contents of the file A1, the file B1, and the file B2 are their addresses in the external file system 512. Maps from the block addresses of the file A1, the file B1, and the file B2 to their real positions in the external file system 512 are formed in the logical block address table 502, and there are link paths pointing to the external file system 512 in the maps. For example, there is a path “/A1” pointing to the specific content of the file A1 in the block address YY-ZZ for the file A1 of the logical block address table 502, there is a path “/B/B1” pointing to the specific content of the file B1 in the block address ZZ-AA for the file B1 of the logical block address table 502, and there is a path “/B/B2” pointing to the specific content of the file B2 in the block address AA-BB for the file B2 of the logical block address table 502. The specific content of the target files such as the file A1, the file B1, and the file B2 are stored in the external file system 512.
Via the above method, a virtual device image can be utilized without creating a real (normal) device image including the content data of the one or more files and/or directories processed. Therefore, no allocation of real storage space is required. Using the above method, mounting one or more arbitrary files and/or directories to a host may save time and storage space, regardless of the size of the one or more files and/or directories.
According to another exemplary embodiment, a virtual device image further comprises a virtual image file header.
Pointers are stored in the logical block address table 802 that point from the recorded multiple block addresses to the real positions for the volume descriptor 806, the root directory 808, the subdirectory B 810, the file A1, the file B1, the file B2, etc. Since the addresses of the volume descriptor 806, the root directory 808, and the subdirectory B 810 in the virtual image file header 804 are adjusted with respect to a normal device image upon generation of the virtual image file header 804, the real positions of these components in the virtual image file header 804 are changed with respect to their block addresses in the normal device image. Maps from the block addresses of the volume descriptor 806, the root directory 808, and the subdirectory B 810 in the normal device image to their real positions in the virtual image file header 804 are formed in the logical block address table 802. The volume descriptor 806, the root directory 808, and the subdirectory B 810 are placed into real positions in the virtual device image 801 in accordance with the corresponding address map relationship, thus reducing the storage space of the virtual device image 801.
The real positions of the specific contents of the file A1, the file B1, and the file B2 are their addresses in the external file system 812. Maps from the block addresses of the file A1, the file B1 and the file B2 to their real positions in the external file system 812 are also formed in the logical block address table 802, and there are link paths pointing to the external file system 812 in the maps. For example, as illustrated in
According to another exemplary embodiment, the aforementioned method for mounting at least one file and/or directory to a local or remote host further comprises the step of generating a directory record in the virtual image file header 804 for at least one file and/or directory to be mounted (e.g., a directory record of the file A1) and writing information regarding the calculated block address and the size of the occupied space into the directory record of the at least one file and/or directory.
According to another exemplary embodiment, the aforementioned method for mounting at least one file and/or directory to a local or remote host further comprises the step of adjusting the position of the volume descriptor 806 in the virtual image file header 804, which is the real position of the volume descriptor 806 in the virtual image file header 804. If at least one directory is mounted to the local or remote host, the method further may comprise the step of adjusting the position of the at least one directory in the virtual image file header 804, which is the real position of the at least one directory in the virtual image file header 804.
Also recorded in the logical block address table 802 is information regarding the block address and the size of the occupied space of the volume descriptor 806, as well as a map from the block address to the real position of the volume descriptor 806 in the virtual image file header 804.
According to an exemplary embodiment, the remote drive 905 is not limited to installation in the host 903; rather, the remote drive 905 also may be installed in the local computer 901 or in a third-party device. According to another exemplary embodiment, the host 903 and the local computer 901 may be integrated into the same device and may be used in conjunction with methods as described herein regarding the exemplary embodiments.
The structure of the local computer 1000 as provided in
According to an exemplary embodiment, the local computer 1000 performs the operations required to mount at least one file and/or directory. More specifically, the creation unit 1002 creates the virtual device image 911, which comprises the logical block address table 912 and optionally the virtual image file header 914, for at least one file and/or directory to be mounted. The processing unit 906 writes into the logical block address table 912 information regarding the block address and the size of the occupied space of the specific content of the at least one file and/or directory calculated according to a format of a normal device image file system. Moreover, the processing unit 906 records the relevant address map relationship(s) (i.e., the file address map relationship and/or the directory address map relationship) in the logical block address table 912. The drive 1001 mounts the created virtual device image 911 to the host 903. In
According to an exemplary embodiment, the host 903 identifies the virtual device image 911 as a local drive. The manner in which the host 903 performs detection and identification of the virtual device image 911 is the same as the manner in which the host 903 performs detection and identification of physically connected devices.
According to another exemplary embodiment, the drive 1001 may be located inside the local computer 1000 such that the drive 1001 and the local computer 1000 operate as a single unit. Alternatively, the drive 1001 may be located outside of the local computer 1000; for instance, the drive 1001 may be installed in the host 903 or in a third-party device.
According to an exemplary embodiment, the file address map relationship includes a map from the block address of any file to the real position of its specific content located outside of the virtual device image 911, and the directory address map relationship includes a map from the block address of any directory to the real position of its specific content in the virtual device image 911. The address map relationship for any file in a directory can be considered as a kind of file address map relationship.
According to an exemplary embodiment, the directory record generation unit 1006 generates a directory record for the at least one file and/or directory to be mounted in the virtual image file header 914 and writes the information regarding the calculated block address and the size of the occupied space into the directory record of the at least one file and/or directory. Moreover, in accordance with another exemplary embodiment, the processing unit 1004 is used to adjust the position of the volume descriptor 916 in the virtual image file header 914, which is the real position of the volume descriptor 916 in the virtual image file header 914. If at least one directory is mounted to the local or remote host 903, the processing unit 1004 further is used to adjust the position of the least one directory in the virtual image file header 914, which is the real position of the at least one directory in the virtual image file header 914.
According to an exemplary embodiment, information regarding the block address and the size of the occupied space of the volume descriptor 916, as well as the map from the block address to the real position of the volume descriptor 916 in the virtual image file header 914, are recorded in the logical block address table 912.
At step S1105, the address transformation unit 1005 obtains the real position of the content to be read in the virtual device image 911, in accordance with the address map relationship (file address map relationship and/or directory address map relationship) recorded in the logical block address table 912 of the virtual device image 911. Also recorded in the logical block address table 912 is information regarding the block address and the size of the occupied space of the specific content of the at least one file and/or directory calculated according to a format of a normal device image file system. If the virtual device image 911 contains at least one file, the file address map relationship comprises a map from the block address of the at least one file to the real position of the at least one file located outside of the virtual device image 911. If the virtual device image 911 contains at least one directory, the directory address map relationship comprises a map from the block address of the at least one directory to the real position of the specific content of the at least one directory in the virtual device image 911. If the at least one directory contains a file, the address map relationship for the file can be considered as a kind of file address map relationship. Subsequently, at step S1107, the read unit 1007 reads the content in the virtual device image 911 from the obtained real position. Finally, the process may end.
According to an exemplary embodiment, the local device 1201 receives a command sent from the host 1203. The sent command may be a SCSI command in compliance with the SCSI command set specification. Each of the read and write SCSI commands has two fields, with one field indicating the identity of the first block from which data is to be read or to which data is to be written by the host 1203, and the other field indicating the number of blocks to be read or written. The number of the first block herein refers to the block address of the data to be read or written as known by the host 1203 with respect to a normal device image. Upon receiving a SCSI command from the host 1203, the client software 1206 running on the local device 1201 obtains the real position of the content of the file or directory from the logical block address table 1212 of the virtual device image 1211 in accordance with the block address to be read as indicated in the SCSI command, and subsequently obtains the content of the file or directory from the real position. Respective functions of the client software 1206 may be implemented by the command reception unit 1003, the address transformation unit 1005, the read unit 1007, etc., as illustrated in
Read operations with respect to the virtual device image 1211 now will be described via an example with reference to
The host 1203 receives the volume descriptor 1216, obtains the root directory record 1216i from the volume descriptor 1216, and extracts the block address of the root directory 1218 from the root directory record 1216i, which is A-B. Then, the host 1203 issues a command to read the content of the block A-B. The address transformation unit 1005 of the local device 1201 acquires the real position of the content of the block address A-B in the virtual image file header 1214, which is the root directory 1218, via the corresponding address map in the logical block address table 1212. Then, the read unit 1007 reads the content of the root directory 1218 and returns the content of the root directory 1218 to the host 1203 via the communication unit 1008.
The host 1203 receives the content of the root directory 1218, obtains for example the directory record 1222 of the file A1 from the content of the root directory 1218, and abstracts the block address of the content of the file A1 from the directory record 1222, that is, E-F. Then, the host 1203 issues a command to read the content of the block address E-F. Then, the address transformation unit 1005 in the local device 1201 acquires the real position of the content of the block address E-F of file A1 in the external file system 1230, according to the corresponding address map in the logical block address table 1212. Subsequently, the read unit 1007 reads the content of the file A1 from outside of the virtual device image 1211 in accordance with the path “/A1” in the logical block address table 1212 and organizes the corresponding content into an appropriate format, e.g., the format in compliance with ISO 9660 specification. Then, the local device 1201 returns the file A1 organized into an appropriate format to the host 1203 via the communication unit 1008. In this way, the host 1203 is capable of accessing the content of the file and/or directory of the virtual device image 1211 identified as the local drive on the host 1203.
The above read operations are not intended to limit the scope of the various embodiments described herein. In accordance with other embodiments, the host 1203 may complete the above read operations via other means.
In accordance with an exemplary embodiment, the client software 1206 of the local computer 1201 does not read from the virtual device image 1211 itself when reading data of the specific content of a file. Moreover, read operations can be accomplished via the local computer 1201 and need not be visible to the host 1203.
The various embodiments described herein may be applied to any device with a remote drive function. The various embodiments may be realized by hardware, software, firmware, or combinations thereof. The implementations of the various embodiments do not limit their scope, nor do the relationships between respective functional elements (units) of the various embodiments. One or more functional elements among the various embodiments may include or be associated with any other functional elements.
According to an exemplary embodiment, the virtual device image may be a virtual ISO image file. However, the virtual ISO image file does not limit the scope of the various embodiments described herein. Rather, the virtual device image according to the various embodiments may be a virtual device image of any other types and/or formats.
Although exemplary embodiments have been described above with reference to the attached drawings, it should be understood to those skilled in the art that variations and modifications may be made to these embodiments without departing from the principle and spirit of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
200910130300.0 | Mar 2009 | CN | national |