GPT的磁盘管理

news/2024/4/29 14:42:35

GPT分区工具:gdisk gdisk

gdisk分区

GPT  128个主分区
[root@zutuanxue ~]# gdisk -l /dev/sdc
[root@zutuanxue ~]# gdisk -l /dev/sdc   查看sdc信息
GPT fdisk (gdisk) version 1.0.3
​
Partition table scan:MBR: MBR onlyBSD: not presentAPM: not presentGPT: not present          ###GPT分区无法使用
​
​
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************
​
Disk /dev/sdc: 41943040 sectors, 20.0 GiB
Model: VMware Virtual S
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): B228357D-34EC-4E47-BB81-A7312F3BCF8D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 41943006
Partitions will be aligned on 2048-sector boundaries
Total free space is 37748669 sectors (18.0 GiB)
​
Number  Start (sector)    End (sector)  Size       Code  Name1            2048         2099199   1024.0 MiB  8300  Linux filesystem2         2099200         4196351   1024.0 MiB  8300  Linux filesystem
​
​
​
​
将MBR转换成GPT分区
[root@zutuanxue ~]# gdisk /dev/sdc
GPT fdisk (gdisk) version 1.0.3
​
Partition table scan:MBR: MBR onlyBSD: not presentAPM: not presentGPT: not present
​
​
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
​
​
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
​
Command (? for help): w
​
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
​
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdc.
The operation has completed successfully.
​
​
​
[root@zutuanxue ~]# gdisk -l /dev/sdc
GPT fdisk (gdisk) version 1.0.3
​
Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: present          ###GPT可用了
​
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 41943040 sectors, 20.0 GiB
Model: VMware Virtual S
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 7CA4232A-4A9E-467D-AADD-BB84DB2126E3
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 41943006
Partitions will be aligned on 2048-sector boundaries
Total free space is 41942973 sectors (20.0 GiB)
​
Number  Start (sector)    End (sector)  Size       Code  Name
​
​
​
#再次分区
[root@zutuanxue ~]# gdisk /dev/sdc
GPT fdisk (gdisk) version 1.0.3
​
Partition table scan:MBR: protectiveBSD: not presentAPM: not presentGPT: present
​
Found valid GPT with protective MBR; using GPT.
​
Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-41943006, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-41943006, default = 41943006) or {+-}size{KMGTP}: +2G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 
Changed type of partition to 'Linux filesystem'
​
Command (? for help): p
Disk /dev/sdc: 41943040 sectors, 20.0 GiB
Model: VMware Virtual S
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 7CA4232A-4A9E-467D-AADD-BB84DB2126E3
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 41943006
Partitions will be aligned on 2048-sector boundaries
Total free space is 37748669 sectors (18.0 GiB)
​
Number  Start (sector)    End (sector)  Size       Code  Name1            2048         4196351   2.0 GiB     8300  Linux filesystem
Command (? for help): w
​
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
​
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdc.
The operation has completed successfully.
​
​
[root@zutuanxue ~]# partprobe /dev/sdc
​
2.创建文件系统(格式化)CentOS8默认使用xfs
[root@zutuanxue ~]# mkfs.xfs -f /dev/sdc1
​
​
3.挂载
[root@zutuanxue ~]# mkdir /disk1
[root@zutuanxue ~]# mount -t xfs -o ro /dev/sdc1 /disk1     //手动挂载
[root@zutuanxue ~]# umount /disk1       ##卸载

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.cpky.cn/p/10394.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

安全防御第七次作业

拓扑图如图所示: 问题:在FW7和FW8之间建立一条IPSEC通道保证10.0.2.0/24网段 可以正常访问到192.168.1.0/24 注:基础配置我在此省略了 一、NAT配置 FW4: FW6: 二、在FW4上做服务器映射 三、配置IPSEC FW5&#xff…

SanctuaryAI推出Phoenix: 专为工作而设计的人形通用机器人

文章目录 1. Company2. Main2.1 关于凤凰™ (Phoenix)2.2 关于碳™(Carbon)2.3 商业化部署2.4 关于 Sanctuary Corporation 3. My thoughtsReference彩蛋a. 将手机变为桌面小机器人b. 指尖触觉传感器 唯一入选《时代》杂志 2023 年最佳发明的通用机器人。 称机器人自主做家务的…

2024蓝桥杯每日一题(贡献法)

一、第一题:孤独的照片 解题思路:贡献法乘法原理 预处理出眉头牛其左右两边不同的牛的数量,然后考虑怎么算就可以 【Python程序代码】 n int(input()) s input() l,r [0]*(n5),[0]*(n5) g,h 0,0 for i in range(n):if s[i]G:l[…

基于SpringBoot的联通积分商城数据运营系统设计与实现

目 录 摘 要 I Abstract II 引 言 1 1 研究背景 3 1.1 项目背景及意义 3 1.2 国内外现状 3 1.3本章小节 4 2 系统分析 5 2.1 需求分析 5 2.2 主要功能模块 5 2.3 数据库设计 6 2.4 本章小节 10 3 关键技术 11 3.1 开发语言 11 3.2 SpringBoot框架 12 3.3 开发模式 14 3.4 本章…

NLP:文本相似度计算

前面我们已经实现了把长段的句子,利用HanLP拆分成足够精炼的分词,后面我们要实现“联想”功能,我这里初步只能想到通过文本相似度计算来实现。下面介绍一下文本相似度计算 (当然HanLP也有文本相似度计算的方法,这里我…

微信小程序-分包

分包 1.什么是分包 分包指的是把一个完整的小程序项目,按照需求划分为不同的子包,在构建时打包成不同的分包,用户在使用时按需进行加载。 2.分包的好处 对小程序进行分包的好处主要有以下两点: 可以优化小程序首次启动的下载时间…