FANFNA
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Disk [TOC] ## 一、Disk 簡介 - Disk 結構: - 磁區 (sector) - 磁軌 (track) - 磁柱 (cylinder) : 不同面之相同 tracks 形成之集合 - 讀寫頭 (Read/Write head) - ![](https://i.imgur.com/YP05d4v.png) - - ![](https://i.imgur.com/9rksXWG.png) - 描述磁碟幾何狀況 (C, H, S) - C (cylinder) : 幾圈 - H (head) : 幾面(一片有兩面、最上最下面不算。) - S (sector) : 一圈幾格 - Disk access time 由下列 3 個時間加總: 1. `Seek time`:將 Read/Write head 移到指定 track 上方所花的時間;三者中以 seek time 耗時最多,與 head 移動距離成正比,因為是機械動作。 2. `Latency (rotation) time`:將欲存取的 sector 轉到 Read/Write head 下方所花的時間。 3. `Transfer time`:資料在 disk 及 memory 之間的傳輸時間。 **[例題1] Disk Capacity** 若某硬碟有 10 個 disks,正反面皆可存資料但最上、最下一面不存。每一個表面上有 1024 條 tracks,每個 track 有 256 個 sectors。一個 sector 可存 512 byte 資料,則磁碟的容量為何? Ans : `(10×2 - 2) × 1024 × 256 × 512 Bytes = 18 × 2^7 MB` ## 二、Disk Scheduling Algorithm 1. FCFS 演算法 (first-come, first-serve):先到達的請求優先服務。 - 簡單、公平、效率不佳。 2. SSTF 演算法 (short-seek time first) :距離目前 R/W Head 最近的 track 優先服務。 - 並非是最佳的 (平均移動的 track 總數量無法保証為最少)。 - 不公平,可能會發生 starvation。 3. SCAN 演算法:讀寫頭來回不停地掃描,若有 track 請求則服務。 - 提供雙向服務 - 遇到起頭與尾端的 track 才折返。 - 因為要碰到起頭或尾端才會折返,會有一些不必要的磁軌移動產生相對不公平,但不會發生 starvation。 4. C-SCAN 演算法:讀寫頭來回不停地掃描,若有 track 請求則服務。 - 提供單向服務 - 遇到 track 起頭與尾端才折返。 5. LOOK 演算法、C-LOOK 演算法:與 SCAN 極相似。唯一不同在於處理完某方向的最後一個 track 請求即折返,不需遇到 track 起頭與尾端才折返。 一些 disk scheduling algorithm 常識: - Either SSTF or LOOK is a reasonable choice for the default algorithm. - Disk scheduling problem is inherently NP-hard. There is no optimal solution! Heuristics may be taken. - Modern disks impose nearly the same overheads on seek and rotation. ## 三、Disk Management - Low-level formatting (physical formatting): - Dividing a disk into sectors that the disk controller can read and write. - Remapping bad tracks - Zoned-bit encoding - 原廠或完整格式化時使用 (防老化)。 - Logical formatting (making a file system): - To use a disk to hold files, the operating system still needs to record its own data structures on the disk. - Partition the disk into one or more groups of cylinders. - 快速格式化,通常使用者格式化為此類,只寫掉檔案系統要用的表格。 - Boot block initializes system: - The bootstrap is stored in ROM. - Bootstrap loader program. - 傳統:bootstrap loader (ROM),找 OS object code 載入 memory。 - 現在:simple bootstrap (ROM) => 完整 bootstrap (Disk) => OS object code (Disk) => 開機完成。 - 完整的 bootstrap loader 是存放在 Disk 中固定位置,稱為 boot blocks。 - 擁有 boot blocks 之 disk 稱為 boot disk 或 system disk。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully