首页 > 编程知识 正文

diskgenius 2048扇区

时间:2023-05-05 20:29:08 阅读:277838 作者:1063

文章目录 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 volumeslarger 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 thanthe physical sector size. Aligning to a physical sector (or optimalI/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 flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x 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 2048Last sector, +sectors or +size{K,M,G} (2048-4294967294, default 4294967294): 429496 #自己选择的结束分区大小,可以手动计算分区 (429496 *512)/(1024*1024*1024) MPartition 1 of type Linux and of size 208.7 MiB is set

接下来可以使用p来查看做出的分区

Units = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk label type: dosDisk identifier: 0x00000000 Device 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 volumeslarger 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 thanthe physical sector size. Aligning to a physical sector (or optimalI/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 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk label type: dosDisk identifier: 0x00000000 Device 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或者2Partition number (1,2, default 2): 1Partition 1 is deleted

输入p查看分区内容

Command (m for help): pDisk /dev/sdd: 4000.8 GB, 4000787030016 bytes, 7814037168 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk label type: dosDisk identifier: 0x00000000 Device Boot Start End Blocks Id System/dev/sdd2 430080 42949672 21259796+ 83 Linux

想要接着删除,那么继续输入d,否则输入w保存退出

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。