日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

f-fdisk做磁盘分区,起始扇区从2048块开始

發布時間:2023/11/27 生活经验 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 f-fdisk做磁盘分区,起始扇区从2048块开始 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

        • First Sector 起始扇區
        • fdisk工具加分區
        • fdisk刪除分區

First Sector 起始扇區

默認從第2048塊扇區開始是因為,由于EFI的興起,要給EFI 代碼留磁盤最開始的1M空間,即2048*521/(1024*1024)=1M

With the death of the legacy BIOS (ok, its not quite dead yet) and its replacement with EFI BIOS, a special boot partitionis needed to allow EFI systems to boot in EFI mode.
Starting the first partition at sector 2048 leaves 1Mb for the EFI boot code. Modern partitioning tools do this anyway and fdisk has been updated to follow suit.

隨著傳統BIOS的死亡(不確定,它還沒有完全死亡)并且用EFI BIOS替代它,需要一個特殊的啟動分區來允許EFI系統以EFI模式啟動。
在扇區2048處啟動第一個分區會留下1Mb用于EFI引導代碼。 現代分區工具無論如何都會這樣做,并且fdisk已經更新

EFI是Extensible Firmware Interface(可擴展固件接口)的縮寫

fdisk工具加分區

fdisk /dev/sdb 進入如下命令


WARNING: The size of this disk is 4.0 TB (4000787030016 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
partition table format (GPT).The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): 

輸入help,可以看到很多幫助指令

   a   toggle a bootable flagb   edit bsd disklabelc   toggle the dos compatibility flagd   delete a partitiong   create a new empty GPT partition tableG   create an IRIX (SGI) partition tablel   list known partition typesm   print this menun   add a new partitiono   create a new empty DOS partition tablep   print the partition tableq   quit without saving changess   create a new empty Sun disklabelt   change a partition's system idu   change display/entry unitsv   verify the partition tablew   write table to disk and exitx   extra functionality (experts only)

輸入n,新添加一個分區

 p   primary (1 primary, 0 extended, 3 free)e   extended

一般選擇p主分區,默認一塊hdd可以做4分區,如果想要添加擴展分區,就選擇e

Partition number (1-4, default 1): 1 #默認從第一分區開始
First sector (2048-4294967295, default 2048): 直接回車  #第一個起始扇區,每個扇區大小默認為512B,默認從2048開始,詳細原因已經在上面描述,需要為EFI留下啟動空間
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-4294967294, default 4294967294): 429496 #自己選擇的結束分區大小,可以手動計算分區 (429496 *512)/(1024*1024*1024) M
Partition 1 of type Linux and of size 208.7 MiB is set

接下來可以使用p來查看做出的分區

Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048      429496      213724+  83  Linux

如果確定添加好之后可以選擇w,保存配置。否則繼續按照如上步驟添加

The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.

fdisk刪除分區

同樣使用fdisk /dev/sdb進入想要操作得磁盤界面


WARNING: The size of this disk is 4.0 TB (4000787030016 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
partition table format (GPT).The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): 

輸入p打印當前分區情況


Disk /dev/sdd: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048      429496      213724+  83  Linux
/dev/sdd2          430080    42949672    21259796+  83  Linux

輸入d開始刪除分區

Command (m for help): d #當前分區號是可選的,可以選擇1或者2
Partition number (1,2, default 2): 1
Partition 1 is deleted

輸入p查看分區內容

Command (m for help): p
Disk /dev/sdd: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000Device Boot      Start         End      Blocks   Id  System
/dev/sdd2          430080    42949672    21259796+  83  Linux

想要接著刪除,那么繼續輸入d,否則輸入w保存退出

總結

以上是生活随笔為你收集整理的f-fdisk做磁盘分区,起始扇区从2048块开始的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。