JPH0447323A - 2-port disk controller - Google Patents

2-port disk controller

Info

Publication number
JPH0447323A
JPH0447323A JP2152558A JP15255890A JPH0447323A JP H0447323 A JPH0447323 A JP H0447323A JP 2152558 A JP2152558 A JP 2152558A JP 15255890 A JP15255890 A JP 15255890A JP H0447323 A JPH0447323 A JP H0447323A
Authority
JP
Japan
Prior art keywords
disk
data
write
interfaces
host computer
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
JP2152558A
Other languages
Japanese (ja)
Inventor
Takamasa Koga
古賀 高雅
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2152558A priority Critical patent/JPH0447323A/en
Publication of JPH0447323A publication Critical patent/JPH0447323A/en
Pending legal-status Critical Current

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

PURPOSE:To realize the duplexing of a magnetic disk device by simultaneously controlling write-in seek operation operated by two disk interfaces, and reading and controlling data through the disk interface corresponding to the disk device of the other side at the time of the fault of the disk device of one side. CONSTITUTION:When a data write-in request from a host computer 11 arises, that write-in data is stored once in a memory buffer 26, and is transferred simultaneously to the data buffers BF1,BF2 of two disk interfaces 27a,27b respectively. Then, the write-in seek operation of two disk devices 13a,13b is simultaneously controlled through two disk interfaces 27a,27b based on a common write-in address, and in response to the completion of the seek of each disk device 13a,13b, the data latched in the data buffers BF1,BF2 are written. Thus, the data can be stored in each of the duplexed disk devices through the data write-in processing of one time from the host computer 11.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明は、磁気ディスク装置の二重化を図る際に使用さ
れる2ポートデイスクコントローラに関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Field of Industrial Application) The present invention relates to a two-port disk controller used when duplicating a magnetic disk device.

(従来の技術) 例えばホストコンピュータのデータ記憶装置としては、
磁気ディスク装置が使用される。この磁気ディスク装置
で使用するディスクは、8インチディスク、5インチデ
ィスク、3.5インチディスク等様々なサイズのものが
利用されるが、1台のディスクの中のある部分に障害が
発生すると、そのディスクに記憶されたデータの全てが
読出し不能になる等の不具合が生じる。
(Prior art) For example, as a data storage device for a host computer,
A magnetic disk device is used. The disks used in this magnetic disk device come in various sizes such as 8-inch disks, 5-inch disks, and 3.5-inch disks, but if a failure occurs in a certain part of one disk, This causes problems such as all of the data stored on the disk becoming unreadable.

そこで、重要なデータを記憶させるデータ記憶装置には
二重化システムが採用され、一方のディスフに障害が発
生した場合に、他方のディスクでバックアップを図って
いる。
Therefore, a duplex system is adopted for data storage devices that store important data, so that if a failure occurs in one disk, the other disk is used for backup.

第3図は磁気ディスク装置の従来の二重化システムの構
成を示すもので、1台のホストコンピュータ11に対し
ディスクコントローラ12a。
FIG. 3 shows the configuration of a conventional duplex system for magnetic disk devices, in which one host computer 11 is connected to a disk controller 12a.

12b及び磁気ディスク装置13a、13b共に二重化
されている。
12b and magnetic disk devices 13a and 13b are both duplicated.

すなわち、このディスク二重化システムでは、ホストコ
ンピュータ11からデータの書込み要求があると、まず
、一方のディスクコントローラ12aを通して第1の磁
気ディスク装置13aのディスクに対してデータの書込
みを行ない、これに続いて、再度他方のディスクコント
ローラ12bを通して第2の磁気ディスク装置13bの
ディスクに対してデータの書込みを行なうことで、記憶
データの二重化を図っている。
That is, in this disk duplex system, when a data write request is received from the host computer 11, data is first written to the disk of the first magnetic disk device 13a through one disk controller 12a, and then the data is written to the disk of the first magnetic disk device 13a. By writing data to the disk of the second magnetic disk device 13b again through the other disk controller 12b, the storage data is duplicated.

(発明が解決しようとする課題) しかしながら、上記従来のディスク二重化システムのよ
うに、2つの磁気ディスク装置13a。
(Problems to be Solved by the Invention) However, like the conventional disk duplication system described above, there are two magnetic disk devices 13a.

13bに対してそれぞれ専用のディスクコントローラ1
2a、12bを接続し、ホストコンピュータ11からの
データ書込み処理を二度繰返し行なうのでは、ディスク
二重化システムをしたことによりデータの書込み処理に
時間が掛かり、コンピュータシステム全体の処理に悪影
響を及ぼしてしまう。
Dedicated disk controller 1 for each 13b
If 2a and 12b are connected and the data writing process from the host computer 11 is repeated twice, the data writing process will take time due to the disk duplication system, which will adversely affect the processing of the entire computer system. .

本発明は上記課題に鑑みなされたもので、ホストコンピ
ュータからのデータの書込み処理を二度繰返し行なう必
要なく、磁気ディスク装置の二重化を図ることが可能に
なる2ポートデイスクコントローラを提供することを目
的とする。
The present invention has been made in view of the above problems, and an object of the present invention is to provide a 2-port disk controller that makes it possible to duplicate a magnetic disk device without having to repeatedly write data from a host computer twice. shall be.

[発明の構成コ (課題を解決するための手段) 本発明に係わる2ポートデイスクコントローラは、2つ
のディスク装置と、ホストコンピュータからの書込みデ
ータを記憶するメモリバッファと、このメモリバッファ
と上記2つのディスク装置との間にそれぞれ独立して接
続され各対応するディスク装置の書込みシーク動作をそ
れぞれ同一の書込みアドレスに基づき制御する2つのデ
ィスクインターフェイスと、この2つのディスクインタ
ーフェイスのそれぞれに備えられ上記メモリバッファか
ら転送された書込みデータを上記書込みシーク動作時間
に応じてラッチするデータバッファと、上記2つのディ
スクインターフェイスによる書込みシーク動作を同時制
御し一方のディスク装置の故障時には他方のディスク装
置に対応するディスクインターフェイスを通してデータ
読出し制御するディスクインターフェイス制御手段とを
備えて構成したものである。
[Configuration of the Invention (Means for Solving the Problems) A two-port disk controller according to the present invention includes two disk devices, a memory buffer for storing write data from a host computer, and a memory buffer that stores data written from a host computer. two disk interfaces each independently connected to the disk device and controlling the write seek operation of each corresponding disk device based on the same write address; and the memory buffer provided in each of the two disk interfaces. a data buffer that latches the write data transferred from the disk according to the write seek operation time, and a disk interface that simultaneously controls the write seek operations of the two disk interfaces and corresponds to the other disk device when one disk device fails. and a disk interface control means for controlling data reading through the disk interface.

(作用) つまり、ホストコンピュータからのデータの書込み要求
があった場合に、その書込みデータを上記メモリバッフ
ァに一旦格納し、上記2つのディスクインターフェイス
それぞれのデータバッファに対して同時に転送すると共
に、該2つのディスクインターフェイスを通して上記2
つのディスク装置の書込みシーク動作を共通の書込みア
ドレスに基づき同時制御し、各ディスク装置のシーク完
了に応じて上記データバッファにラッチされたデータの
書込みを行なうことにより、ホストコンピュータからの
一度のデータ書込み処理で二重化したディスク装置それ
ぞれへのデータ格納が行なえるようになる。
(Operation) In other words, when there is a data write request from the host computer, the write data is temporarily stored in the memory buffer, and simultaneously transferred to the data buffers of each of the two disk interfaces. The above two through two disk interfaces.
By controlling the write seek operations of two disk devices simultaneously based on a common write address and writing the data latched to the data buffer in response to the completion of the seek of each disk device, data can be written once from the host computer. Through processing, data can be stored in each of the duplicated disk devices.

(実施例) 以下図面により本発明の一実施例について説明する。(Example) An embodiment of the present invention will be described below with reference to the drawings.

第1図は2ポートデイスクコントローラの構成を示すも
ので、同図において11はホストコンピュータ、13a
、13bは磁気ディスク装置であり、ホストコンピュー
タ11にはディスクコントローラ21が接続され、この
ディスクコントローラ21には該2つの磁気ディスク装
置が並列(パラレル)にして接続される。
Figure 1 shows the configuration of a 2-port disk controller, in which 11 is a host computer, 13a
, 13b is a magnetic disk device, a disk controller 21 is connected to the host computer 11, and the two magnetic disk devices are connected to the disk controller 21 in parallel.

第2図はディスクコントローラ21の内部構成を示すも
ので、同図において、22はマイクロプロセッサ(制御
部)であり、このマイクロプロセッサ22により2つの
磁気ディスク装置13a。
FIG. 2 shows the internal configuration of the disk controller 21. In the figure, 22 is a microprocessor (control unit), and the microprocessor 22 controls the two magnetic disk devices 13a.

13bに対するホストコンピュータ11からのデータ書
込み処理が制御される。上記マイクロブロセッサ22に
は、その制御プログラムを記憶するメモリ23と制御タ
イミングを同期させるタイマ24とが備えられる。
Data writing processing from the host computer 11 to the host computer 13b is controlled. The microprocessor 22 is equipped with a memory 23 that stores its control program and a timer 24 that synchronizes control timing.

一方、ホストコンピュータ11からの上記2つの磁気デ
ィスク装置13a、13bに対するデータ書込み要求は
、ホストインターフェイス25を通して入力され、その
書込み指令信号が上記マイクロプロセッサ22に供給さ
れると共に、書込みデータはメモリバッファ26に一旦
格納される。
On the other hand, a data write request from the host computer 11 to the two magnetic disk devices 13a and 13b is input through the host interface 25, the write command signal is supplied to the microprocessor 22, and the write data is transferred to the memory buffer 25. is temporarily stored.

このメモリバッファ26には、上記2つの磁気ディスク
装置13a、13bとの間に、それぞれ独立してSMD
(ストレージ・モジュール・デバイス)インターフェイ
ス27a、27bが接続される。このSMDインターフ
ェイス27a、27bは、上記マイクロプロセッサ22
によるデータ書込み制御処理、およびSMD制御部28
によるインターフェイス制御処理に応じて、2つの磁気
ディスク装置13a、13bにおける書込みシーク動作
を同時制御するもので、この場合、2つの磁気ディスク
装置13a、13bに対する磁気ヘッドのシーク制御は
、SMD制御部28により指示される共通の書込みアド
レスに応じて行なわれる。
This memory buffer 26 has SMDs connected to each other independently between the two magnetic disk devices 13a and 13b.
(Storage module device) interfaces 27a and 27b are connected. These SMD interfaces 27a and 27b are connected to the microprocessor 22.
Data write control processing by and SMD control unit 28
Write seek operations in the two magnetic disk drives 13a and 13b are simultaneously controlled in accordance with interface control processing by the SMD control unit 28. This is done in response to a common write address indicated by .

そして、上記SMDインターフェイス27a。And the SMD interface 27a.

27bには、そのそれぞれに対応する磁気ディスク装置
13a、13bの書込みシーク動作時間に応じて、上記
メモリバッファ26に記憶されている書込みデータをラ
ッチするデータバッファBFI及びBF2が備えられる
27b is provided with data buffers BFI and BF2 that latch the write data stored in the memory buffer 26 according to the write seek operation time of the corresponding magnetic disk devices 13a and 13b.

また、マイクロプロセッサ22は、一方の磁気ディスク
装置13aからSMDインターフェイス27aを通して
データ読出しを行なった際に、そのデータ内容が正常で
あるか否かの判断を行なうもので、ここで、上記読出し
データに異常が生じていた場合には、他方のSMDイン
ターフェイス27bを通したデータ読出し処理を行なう
ことになる。
Furthermore, when data is read from one of the magnetic disk devices 13a through the SMD interface 27a, the microprocessor 22 judges whether the data contents are normal or not. If an abnormality has occurred, data read processing is performed through the other SMD interface 27b.

すなわち、上記構成による2ボートデイスクコントロー
ラにおいて、ホストコンピュータ11から2つの磁気デ
ィスク装置13a、13bに対してデータ書込み要求が
あると、その書込み指令信号がディスクコントローラ2
1のホストインターフェイス25を通してマイクロプロ
セッサ22に供給されると共に、書込みデータがメモリ
バッファ26に転送格納される。すると、マイクロプロ
セッサ22は、メモリ23に予め記憶されたファームウ
ェア(FW)プログラムに応じて上記メモリバッファ2
6に格納された書込みデータを、2つのSMDインター
フェイス27a、27bの有するデータバッファBFI
、BF2のそれぞれに対して転送させるもので、この時
、SMD制御部28から各SMDインターフェイス27
a。
That is, in the two-boat disk controller configured as described above, when a data write request is made from the host computer 11 to the two magnetic disk devices 13a and 13b, the write command signal is sent to the disk controller 2.
The write data is supplied to the microprocessor 22 through the host interface 25 of No. 1, and the write data is transferred and stored in the memory buffer 26. Then, the microprocessor 22 updates the memory buffer 2 according to the firmware (FW) program stored in the memory 23 in advance.
6 is transferred to the data buffer BFI of the two SMD interfaces 27a and 27b.
, BF2, and at this time, from the SMD control unit 28 to each SMD interface 27.
a.

27bに対して書込み制御信号が供給され、該SMDイ
ンターフェイス27a、27bのそれぞれにより2つの
磁気ディスク装置13a、13bノ書込みシーク動作が
共通の書込みアドレスに応じて同時制御される。ここで
、各SMDインターフェイス27a、27bのデータバ
ッファBFI、BF2にそれぞれラッチされる書込みデ
ータは、それぞれ対応する磁気ディスク装置13a、1
3bの書込みシーク動作の動作時間に応じてラッチ保持
されるもので、磁気ディスク装置13a、13bのシー
ク動作完了によりそのそれぞれに装着されたディスクの
指定書込みアドレスが検索されると、各ディスクの指定
アドレス位置に各対応するデータバッファBF1.BF
2にラッチされているデータが転送され書込まれる。
A write control signal is supplied to the SMD interface 27b, and the write seek operations of the two magnetic disk drives 13a and 13b are simultaneously controlled by the SMD interfaces 27a and 27b in accordance with a common write address. Here, the write data latched in the data buffers BFI and BF2 of the SMD interfaces 27a and 27b, respectively, are stored in the corresponding magnetic disk drives 13a and 1.
3b is latched and held according to the operation time of the write seek operation, and when the seek operation of the magnetic disk devices 13a and 13b is completed and the specified write address of the disk mounted on each is searched, the specified write address of each disk is searched. Data buffers BF1 . BF
The data latched in 2 is transferred and written.

つまり、メモリバッファ26から各SMDインターフェ
イス27a、27bのデータバッファBFI、BF2に
対する書込みデータの転送ラッチ後、各磁気ディスク装
置13a、13bの書込みシーク動作を同時制御した際
に、該磁気ディスク装置13a、13b間のシーク完了
時差は、データバッファBFI、BF2それぞれのデー
タラッチ時間に吸収されることになる。
That is, after latching the transfer of write data from the memory buffer 26 to the data buffers BFI and BF2 of each SMD interface 27a and 27b, when simultaneously controlling the write seek operations of each magnetic disk device 13a and 13b, the magnetic disk device 13a, The seek completion time difference between 13b and 13b is absorbed by the data latch time of each of data buffers BFI and BF2.

一方、磁気ディスク装置13aからSMDインターフェ
イス27aを通してのデータ読出し処理の際に、該読出
しデータに異常が生じていることがマイクロプロセッサ
22により判断されると、該マイクロプロセッサ22は
磁気ディスク装置13aに装着されるディスクに異常が
発生したとして、ホストコンピュータ11によるデータ
の1込み及び読出しの制御対象をSMDインターフ;イ
ス27b側に切換える。
On the other hand, when the microprocessor 22 determines that an abnormality has occurred in the read data during data read processing from the magnetic disk device 13a through the SMD interface 27a, the microprocessor 22 is attached to the magnetic disk device 13a. Assuming that an abnormality has occurred in the disk being stored, the control target for data loading and reading by the host computer 11 is switched to the SMD interface chair 27b.

したがって、上記構成の2ポートデイスクコ〉トローラ
によれば、二重化した磁気ディスク装置のそれぞれに専
用のディスクコントローラを設Cプる必要なく、ホスト
コンピュータからの一度のデータ書込み要求に応じて該
二重化磁気ディスク馨置のそれぞれに同時にデータ書込
みを行なうことが可能になる。これにより、二重化ディ
スクに刻するデータ書込み時間が長くなる等の不具合が
住じることはない。
Therefore, according to the two-port disk controller configured as described above, there is no need to install a dedicated disk controller for each of the duplexed magnetic disk devices, and the dual-port disk controller responds to a single data write request from the host computer. It becomes possible to write data to each of the disks at the same time. This prevents problems such as an increase in the time it takes to write data onto a duplex disk.

[発明の効果] 以上のように本発明によれば、2つのディスク装置と、
ホストコンピュータからの書込みデータを記憶するメモ
リバッファと、このメモリバッファと上記2つのディス
ク装置との間にそれぞれ独立して接続され各対応するデ
ィスク装置の書込みシーク動作をそれぞれ同一の書込み
アドレスに基づき制御する2つのディスクインターフェ
イスと、この2つのディスクインターフェイスのそれぞ
れに備えられ上記メモリバッファから転送された書込み
データを上記書込みシーク動作時間に応じてラッチする
データバッファと、上記2つのディスクインターフェイ
スによる書込みシーク動作を同時制御し一方のディスク
装置の故障時には他方のディスク装置に対応するディス
クインターフェイスを通してデータ読出し制御するディ
スクインターフェイス制御手段とを備えて構成し、ホス
トコンピュータからのデータの書込み要求があった場合
に、その書込みデータを上記メモリバッファに一旦格納
し、上記2つのディスクインターフェイスそれぞれのデ
ータバッファに対して同時に転送すると共に、該2つの
ディスクインターフェイスを通して上記2つのディスク
装置の書込みシーク動作を共通の書込みアドレスに基づ
き同時制御し、各ディスク装置のシーク完了に応じて上
記データバッファにラッチされたデータの書込みを行な
うことにより、ホストコンピュータからのデータの書込
み処理を二度繰返し行なう必要なく、磁気ディスク装置
の二重化を図ることが可能になる。
[Effects of the Invention] As described above, according to the present invention, two disk devices,
A memory buffer that stores write data from the host computer is connected independently between this memory buffer and the above two disk devices, and the write seek operation of each corresponding disk device is controlled based on the same write address. a data buffer provided in each of the two disk interfaces and latching the write data transferred from the memory buffer according to the write seek operation time; and a write seek operation by the two disk interfaces. and a disk interface control means that simultaneously controls the disk drives and controls data reading through the disk interface corresponding to the other disk drive when one disk drive fails, and when there is a data write request from the host computer, The write data is temporarily stored in the memory buffer, and simultaneously transferred to the data buffers of each of the two disk interfaces, and the write seek operations of the two disk devices are transferred to a common write address through the two disk interfaces. By performing simultaneous control based on the data and writing the latched data to the data buffer in accordance with the completion of seek for each disk device, it is possible to duplicate the magnetic disk device without having to repeat the data writing process from the host computer twice. It becomes possible to aim for

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の一実施例に係わる2ポートデイスクコ
ントローラの構成を示すブロック図、第2図は上記2ボ
ートデイスクコントローラにおけるディスクコントロー
ラの内部構成を示すブロック図、第3図は磁気ディスク
装置の従来の二重化システムの構成を示すブロック図で
ある。 11・・・ホストコンピュータ、13a、13b・・・
磁気ディスク装置、21・・・ディスクコントローラ。 22・・・マイクロプロセッサ、23・・・メモリ、2
4・・・タイマ、25・・・ポストインターフェイス、
26・・・メモリバッファ、27a、27b・・・SM
Dインターフェイス、28・・・SMD制御部、BFI
BF2・・・データバッファ。 出願人代理人 弁理士 鈴江武彦 第 図
FIG. 1 is a block diagram showing the configuration of a 2-port disk controller according to an embodiment of the present invention, FIG. 2 is a block diagram showing the internal configuration of the disk controller in the 2-port disk controller, and FIG. 3 is a magnetic disk device. 1 is a block diagram showing the configuration of a conventional duplex system. 11...Host computer, 13a, 13b...
Magnetic disk device, 21... disk controller. 22...Microprocessor, 23...Memory, 2
4...Timer, 25...Post interface,
26...Memory buffer, 27a, 27b...SM
D interface, 28...SMD control section, BFI
BF2...Data buffer. Applicant's agent Patent attorney Takehiko Suzue

Claims (1)

【特許請求の範囲】 2つのディスク装置と、 ホストコンピュータからの書込みデータを記憶するメモ
リバッファと、 このメモリバッファと上記2つのディスク装置との間に
それぞれ独立して接続され各対応するディスク装置の書
込みシーク動作をそれぞれ同一の書込みアドレスに基づ
き制御する2つのディスクインターフェイスと、 この2つのディスクインターフェイスのそれぞれに備え
られ上記メモリバッファから転送された書込みデータを
上記書込みシーク動作時間に応じてラッチするデータバ
ッファと、上記2つのディスクインターフェイスによる
書込みシーク動作を同時制御し、一方のディスク装置の
故障時には他方のディスク装置に対応するディスクイン
ターフェイスを通してデータ読出し制御するディスクイ
ンターフェイス制御手段と、を具備したことを特徴とす
る2ポートディスクコントローラ。
[Scope of Claims] Two disk devices, a memory buffer that stores write data from a host computer, and a memory buffer that is independently connected between the memory buffer and the two disk devices and that stores information about each of the corresponding disk devices. Two disk interfaces that control write seek operations based on the same write address, and data that is provided in each of these two disk interfaces and latches the write data transferred from the memory buffer according to the write seek operation time. It is characterized by comprising a buffer, and disk interface control means that simultaneously controls write seek operations by the two disk interfaces, and controls data reading through the disk interface corresponding to the other disk device when one disk device fails. 2-port disk controller.
JP2152558A 1990-06-13 1990-06-13 2-port disk controller Pending JPH0447323A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2152558A JPH0447323A (en) 1990-06-13 1990-06-13 2-port disk controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2152558A JPH0447323A (en) 1990-06-13 1990-06-13 2-port disk controller

Publications (1)

Publication Number Publication Date
JPH0447323A true JPH0447323A (en) 1992-02-17

Family

ID=15543103

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2152558A Pending JPH0447323A (en) 1990-06-13 1990-06-13 2-port disk controller

Country Status (1)

Country Link
JP (1) JPH0447323A (en)

Similar Documents

Publication Publication Date Title
JP3316500B2 (en) Increase the number of drives in a RAID set while maintaining the integrity of the moved data
JPH0264834A (en) Data transfer device in miniature computer system
US6477628B1 (en) Backup copy achieving improved efficiency by waiting until rewind/unload command for bulk data copy
JPH04311219A (en) Data backup system
JPH0447323A (en) 2-port disk controller
JP3139635B2 (en) Duplex file control method
JPH0793101A (en) Data backup device
JPH11175261A (en) Control method for disk
JPH06131123A (en) External storage device of computer
JP2827520B2 (en) Input/Output Control Unit
JPH05181613A (en) Information processor
JPH09212425A (en) Write cache backup system
JPH04291618A (en) Duplexed disk control system
JP3226047B2 (en) Input/Output Devices
JP2003186629A (en) Data copy system
JPH07319720A (en) System switching method for processor
JPH02113467A (en) Disk control method
JPH0317130B2 (en)
JPS6332642A (en) Information processor
JPS61134859A (en) Backup controlling system of memory
JPH0132535B2 (en)
JPS59112353A (en) Data reading method from recording medium
JPH0635621A (en) Dual disk storage device having dual restoring function
JPH0492916A (en) Double write control system
JPH11224167A (en) Recording and reproducing device