f-fdisk做磁盘分区,起始扇区从2048块开始
文章目錄
- First Sector 起始扇區(qū)
- fdisk工具加分區(qū)
- fdisk刪除分區(qū)
First Sector 起始扇區(qū)
默認從第2048塊扇區(qū)開始是因為,由于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.隨著傳統(tǒng)BIOS的死亡(不確定,它還沒有完全死亡)并且用EFI BIOS替代它,需要一個特殊的啟動分區(qū)來允許EFI系統(tǒng)以EFI模式啟動。
在扇區(qū)2048處啟動第一個分區(qū)會留下1Mb用于EFI引導(dǎo)代碼。 現(xiàn)代分區(qū)工具無論如何都會這樣做,并且fdisk已經(jīng)更新
EFI是Extensible Firmware Interface(可擴展固件接口)的縮寫
fdisk工具加分區(qū)
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,新添加一個分區(qū)
p primary (1 primary, 0 extended, 3 free)e extended
一般選擇p主分區(qū),默認一塊hdd可以做4分區(qū),如果想要添加擴展分區(qū),就選擇e
Partition number (1-4, default 1): 1 #默認從第一分區(qū)開始
First sector (2048-4294967295, default 2048): 直接回車 #第一個起始扇區(qū),每個扇區(qū)大小默認為512B,默認從2048開始,詳細原因已經(jīng)在上面描述,需要為EFI留下啟動空間
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-4294967294, default 4294967294): 429496 #自己選擇的結(jié)束分區(qū)大小,可以手動計算分區(qū) (429496 *512)/(1024*1024*1024) M
Partition 1 of type Linux and of size 208.7 MiB is set
接下來可以使用p來查看做出的分區(qū)
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,保存配置。否則繼續(xù)按照如上步驟添加
The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.
fdisk刪除分區(qū)
同樣使用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打印當前分區(qū)情況
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開始刪除分區(qū)
Command (m for help): d #當前分區(qū)號是可選的,可以選擇1或者2
Partition number (1,2, default 2): 1
Partition 1 is deleted
輸入p查看分區(qū)內(nèi)容
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
想要接著刪除,那么繼續(xù)輸入d,否則輸入w保存退出
總結(jié)
以上是生活随笔為你收集整理的f-fdisk做磁盘分区,起始扇区从2048块开始的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《春雪》第十八句是什么
- 下一篇: 鼋头渚车可以开进去吗