当前位置: 首页 > 编程日记 > 正文

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保存退出

相关文章:

c语言 静态链表插入排序,数据结构C语言版 表插入排序

西门豹治邺奇计数据结构C语言版 表插入排序.txt两个人吵架,先说对不起的人,并不是认输了,并不是原谅了。他只是比对方更珍惜这份感情。/*数据结构C语言版 表插入排序算法10.3 P267-P270编译环境:Dev-C 4.9.9.2日期:201…

C/C++流程图生成器 C转流程图【worldsing笔记】

此版本仅供学习,请大家支持正版软件!! AutoFlowChart v3.1软件下载: http://url.cn/OUK17C 支持导出:word、visio、图片格式。 例如:main.c #include "stdio.h" void main () {int s ; void f(in…

iOS编码:如何创建gbk编码

原文摘自:http://www.cnblogs.com/kiao295338444/articles/2590031.html 我们知道,使用NSURLConnection的代理方法下载网页,存到一个NSData中, NSMutableData *pageData; [pageData appendData:data]; 如果网页编码是UTF-8的&…

docker获取镜像很慢解决办法

docker pull selenium/hub获取非常慢 可以使用docker中国的官方镜像加速 docker pull registry.docker-cn.com/selenium/hub 官方加速:https://www.docker-cn.com/registry-mirror 转载于:https://www.cnblogs.com/gcgc/p/9845050.html

C语言生成一个随机的九行九列数独,一个随机生成数独的C++程序

下面是编程之家 jb51.cc 通过网络收集整理的代码片段。编程之家小编现在分享给大家&#xff0c;也给大家做个参考。//mySIZE是数独棋盘的边长&#xff0c;棋盘是mySIZE*mySIZE的大小int mySIZE 9;void print(const vector> &num){for (int i 0; i < mySIZE; i){for…

ceph中使用ceph-objectstore-tool将pg从incomplete标记为complete

起始原因是集群中部分osd元数据丢失&#xff0c;导致集群部分pg状态一直为incomplete&#xff0c;从而无法恢复为activateclean 所以同事介绍之前调研得ceph-objectstore-tool工具来做这样一个pg incomplete状态的恢复 普及一下incomplete状态表示&#xff1a;Peering过程中由…

Notification和KVO有什么不同

Notification是推送通知&#xff0c;我们可以建立一个通知中心&#xff0c;存放创建多个通知&#xff0c;在不同的地方在需要的时候push调用和KVO不同的是&#xff0c;KVO是键值观察&#xff0c;只能观察一个值&#xff0c;这就是区别转载于:https://www.cnblogs.com/ccguo/p/3…

Mysql修改设置root密码的命令及方法

2019独角兽企业重金招聘Python工程师标准>>> 方法一&#xff1a;使用SQL语句命令UPDATE 需用到Mysql自带的加密函数PASSWORD(string)&#xff0c;该函数对一个明文密码进行加密&#xff0c;但不能解密。专门用于mysql.user(用户权限表)中设置密码&#xff0c;命令如…

Android开发笔记1.2

1.2.1环境配置 配置Java环境&#xff0c; 在网上搜索一下&#xff0c;这样的教程有很多&#xff0c;我在这里就不做赘述了。 1.2.2开发第一个程序 我个人学习的是用Android Studio开发的&#xff0c;所以需要下载编辑器AndroidStudio。当然在安装过程中&#xff0c;下载的版本…

ceph osd混合部署和普通部署

文章目录混合osd的部署先部署所有的ssd部署hdd普通OSD的部署当OSD被踢出集群但是挂载点还在&#xff0c;为osd添加id验证测试OSD压力Mark osd 为down混合osd的部署 混合osd指的是将osd的db,wal分区放在ssd上同时该ssd剩下的容量也会做osd 先部署所有的ssd 在/etc/ceph.conf中…

c语言simpson积分计算方法,数值分析复化Simpson积分公式和复化梯形积分公式计算积分的通用程序...

数值分析复化Simpson积分公式和复化梯形积分公式计算积分的通用程序数值分析第五次程序作业PB09001057 孙琪【问题】分别编写用复化Simpson积分公式和复化梯形积分公式计算积分的通用程序&#xff1b; 用如上程序计算积分&#xff1a; I f sin x dx 0取节点xi &#xff0c; i0…

linux 光驱挂载

对于光驱设备的挂载&#xff1a; 首先创建一个文件夹&#xff1a;mkdir /mnt/cdrom&#xff08;名字位置任意&#xff09;mount /dev/cdrom /mnt/cdrom&#xff08;将光盘挂载到新建的/mnt下的 /cdrom目录&#xff09;转载于:https://www.cnblogs.com/foxhasdream/p/3356503.h…

Android中的HTTP通信

自己整理&#xff0c;整理得不好&#xff0c;不喜勿喷&#xff01; HTTP通信 HttpURLConnection接口 HTTP超文本传输协议&#xff0c;用于传送WWW方式的数据。HTTP协议采用了请求/响应模式。 Android提供了HTTPURLConnection和HttpClient接口来开发HTTP程序。 HTTP使用最多的就…

ceph admin socket修改ceph配置文件

目前有两种动态修改的方式来让ceph中各个组件的配置生效&#xff0c;所以介绍如下两种方式方便我们进行功能或者代码的调试 使用ceph daemon方式修改 ceph daemon osd.0 help用于osd的daemon服务ceph daemon mon.ceph-node1 help用于mon的admin socket命令、ceph daemon osd.…

持续集成之戏说Check-in Dance

《infoq》 众所周知&#xff0c;敏捷软件开发方法中有多种最佳实践&#xff0c;既有管理方面的&#xff0c;也有技术方面的。在尝试敏捷之初&#xff0c;并不是每个团队都能使用全部最佳实践&#xff0c;也不是每个实践都能在短时间内见效。但其中有一种最佳实践却是团队的必选…

C语言的基础题目,几个c语言的基础题目

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼{day_number day_1 day_2 day_3 day_4 day_5 day;printf("%d年%d月%d日为这一年的第%d天&#xff01;\n", year, month, day, day_number);}else{printf("输入的日不合法&#xff01;\n");}break;case 7…

Exchange企业实战技巧(3)配置Exchange证书

Exchange2010需要证书支持&#xff0c;exchange2010安装之后会默认开启ssl&#xff0c;在IE中只能使用https&#xff1a;//而不是http://来访问owa。如果没有证书&#xff0c;也能安装exchange2010&#xff0c;也能使用owa&#xff0c;但是会有告警出现。 要想消除警告信息&…

【转载】locust性能测试3

#codingutf-8 from locust import HttpLocust,TaskSet,task import queue import randomclass test_taskset(TaskSet):taskdef register(self):try:emailself.locust.emailqueue.get() #获取队列里的数据print(email)except queue.Empty: #队列取空后&#xff0c;直接退出p…

基于 WPF + Modern UI 的 公司OA小助手 开发总结

前言&#xff1a; 距离上一篇博客&#xff0c;整整一个月的时间了。人不能懒下来&#xff0c;必须有个阶段性的总结&#xff0c;算是对我这个阶段的一个反思。人只有在总结的过程中才会发现自己的不足。 公司每天都要在OA系统上上班点击签到&#xff0c;下班点击签退&#xff0…

pprof搭配ceph tell命令分析ceph内存

文章目录安装使用使用ceph tell产生堆栈信息文使用pprof工具分析内存及ceph tell释放内存火焰图FlameGraph可视化进程堆栈信息pprof是一个google开发的支持可视化、且可分析profile文件而达到对内存的分析。并且能够输出文本和图像来支持分析过程,pprof源码 安装 可以直接通过…

android jar 电子书下载,【Android】Gradle project sync jar包长时间下载不下来的解决办法...

当我们新建一个Android项目&#xff0c;或者在项目中依赖使用一个新的第三方库时&#xff0c;Android Studio经常会从jcenter或者maven仓库下载jar包&#xff0c;但是我们的网络环境不一定一直那么的顺畅&#xff0c;当网络环境不好&#xff0c;导致有时候jar包好长时间下载不下…

TextField输入结束后让键盘消失的两个技巧

一、点击Return键消失需要调用Did End On Exit事件。- (IBAction) doneEditing:(id) sender { [sender resignFirstResponder];} 当你输入结束后点击Return键&#xff0c;启动Did End On Exit事件。resignFirstResponder会撤消UITextField的第一响应状态。意味着你…

机器学习 决策树 ID3

构造决策树时需要解决的第一个问题是&#xff1a;当前数据集中哪个特征在划分数据分类时起决定性作用。 划分数据集的原则&#xff1a;将无序的数据变得更加有序 信息增益&#xff1a;在划分数据集前后信息发生的变化 获得信息增益最大的特征就是最好的特征 熵&#xff1a;信息…

centos6.5原生系统修改ceph-mon 的ELF来让其加载低版本glibc库函数

文章目录Step 1:glibc-2.17 被libc.so.6库依赖&#xff0c;升级glibc库Step2:升级编译器-->4.8.2可以正常编译glibc2.17Step3:修改ELF&#xff0c;降低ceph-mon依赖的库函数版本解决ceph-mon调用高版本libc库&#xff08;修改动态库链接表ELF&#xff09;Step 1:glibc-2.17 …

如何创建一个基础jQuery插件

如何创建一个基础插件 How to Create a Basic Plugin 有时你想使一块功能性的代码在你代码的任何地方有效.比如,也许你想调用jQuery对象的一个方法,对该对象进行一系列的操作.可能你写了一个真正有用的实用函数,想它能够轻易的移植到其他项目.在这种情况下,你可能想写一个插件.…

rk3399在linux机上烧写img,烧写固件 — TB-96AI documentation

Window主机烧写固件1、安装Windows PC端USB驱动(首次烧写执行)。2、双击DriverAssitant_v4.5DriverInstall.exe打开安装程序&#xff0c;点击“驱动安装”按提示安装驱动即可&#xff0c;安装界面如下所示:3、Type-C线连接主机端的USB接口和RK3399Pro TB-96AI开发板的Type-C接口…

Eclipse,Mycclipse自动补全快捷键设置

为什么80%的码农都做不了架构师&#xff1f;>>> eclipse3.3及以后的版本中中把内容助手(content assist)的快捷键由 alt /改成了ctrl space&#xff0c;这又刚好跟我们操作系统的切换输入法的快捷键冲突&#xff0c;所以造成内容助手不能使用了&#xff0c;给写代…

php 无限极分类

无限极分类1&#xff1a; 1 public function judeg($id)2 {3 $rs Db::name(finance_class) -> field(parent_code) -> where(id,$id) -> select();4 $i 1;5 foreach($rs as $k > $v){6 if($v[parent_code] <> 0){7 $i $this -…

ceph-bluestore-tool基本使用

主要是在bluestore的实例上执行低级管理操作的使用程序,是ceph bluestore的管理工具 命令 help显示帮助信息fsck [--deep]对bluestore元数据进行一致性检查。如果指定了–deep,还要读取所有对象数据并验证校验和repair运行一致性检查 并修复我们可以发生的任何错误bluefs-expo…

Android基础是什么,Android基础概念

android {compileSdkVersion 23buildToolsVersion “23.0.1”defaultConfig {applicationId “com.example.checkyourtargetsdk"minSdkVersion 15targetSdkVersion 23versionCode 1versionName “1.0”}以上是Android工程里名称为app的module的build.gradle文件其中的内容…