首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >磁盘新磁盘大小

磁盘新磁盘大小
EN

Ask Ubuntu用户
提问于 2021-01-03 07:53:20
回答 1查看 1.3K关注 0票数 3

我使用的是ubuntu20.04,我想要创建新的分区磁盘,正好有500 MB。但是,fdisk将其调整为512 can,是否有任何方法可以创建准确的500 it磁盘大小?

代码语言:javascript
复制
ric@Eric:~/Downloads$ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
All primary partitions are in use.
Adding logical partition 7
First sector (2359260-10288994, default 2359260): 2359260
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2359260-10288994, default 10288994): +500M 

Created a new partition 7 of type 'Linux' and of size 512 MiB.

Command (m for help): p
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Portable SSD T5 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0xd13fa933

Device     Boot      Start        End   Sectors   Size Id Type
/dev/sda1  *    1952501760 1953523711   1021952   499M ef EFI (FAT-12/16/32)
/dev/sda2       1950453760 1952501759   2048000  1000M 83 Linux
/dev/sda3       1704693760 1950453759 245760000 117.2G 83 Linux
/dev/sda4            65536   10288994  10223459   4.9G  5 Extended
/dev/sda5           131071    1179629   1048559   512M 83 Linux
/dev/sda6          1245165    2293724   1048560   512M 83 Linux
/dev/sda7          2359260    3407819   1048560   512M 83 Linux

Partition table entries are not in disk order.

Command (m for help): 
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2021-01-03 08:13:04

这可以用数学解决!扇区大小为512字节,这意味着需要100万字节才能拥有500 to。

代码语言:javascript
复制
First sector (2359260-10288994, default 2359260): 2359260
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2359260-10288994, default 10288994): 3359260

但是,如果以下情况下,请为不完全为500 if的数字做好准备:

  • SSD上的存储控制器不喜欢这个数字。
  • 主板上的存储控制器不喜欢这个数字。

多年来,很多数学都在研究数据是如何在存储设备上编写和组织的,有些情况对于设备的长期使用来说是不太理想的。

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1304677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档