TWI796631B - Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same - Google Patents

Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same Download PDF

Info

Publication number
TWI796631B
TWI796631B TW110103813A TW110103813A TWI796631B TW I796631 B TWI796631 B TW I796631B TW 110103813 A TW110103813 A TW 110103813A TW 110103813 A TW110103813 A TW 110103813A TW I796631 B TWI796631 B TW I796631B
Authority
TW
Taiwan
Prior art keywords
external storage
storage device
formatted
hard disk
automatically
Prior art date
Application number
TW110103813A
Other languages
Chinese (zh)
Other versions
TW202232311A (en
Inventor
陳昭綸
李安正
黃立維
Original Assignee
宏碁股份有限公司
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 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW110103813A priority Critical patent/TWI796631B/en
Publication of TW202232311A publication Critical patent/TW202232311A/en
Application granted granted Critical
Publication of TWI796631B publication Critical patent/TWI796631B/en

Links

Images

Landscapes

  • Electrophonic Musical Instruments (AREA)
  • Exchange Systems With Centralized Control (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

A method for realizing a plug-and-play function of an external storage device in a Linux system and an electronic device using the same are provided. The method includes the following steps. Whether an external storage device inserted into an electronic device installed the Linux system is a mechanical hard drive (HDD) or a solid state drive (SSD) is detected. Whether the external storage device has been formatted is detected. If the external storage device is the mechanical hard disk or the solid state drive, and the external storage device has not been formatted, the external storage device will be automatically formatted with the NTFS file system. After the external storage device has been formatted, the external storage device is automatically mounted.

Description

在Linux系統實現外接式儲存裝置之隨插即用功 能的方法及應用其之電子裝置 Realize the plug and play function of external storage device in Linux system Energy-saving method and electronic device using the same

本揭露是有關於一種外接式儲存裝置之控制方法及應用其之電子裝置,且特別是有關於一種在Linux系統實現外接式儲存裝置之隨插即用功能的方法及應用其之電子裝置。 The present disclosure relates to a method for controlling an external storage device and an electronic device using the same, and in particular to a method for realizing the plug-and-play function of an external storage device in a Linux system and an electronic device using the same.

隨著科技的發展,各式電子裝置不斷堆陳出新。在電子裝置中,部分的電子裝置可以安裝Linux系統。Linux系統可以安裝於嵌入式裝置、個人電腦或超級電腦(Super Computer)上。 With the development of science and technology, various electronic devices continue to pile up new ones. Among the electronic devices, a Linux system can be installed on some of the electronic devices. The Linux system can be installed on an embedded device, a personal computer or a super computer (Super Computer).

對進行電子裝置的測試或其他程序時,經常需要插入外接式儲存裝置來儲存測試報告或其他資料。然而,外接式儲存裝置插入採用Linux系統的電子裝置時,必須透過專業人士對電子裝置下達大量Shell script指令,才能夠對外接式儲存裝置進行初始化,而無法隨插即用,這對一般使用者而言相當不便。 When performing tests or other procedures on electronic devices, it is often necessary to insert an external storage device to store test reports or other data. However, when an external storage device is plugged into an electronic device using a Linux system, a large number of Shell script commands must be issued to the electronic device by a professional to initialize the external storage device, and plug-and-play is not possible. quite inconvenient.

本揭露係有關於一種在Linux系統實現外接式儲存裝置之隨插即用功能的方法及應用其之電子裝置,其對外接式儲存裝置進行分類偵測,並自動進行對應的格式化與掛載程序,使得外接式儲存裝置能夠在Linux系統下實現隨插即用的功能。 This disclosure is about a method for realizing the plug-and-play function of an external storage device in a Linux system and an electronic device using the same, which classifies and detects external storage devices, and automatically performs corresponding formatting and mounting The program enables the external storage device to realize the plug-and-play function under the Linux system.

根據本揭露之第一方面,提出一種在Linux系統實現外接式儲存裝置之隨插即用功能的方法。在Linux系統實現外接式儲存裝置之隨插即用功能的方法包括以下步驟。偵測插入一電子裝置之一外接式儲存裝置是否為一機械硬碟(HDD)或一固態硬碟(SSD)。電子裝置安裝Linux系統。偵測外接式儲存裝置是否已格式化。若外接式儲存裝置為機械硬碟或固態硬碟,且外接式儲存裝置尚未格式化,則以NTFS檔案系統對外接式儲存裝置自動進行格式化。在外接式儲存裝置已格式化後,自動掛載(mount)外接式儲存裝置。 According to the first aspect of the present disclosure, a method for realizing the plug-and-play function of an external storage device in a Linux system is proposed. The method for implementing the plug-and-play function of an external storage device in a Linux system includes the following steps. Detect whether an external storage device inserted into an electronic device is a mechanical hard disk (HDD) or a solid state disk (SSD). The electronic device is installed with a Linux system. Detect whether the external storage device has been formatted. If the external storage device is a mechanical hard disk or solid state drive, and the external storage device has not been formatted, the external storage device will be automatically formatted with the NTFS file system. After the external storage device is formatted, automatically mount the external storage device.

根據本揭露之第二方面,提出一種安裝Linux系統之電子裝置。電子裝置包括一偵測單元、一格式化單元及一掛載單元。偵測單元用以偵測插入電子裝置之一外接式儲存裝置是否為一機械硬碟(HDD)或一固態硬碟(SSD),並偵測外接式儲存裝置是否已格式化。若外接式儲存裝置為機械硬碟或固態硬碟,且外接式儲存裝置尚未格式化,則以NTFS檔案系統對外接式儲存裝置自動進行格式化。掛載單元用以在外接式儲存裝置已格式化後,自動掛載(mount)外接式儲存裝置。 According to the second aspect of the present disclosure, an electronic device installed with a Linux system is provided. The electronic device includes a detection unit, a formatting unit and a mounting unit. The detecting unit is used for detecting whether the external storage device inserted into the electronic device is a mechanical hard disk (HDD) or a solid state disk (SSD), and whether the external storage device has been formatted. If the external storage device is a mechanical hard disk or solid state drive, and the external storage device has not been formatted, the external storage device will be automatically formatted with the NTFS file system. The mounting unit is used for automatically mounting (mount) the external storage device after the external storage device is formatted.

為了對本揭露之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下: In order to have a better understanding of the above and other aspects of the present disclosure, the following specific embodiments are described in detail in conjunction with the attached drawings as follows:

100,200:電子裝置 100,200: electronic devices

110:偵測單元 110: Detection unit

120:格式化單元 120: format unit

130:掛載單元 130: Mounting unit

240:測試單元 240:Test unit

250:讀寫單元 250: read and write unit

260:電量量測單元 260: power measurement unit

270:警示單元 270: warning unit

800,900:外接式儲存裝置 800,900: external storage device

RP:測試報告 RP: Test report

S110,S120,S130,S140,S141,S142,S150,S151,S152,S160,S161,S162,S170,S171,S172,S243~S249,S253~S259,S263~S269,S273~S279:步驟 S110, S120, S130, S140, S141, S142, S150, S151, S152, S160, S161, S162, S170, S171, S172, S243~S249, S253~S259, S263~S269, S273~S279: steps

第1圖繪示根據一實施例之電子裝置及外接式儲存裝置之示意圖。 FIG. 1 shows a schematic diagram of an electronic device and an external storage device according to an embodiment.

第2圖繪示根據一實施例之電子裝置之方塊圖。 FIG. 2 shows a block diagram of an electronic device according to an embodiment.

第3圖繪示根據一實施例之實現隨插即用功能之外接式儲存裝置的控制方法的流程圖。 FIG. 3 is a flow chart of a method for controlling an external storage device implementing a plug-and-play function according to an embodiment.

第4圖繪示根據另一實施例之電子裝置之方塊圖。 FIG. 4 shows a block diagram of an electronic device according to another embodiment.

第5A~5E圖繪示根據另一實施例之實現隨插即用功能及自動儲存測試報告之外接式儲存裝置的控制方法的流程圖。 FIGS. 5A-5E are flow charts illustrating a control method of an external storage device for realizing the plug-and-play function and automatically storing test reports according to another embodiment.

請參照第1圖,其繪示根據一實施例之電子裝置100及外接式儲存裝置800之示意圖。電子裝置100例如是一筆記型電腦、一桌上型電腦、一平板電腦或一行動電話。外接式儲存裝置800例如是一機械硬碟(HDD)、一固態硬碟(SSD)、一隨身碟或一記憶卡。 Please refer to FIG. 1 , which shows a schematic diagram of an electronic device 100 and an external storage device 800 according to an embodiment. The electronic device 100 is, for example, a notebook computer, a desktop computer, a tablet computer or a mobile phone. The external storage device 800 is, for example, a mechanical hard disk (HDD), a solid state disk (SSD), a flash drive or a memory card.

電子裝置100已安裝Linux系統。通常外接式儲存裝置800必須已經進行格式化才能提供給電子裝置100使用。外接式儲存裝置800可以透過複雜的Shell script指令來進行格式化,但這對使用者 而言並不方便。尤其是外接式儲存裝置800種類繁多,面對不同種類的外接式儲存裝置800,還需要不同的Shell script指令來進行格式化,這對一般使用者而言實在難以完成。本揭露透過偵測與自動化程序,讓各種外接式儲存裝置800皆能夠在Linux系統上自動完成初始化程序,而能夠實現隨插即用功能,方便一般使用者使用。 The electronic device 100 has installed a Linux system. Generally, the external storage device 800 must be formatted before it can be used by the electronic device 100 . The external storage device 800 can be formatted through complex Shell script commands, but this is a problem for users It is not convenient. In particular, there are various types of external storage devices 800 . Faced with different types of external storage devices 800 , different Shell script commands are required for formatting, which is difficult for ordinary users to complete. This disclosure allows various external storage devices 800 to automatically complete the initialization process on the Linux system through the detection and automatic procedures, and can realize the plug-and-play function, which is convenient for general users.

請參照第2圖,其繪示根據一實施例之電子裝置100之方塊圖。電子裝置100包括一偵測單元110、一格式化單元120及一掛載單元130。偵測單元110、格式化單元120及掛載單元130例如是一軟體程式碼、一晶片、一電路、一電路板或儲存軟體程式碼之儲存裝置。偵測單元110可以對外接式儲存裝置800進行偵測。在取得外接式儲存裝置800的各項資訊後,利用格式化單元120對外接式儲存裝置800自動進行格式化。並且,利用掛載單元130對外接式儲存裝置800自動進行掛載(mount)。如此一來,使用者無需輸入複雜的Shell script指令,即可順利初始化外接式儲存裝置800,而實現隨插即用功能。以下更透過一流程圖詳細說明各項元件之運作。 Please refer to FIG. 2 , which shows a block diagram of an electronic device 100 according to an embodiment. The electronic device 100 includes a detection unit 110 , a formatting unit 120 and a mounting unit 130 . The detecting unit 110 , the formatting unit 120 and the mounting unit 130 are, for example, a software code, a chip, a circuit, a circuit board or a storage device for storing software code. The detection unit 110 can detect the external storage device 800 . After obtaining various information of the external storage device 800 , the formatting unit 120 is used to automatically format the external storage device 800 . Moreover, the external storage device 800 is automatically mounted by the mounting unit 130 . In this way, the user can successfully initialize the external storage device 800 without inputting complex shell script commands, thereby realizing the plug-and-play function. The operation of each component is described in detail below through a flow chart.

請參照第3圖,其繪示根據一實施例之實現隨插即用功能之外接式儲存裝置800的控制方法的流程圖。在步驟S110中,偵測單元110偵測插入電子裝置100之外接式儲存裝置800是否為一機械硬碟或一固態硬碟。若外接式儲存裝置800為機械硬碟或固態硬碟,則進入步驟S120;若外接式儲存裝置800不是機械硬碟或固態硬碟,則進入步驟S130。 Please refer to FIG. 3 , which shows a flow chart of a control method of the external storage device 800 for realizing the plug-and-play function according to an embodiment. In step S110 , the detecting unit 110 detects whether the external storage device 800 inserted into the electronic device 100 is a mechanical hard disk or a solid state hard disk. If the external storage device 800 is a mechanical hard disk or a solid state disk, proceed to step S120; if the external storage device 800 is not a mechanical hard disk or a solid state disk, proceed to step S130.

在步驟S120中,偵測單元110偵測插入電子裝置100之外接式儲存裝置800為機械硬碟還是固態硬碟。若外接式儲存裝置800為機械硬碟,則進入步驟S140;若外接式儲存裝置800為固態硬碟,則進入步驟S150。 In step S120 , the detection unit 110 detects whether the external storage device 800 inserted into the electronic device 100 is a mechanical hard disk or a solid state hard disk. If the external storage device 800 is a mechanical hard disk, go to step S140; if the external storage device 800 is a solid state disk, go to step S150.

在步驟S130中,偵測單元110偵測插入電子裝置100之外接式儲存裝置800之容量是否大於4GB。若外接式儲存裝置800之容量大於4GB,則進入步驟S160;若外接式儲存裝置800之容量不大於4GB,則進入步驟S170。 In step S130 , the detection unit 110 detects whether the capacity of the external storage device 800 inserted into the electronic device 100 is greater than 4GB. If the capacity of the external storage device 800 is greater than 4GB, proceed to step S160; if the capacity of the external storage device 800 is not greater than 4GB, proceed to step S170.

根據步驟S110~S130的判斷,已將外接式儲存裝置800分類為「機械硬碟」、「固態硬碟」、「大於4GB之其他儲存裝置」、「不大於4GB之其他儲存裝置」。 According to the judgment of steps S110-S130, the external storage device 800 has been classified into "mechanical hard disk", "solid state disk", "other storage devices greater than 4GB", and "other storage devices not greater than 4GB".

歸類為這四種類別後,分別在步驟S140、S150、S160、S170以偵測單元110偵測外接式儲存裝置800是否已格式化。若外接式儲存裝置800未格式化,則分別進入步驟S141、S151、S161、S171;若外接式儲存裝置800已格式化,則分別進入步驟S142、S152、S162、S172。 After being classified into these four categories, the detection unit 110 detects whether the external storage device 800 has been formatted in steps S140 , S150 , S160 , and S170 respectively. If the external storage device 800 is not formatted, go to steps S141, S151, S161, S171; if the external storage device 800 is formatted, go to steps S142, S152, S162, S172.

在步驟S141中,格式化單元120以NTFS檔案系統對「機械硬碟」之外接式儲存裝置800自動進行格式化。 In step S141, the formatting unit 120 automatically formats the "mechanical hard disk" external storage device 800 with the NTFS file system.

在步驟S151中,格式化單元120以NTFS檔案系統對「固態硬碟」之外接式儲存裝置800自動進行格式化。 In step S151 , the formatting unit 120 automatically formats the "solid state disk" external storage device 800 with the NTFS file system.

在步驟S161中,格式化單元120以FAT32檔案系統對「大於4GB之其他儲存裝置」之外接式儲存裝置800自動進 行格式化。 In step S161, the formatting unit 120 automatically executes the external storage device 800 on the "other storage device greater than 4GB" in the FAT32 file system. Row formatting.

在步驟S171中,格式化單元120以exFAT檔案系統對「不大於4GB之其他儲存裝置」之外接式儲存裝置800自動進行格式化。 In step S171, the formatting unit 120 automatically formats the external storage device 800 of the "other storage device not larger than 4GB" with the exFAT file system.

接著,在步驟S142、S152、S162、S172,掛載單元130自動掛載外接式儲存裝置800。 Next, in steps S142 , S152 , S162 , and S172 , the mounting unit 130 automatically mounts the external storage device 800 .

根據上述實施例,偵測單元110能夠自動偵測出外接式儲存裝置800屬於「機械硬碟」、「固態硬碟」、「大於4GB之其他儲存裝置」、「不大於4GB之其他儲存裝置」之4種分類,並透過格式化單元120以適當的檔案系統進行格式化,且透過掛載單元130自動進行掛載。如此一來,一旦外接式儲存裝置800插入電子裝置100,電子裝置100即可自動地對外接式儲存裝置800進行初始化,讓外接式儲存裝置800能夠在Linux系統下實現隨插即用功能。 According to the above embodiment, the detection unit 110 can automatically detect that the external storage device 800 belongs to "mechanical hard disk", "solid state disk", "other storage devices larger than 4GB", and "other storage devices not larger than 4GB". 4 categories, formatted with an appropriate file system through the formatting unit 120, and automatically mounted through the mounting unit 130. In this way, once the external storage device 800 is inserted into the electronic device 100, the electronic device 100 can automatically initialize the external storage device 800, so that the external storage device 800 can realize the plug-and-play function under the Linux system.

實現了外接式儲存裝置800在安裝Linux系統下的隨插即用功能之後,更可以進一步實現自動儲存測試報告的功能。請參照第4圖,其繪示根據另一實施例之電子裝置200之方塊圖。電子裝置200包括一偵測單元110、一格式化單元120、一掛載單元130、一測試單元240、一讀寫單元250、一電量量測單元260及一警示單元270。測試單元240、讀寫單元250、電量量測單元260及警示單元270例如是一軟體程式碼、一晶片、一電路、一電路板或儲存軟體程式碼之儲存裝置。外接式儲存裝置900插 入電子裝置200後,電子裝置200即可自動地對外接式儲存裝置900進行初始化。接著,測試單元240依據儲存於電子裝置200的腳本自動執行一測試程序。在測試程序執行完畢後,讀寫單元250可以自動儲存一測試報告RP至外接式儲存裝置900,而實現自動儲存測試報告的功能。以下更透過一流程圖詳細說明各項元件之運作。 After the plug-and-play function of the external storage device 800 is installed under the Linux system, the function of automatically storing test reports can be further realized. Please refer to FIG. 4 , which shows a block diagram of an electronic device 200 according to another embodiment. The electronic device 200 includes a detection unit 110 , a format unit 120 , a mount unit 130 , a test unit 240 , a read/write unit 250 , a power measurement unit 260 and a warning unit 270 . The test unit 240 , the read/write unit 250 , the power measurement unit 260 and the warning unit 270 are, for example, a software code, a chip, a circuit, a circuit board or a storage device for storing software code. External storage device 900 plug After the electronic device 200 is loaded, the electronic device 200 can automatically initialize the external storage device 900 . Then, the test unit 240 automatically executes a test program according to the script stored in the electronic device 200 . After the test program is executed, the read-write unit 250 can automatically store a test report RP to the external storage device 900 to realize the function of automatically storing the test report. The operation of each component is described in detail below through a flow chart.

請參照第5A~5E圖,其繪示根據另一實施例之實現隨插即用功能及自動儲存測試報告之外接式儲存裝置900的控制方法的流程圖。步驟S110、S120、S130、S140、S150、S160、S170、S141、S142、S151、S152、S161、S162、S171、S172描述的是前述之隨插即用功能,同前所述,在此不再重述。 Please refer to FIGS. 5A-5E , which illustrate a flowchart of a control method of the external storage device 900 for implementing the plug-and-play function and automatically storing test reports according to another embodiment. Steps S110, S120, S130, S140, S150, S160, S170, S141, S142, S151, S152, S161, S162, S171, and S172 describe the aforementioned plug-and-play functions, which are the same as those described above and are not repeated here. restate.

在自動完成外接式儲存裝置900之初始化後,分別進入步驟S243、S253、S263、S273。 After the initialization of the external storage device 900 is automatically completed, step S243 , S253 , S263 , and S273 are respectively entered.

在步驟S243、S253、S263、S273中,測試單元240對電子裝置200自動執行測試程序。測試程序例如是進行電子裝置200之通訊功能測試或顯示功能測試。 In steps S243 , S253 , S263 , and S273 , the test unit 240 automatically executes a test program on the electronic device 200 . The testing program is, for example, performing a communication function test or a display function test of the electronic device 200 .

接著,在步驟S244、S254、S264、S274中,電量量測單元260判斷電子裝置200之電量低於一預定準位(例如是5%或10%)。若電子裝置200之電量低於預定準位,則分別進入步驟S246、S256、S266、S276;若電子裝置200之電量不低於預定準位,則分別進入步驟S245、S255、S265、S275。 Next, in steps S244 , S254 , S264 , and S274 , the power measurement unit 260 determines that the power of the electronic device 200 is lower than a predetermined level (for example, 5% or 10%). If the electric quantity of the electronic device 200 is lower than the predetermined level, then enter step S246, S256, S266, S276 respectively;

在步驟S245、S255、S265、S275中,測試單元 240判斷電子裝置200是否完成測試程序。若電子裝置200已完成測試程序,則進入步驟S246、S256、S266、S276;若電子裝置200未完成測試程序,則回至步驟S243、S253、S263、S273。 In steps S245, S255, S265, S275, the test unit 240 Determine whether the electronic device 200 completes the testing procedure. If the electronic device 200 has completed the test procedure, then enter steps S246, S256, S266, S276; if the electronic device 200 has not completed the test procedure, then return to steps S243, S253, S263, S273.

在步驟S246中,讀寫單元250以一第一速度對「機械硬碟」之外接式儲存裝置900進行讀寫,以自動儲存測試報告RP至外接式儲存裝置900。 In step S246 , the read-write unit 250 reads and writes the “mechanical hard disk” external storage device 900 at a first speed, so as to automatically store the test report RP in the external storage device 900 .

在步驟S256中,讀寫單元250以一第二速度對「固態硬碟」之外接式儲存裝置900進行讀寫,以自動儲存測試報告RP至外接式儲存裝置900。第二速度高於第一速度。 In step S256 , the read-write unit 250 reads and writes the “solid state disk” external storage device 900 at a second speed, so as to automatically store the test report RP in the external storage device 900 . The second speed is higher than the first speed.

在步驟S266、S276中,讀寫單元250以一第三速度對「大於4GB之其他儲存裝置」、「不大於4GB之其他儲存裝置」之外接式儲存裝置900進行讀寫,以自動儲存測試報告RP至外接式儲存裝置900。第三速度高於第一速度。 In steps S266 and S276, the read-write unit 250 reads and writes the external storage device 900 of "other storage devices larger than 4GB" and "other storage devices not larger than 4GB" at a third speed to automatically store the test report RP to the external storage device 900 . The third speed is higher than the first speed.

接著,在步驟S247、S257、S267、S277中,讀寫單元250判斷測試報告RP是否已儲存完畢。若測試報告RP已儲存完畢,則結束本流程;若測試報告RP尚未儲存完畢,則進入步驟S248、S258、S268、S278。 Next, in steps S247 , S257 , S267 , and S277 , the read-write unit 250 determines whether the test report RP has been stored. If the test report RP has been stored, the process ends; if the test report RP has not been stored, enter steps S248 , S258 , S268 , and S278 .

在步驟S248、S258、S268、S278中,讀寫單元250判斷外接式儲存裝置900之剩餘空間是否足夠。若外接式儲存裝置900之剩餘空間足夠,則回至步驟S246、S256、S266、S276;若外接式儲存裝置900之剩餘空間不足,則進入步驟S249、S259、S269、S279。 In steps S248 , S258 , S268 , and S278 , the read-write unit 250 determines whether the remaining space of the external storage device 900 is sufficient. If the remaining space of the external storage device 900 is sufficient, go back to steps S246, S256, S266, S276; if the remaining space of the external storage device 900 is not enough, go to steps S249, S259, S269, S279.

在步驟S249、S259、S269、S279中,警示單元270發出一警示訊息,以通知操作人員更換外接式儲存裝置900。 In steps S249 , S259 , S269 , and S279 , the warning unit 270 sends out a warning message to notify the operator to replace the external storage device 900 .

根據上述實施例,測試單元240能夠自動對電子裝置200自動執行測試程序,並透過讀寫單元250自動儲存測試報告RP。如此一來,讓安裝Linux系統的電子裝置200能夠實現自動儲存測試報告的功能。 According to the above-mentioned embodiment, the test unit 240 can automatically execute the test program on the electronic device 200 and automatically store the test report RP through the read-write unit 250 . In this way, the electronic device 200 installed with the Linux system can realize the function of automatically storing test reports.

綜上所述,雖然本揭露已以實施例揭露如上,然其並非用以限定本揭露。本揭露所屬技術領域中具有通常知識者,在不脫離本揭露之精神和範圍內,當可作各種之更動與潤飾。因此,本揭露之保護範圍當視後附之申請專利範圍所界定者為準。 To sum up, although the present disclosure has been disclosed above with embodiments, it is not intended to limit the present disclosure. Those with ordinary knowledge in the technical field to which this disclosure belongs may make various changes and modifications without departing from the spirit and scope of this disclosure. Therefore, the scope of protection of this disclosure should be defined by the scope of the appended patent application.

S110,S120,S130,S140,S141,S142,S150,S151,S152,S160,S161,S162,S170,S171,S172:步驟 S110, S120, S130, S140, S141, S142, S150, S151, S152, S160, S161, S162, S170, S171, S172: steps

Claims (8)

一種在Linux系統實現外接式儲存裝置之隨插即用功能的方法,包括:偵測插入一電子裝置之一外接式儲存裝置是否為一機械硬碟(HDD)或一固態硬碟(SSD),該電子裝置安裝該Linux系統;偵測該外接式儲存裝置是否已格式化;若該外接式儲存裝置為該機械硬碟或該固態硬碟,且該外接式儲存裝置尚未格式化,則以NTFS檔案系統對該外接式儲存裝置自動進行格式化;在該外接式儲存裝置已格式化後,自動掛載(mount)該外接式儲存裝置;偵測該外接式儲存裝置之容量是否大於4GB;若該外接式儲存裝置不是該機械硬碟或該固態硬碟,且該外接式儲存裝置之容量大於4GB,且該外接式儲存裝置尚未格式化,則以FAT32檔案系統對該外接式儲存裝置自動進行格式化;以及若該外接式儲存裝置不是該機械硬碟或該固態硬碟,且該外接式儲存裝置之容量不大於4GB,且該外接式儲存裝置尚未格式化,則以exFAT檔案系統對該外接式儲存裝置自動進行格式化。 A method for realizing the plug-and-play function of an external storage device in a Linux system, comprising: detecting whether an external storage device inserted into an electronic device is a mechanical hard disk (HDD) or a solid state disk (SSD), Install the Linux system on the electronic device; detect whether the external storage device has been formatted; if the external storage device is the mechanical hard disk or the solid-state hard disk, and the external storage device has not been formatted, use NTFS The file system automatically formats the external storage device; after the external storage device has been formatted, automatically mounts the external storage device; detects whether the capacity of the external storage device is greater than 4GB; if The external storage device is not the mechanical hard disk or the solid-state hard disk, and the capacity of the external storage device is greater than 4GB, and the external storage device has not been formatted, then the external storage device will be automatically processed with the FAT32 file system format; and if the external storage device is not the mechanical hard disk or the solid-state hard disk, and the capacity of the external storage device is not greater than 4GB, and the external storage device has not been formatted, use the exFAT file system for the The external storage device is formatted automatically. 如請求項1所述在Linux系統實現外接式儲存裝置之隨插即用功能的方法,更包括:在該外接式儲存裝置掛載後,對該電子裝置自動執行一測試程序。 The method for implementing the plug-and-play function of an external storage device in a Linux system as described in claim 1 further includes: automatically executing a test program on the electronic device after the external storage device is mounted. 如請求項2所述在Linux系統實現外接式儲存裝置之隨插即用功能的方法,更包括:若該測試程序已執行完畢,則自動儲存一測試報告至該外接式儲存裝置。 The method for implementing the plug-and-play function of an external storage device in a Linux system as described in claim 2 further includes: automatically storing a test report to the external storage device if the test program has been executed. 如請求項2所述在Linux系統實現外接式儲存裝置之隨插即用功能的方法,更包括:若該電子裝置之電量低於一預定準位,則自動儲存一測試報告至該外接式儲存裝置。 The method for implementing the plug-and-play function of an external storage device in a Linux system as described in claim 2 further includes: automatically storing a test report to the external storage if the power of the electronic device is lower than a predetermined level device. 如請求項2所述在Linux系統實現外接式儲存裝置之隨插即用功能的方法,更包括:若該外接式儲存裝置之剩餘空間不足,則輸出一警示訊號。 The method for implementing the plug-and-play function of an external storage device in a Linux system as described in claim 2 further includes: outputting a warning signal if the remaining space of the external storage device is insufficient. 如請求項1所述在Linux系統實現外接式儲存裝置之隨插即用功能的方法,更包括:若該外接式儲存裝置為該機械硬碟,則以一第一速度對該外接式儲存裝置進行讀寫;以及若該外接式儲存裝置為該固態硬碟,則以一第二速度對該外接式儲存裝置進行讀寫,該第二速度高於該第一速度。 The method for implementing the plug-and-play function of an external storage device in a Linux system as described in claim 1 further includes: if the external storage device is the mechanical hard disk, then the external storage device at a first speed read and write; and if the external storage device is the solid-state hard disk, read and write the external storage device at a second speed, the second speed being higher than the first speed. 一種安裝Linux系統之電子裝置,包括: 一偵測單元,用以偵測插入該電子裝置之一外接式儲存裝置是否為一機械硬碟(HDD)或一固態硬碟(SSD),並偵測該外接式儲存裝置是否已格式化;一格式化單元,若該外接式儲存裝置為該機械硬碟或該固態硬碟,且該外接式儲存裝置尚未格式化,則以NTFS檔案系統對該外接式儲存裝置自動進行格式化;以及一掛載單元,用以在該外接式儲存裝置已格式化後,自動掛載(mount)該外接式儲存裝置;其中,該偵測單元更用以偵測該外接式儲存裝置之容量是否大於4GB;其中,若該外接式儲存裝置不是該機械硬碟或該固態硬碟,且該外接式儲存裝置之容量大於4GB,且該外接式儲存裝置尚未格式化,則該格式化單元更以FAT32檔案系統對該外接式儲存裝置自動進行格式化;其中,若該外接式儲存裝置不是該機械硬碟或該固態硬碟,且該外接式儲存裝置之容量不大於4GB,且該外接式儲存裝置尚未格式化,則該格式化單元更以exFAT檔案系統對該外接式儲存裝置自動進行格式化。 An electronic device installed with a Linux system, comprising: A detection unit for detecting whether the external storage device inserted into the electronic device is a mechanical hard disk (HDD) or a solid state disk (SSD), and detecting whether the external storage device has been formatted; A formatting unit, if the external storage device is the mechanical hard disk or the solid-state hard disk, and the external storage device has not been formatted, the external storage device is automatically formatted with the NTFS file system; and a The mounting unit is used to automatically mount (mount) the external storage device after the external storage device has been formatted; wherein, the detection unit is further used to detect whether the capacity of the external storage device is greater than 4GB ; Among them, if the external storage device is not the mechanical hard disk or the solid-state hard disk, and the capacity of the external storage device is greater than 4GB, and the external storage device has not been formatted, then the formatted unit will be formatted as a FAT32 file The system automatically formats the external storage device; if the external storage device is not the mechanical hard disk or the solid state drive, and the capacity of the external storage device is not greater than 4GB, and the external storage device has not Formatting, then the formatting unit automatically formats the external storage device with the exFAT file system. 如請求項7所述安裝Linux系統之電子裝置,更包括:一測試單元,用以在該外接式儲存裝置掛載後,對該電子裝置自動執行一測試程序;以及 一讀寫單元,若該測試程序已執行完畢,則該讀寫單元自動儲存一測試報告至該外接式儲存裝置。 The electronic device installed with the Linux system as described in claim 7 further includes: a test unit, which is used to automatically execute a test program on the electronic device after the external storage device is mounted; and A read-write unit, if the test program has been executed, the read-write unit automatically stores a test report to the external storage device.
TW110103813A 2021-02-02 2021-02-02 Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same TWI796631B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110103813A TWI796631B (en) 2021-02-02 2021-02-02 Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110103813A TWI796631B (en) 2021-02-02 2021-02-02 Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same

Publications (2)

Publication Number Publication Date
TW202232311A TW202232311A (en) 2022-08-16
TWI796631B true TWI796631B (en) 2023-03-21

Family

ID=83782633

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110103813A TWI796631B (en) 2021-02-02 2021-02-02 Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same

Country Status (1)

Country Link
TW (1) TWI796631B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201020762A (en) * 2008-11-21 2010-06-01 Inventec Corp Testing method for dynamic generating boot shell
TW201413586A (en) * 2012-09-28 2014-04-01 Innostor Technology Corp Multifunction storage device for booting
TW201445324A (en) * 2013-05-31 2014-12-01 Phind Corp Connecting and accessing method for remote hard drive, and non-transitory computer readable medium for using the same
CN106502657A (en) * 2016-10-11 2017-03-15 郑州云海信息技术有限公司 A kind of method for realizing that based on linux automatizatioies HBA cards hard disk configures RAID
CN108279933A (en) * 2018-01-25 2018-07-13 郑州云海信息技术有限公司 A kind of method of automatic carry USB flash disk under Linux system
CN111722879A (en) * 2020-06-19 2020-09-29 浪潮电子信息产业股份有限公司 USB flash disk identification method, Linux system, Linux equipment and readable storage medium
CN112231761A (en) * 2020-12-14 2021-01-15 统信软件技术有限公司 Device mounting method, computing device and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201020762A (en) * 2008-11-21 2010-06-01 Inventec Corp Testing method for dynamic generating boot shell
TW201413586A (en) * 2012-09-28 2014-04-01 Innostor Technology Corp Multifunction storage device for booting
TW201445324A (en) * 2013-05-31 2014-12-01 Phind Corp Connecting and accessing method for remote hard drive, and non-transitory computer readable medium for using the same
CN106502657A (en) * 2016-10-11 2017-03-15 郑州云海信息技术有限公司 A kind of method for realizing that based on linux automatizatioies HBA cards hard disk configures RAID
CN108279933A (en) * 2018-01-25 2018-07-13 郑州云海信息技术有限公司 A kind of method of automatic carry USB flash disk under Linux system
CN111722879A (en) * 2020-06-19 2020-09-29 浪潮电子信息产业股份有限公司 USB flash disk identification method, Linux system, Linux equipment and readable storage medium
CN112231761A (en) * 2020-12-14 2021-01-15 统信软件技术有限公司 Device mounting method, computing device and readable storage medium

Also Published As

Publication number Publication date
TW202232311A (en) 2022-08-16

Similar Documents

Publication Publication Date Title
TWI479309B (en) Apparatus and method for controlling a solid state disk
CN102568522B (en) The method of testing of hard disk performance and device
US20240264915A1 (en) Data storage method and apparatus, and electronic device and readable storage medium
CN103942009A (en) Apparatus and method for extending memory in terminal
CN114153779A (en) I2C communication method, system, equipment and storage medium
CN104133750A (en) Method and system for testing compatibility adaptability of host and storage device
US20040236804A1 (en) Monitoring and data exchange procedure for a peripheral data storage unit
US20110022901A1 (en) Method for testing hard disks under an extensible firmware interface
TWI796631B (en) Method for realizing plug-and-play function of external storage device in linux system and electronic device using the same
CN114155906A (en) Data block repairing method, device, equipment and storage medium
US9153345B2 (en) Error generating apparatus for solid state drive tester
US20120005441A1 (en) Copying apparatus, copying method, memory medium, and program
CN104199621A (en) Hard disk management system
CN116627737A (en) Hard disk testing method, device, equipment and medium
CN111142787A (en) Storage-layered data exchange testing method, system, terminal and storage medium
US9990382B1 (en) Secure erasure and repair of non-mechanical storage media
TWI791966B (en) Data processing method and memory controller utilizing the same
CN106909484B (en) System and method for simulating bad disk test in storage environment
CN102750234B (en) The control method of memorizer and controller
CN111367710A (en) eMMC problem reduction method and device
US6892274B2 (en) Method and apparatus for handling data transfers
CN103064803B (en) A kind of data read-write method of NAND Flash storage device and device
KR100925523B1 (en) Method Of Generating Error In Storage Device And Method Of Selecting Error Generating Location In Storage Device
TWI633434B (en) Method, system, and computer readable medium for managing solid state drive
EP3557422A1 (en) Method for accessing code sram, and electronic device