使用parted创建分区

2023-05-16

今天在网上查找分区方法,发现都是用的fdisk,但自己使用总是出错,后来请求大神帮忙,发现了一个好用的工具,这里把具体的使用过程记录下来。

[root@pc160 ~]# parted /dev/sda
GNU Parted 3.1
使用 /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
错误: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
确认/OK/放弃/Cancel? ok                                                   
警告: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 1828479744 blocks) or continue with the current setting? 
修正/Fix/忽略/Ignore? fix                                                 
Model: ATA ST1000DM010-2EP1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  标志
 1      1049kB  211MB   210MB   fat16        EFI System Partition  启动
 2      211MB   735MB   524MB   xfs
 3      735MB   64.0GB  63.3GB                                     lvm

(parted) p                                                                
Model: ATA ST1000DM010-2EP1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  标志
 1      1049kB  211MB   210MB   fat16        EFI System Partition  启动
 2      211MB   735MB   524MB   xfs
 3      735MB   64.0GB  63.3GB                                     lvm

(parted) n                                                                
分区编号? 4                                                              
错误: 分区不存在。
(parted) help                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted) mkpart                                                           
分区名称?  []?                                                           
文件系统类型?  [ext2]?                                                   
起始点?                                                                  
起始点?                                                                  
起始点?                                                                  
起始点? oo                                                               
错误: Invalid number.
(parted) free                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted) print free                                                       
Model: ATA ST1000DM010-2EP1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  标志
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  211MB   210MB   fat16        EFI System Partition  启动
 2      211MB   735MB   524MB   xfs
 3      735MB   64.0GB  63.3GB                                     lvm
        64.0GB  1000GB  936GB   Free Space

(parted) mkpart                                                   
分区名称?  []?                                                           
文件系统类型?  [ext2]?                                                   
起始点? 64GB
结束点? 1000GB                                                           
(parted) p                                                                
Model: ATA ST1000DM010-2EP1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  标志
 1      1049kB  211MB   210MB   fat16        EFI System Partition  启动
 2      211MB   735MB   524MB   xfs
 3      735MB   64.0GB  63.3GB                                     lvm
 4      64.0GB  1000GB  936GB

(parted) help                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted)                                                                  
(parted) quit                                                             
信息: You may need to update /etc/fstab.

[root@pc160 ~]# part
parted     partprobe  partx      
[root@pc160 ~]# partprobe 
[root@pc160 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sda:1000.2 GB, 1000204886016 字节,1953525168 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      1435647    500M  Microsoft basic 
 3      1435648    125044735     59G  Linux LVM       
 4    125044736   1953523711  871.9G  Microsoft basic 

磁盘 /dev/mapper/rhel-root:38.2 GB, 38176555008 字节,74563584 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节


磁盘 /dev/mapper/rhel-swap:6404 MB, 6404702208 字节,12509184 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节


磁盘 /dev/mapper/rhel-home:18.6 GB, 18639486976 字节,36405248 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节

[root@pc160 ~]# 
 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用parted创建分区 的相关文章

随机推荐

  • 隐适美invisAlign口扫转诊方式(导出口扫数据+线上问诊)

    下面是我的口扫数据 xff1a https 3dscanner cn cnv2 index html id 61 2cc6205c 其中的id和你个人身份证绑定 进入上述网页后 xff0c 可以点击下面的按钮 xff0c 下载口扫数据 进入
  • UUID无处不在,你就是唯一(2023.4.16)

    六种语言生成UUID 2023 4 16 引言1 UUID简介2 UUID格式和编码3 UUID各历史版本4 UUID代码具体调用实现4 1 C 生成UUID4 2 Java 生成UUID4 3 Python 生成UUID4 4 C 43
  • CMAKE命令和VS属性对照表

    下文中表来自 xff1a https blog csdn net xum2008 article details 7268761 source 61 1 xff0c 仅做记载 Visual Studio CmakeProject Refer
  • python subprocess.Popen()执行耗时过长,不返回响应解决

    记录一下踩过的坑 xff0c 希望碰到此问题的人能看到 xff0c 平时对subprocess Popen 了解不多 xff0c 就用来执行命令 xff0c 都没出现什么问题 xff0c 此次开发中 xff0c 使用subprocess P
  • LiveNVR Onvif/RTSP监控视频平台如何给摄像头视频叠加水印

    介绍 监控视频平台播放视频监控的时候 xff0c 除了满足正常视频播放外 xff0c 有时还需要方便标记或者防盗用等添加视频水印 有些视频在原始摄像头端就可以添加OSD水印 xff0c 这种方式最好 但是有些原始视频没有水印 xff0c 但
  • 使用LiveNVR实现RTSP视频监控、直播推送

    LiveNVR LiveNVR能够通过简单的网络摄像机通道配置 xff0c 将传统监控行业里面的高清网络摄像机IPCamera NVR等具有RTSP Onvif协议输出的设备接入到LiveNVR xff0c LiveNVR能够将这些设备源的
  • 四旋翼飞行器——电调篇

    1 电调的作用 xff1a 电调的作用就是将飞控板的PWM控制信号转变为电流信号 xff0c 以控制电机的转速 因为电机的电流是很大的 xff0c 通常每个电机正常工作时 xff0c 平均有3A左右的电流 xff0c 如果没有电调的存在 x
  • GPS 0183协议GGA、GLL、GSA、GSV、RMC、VTG、ZDA、DTM

    NMEA协议是为了在不同的GPS xff08 全球定位系统 xff09 导航设备中建立统一的BTCM xff08 海事无线电技术委员会 xff09 标准 xff0c 由美国国家海洋电子协会 xff08 NMEA The National M
  • Github的branch是什么

    Github的branch是什么
  • extern C的作用详解

    extern 34 C 34 的主要作用就是为了能够正确实现C 43 43 代码调用其他C语言代码 加上extern 34 C 34 后 xff0c 会指示编译器这部分代码按C语言的进行编译 xff0c 而不是C 43 43 的 由于C 4
  • Linux socket CAN编程示例

    如下所示 xff0c 代码展示了Linux下CAN的发送和接收 xff1a include lt stdio h gt include lt stdlib h gt include lt string h gt include lt uni
  • windows下面安装git

    注意在安装过程中选择override这个选项
  • QT中Map的使用

    Qt中的QMap介绍与使用 xff0c 在坛子里逛了一圈 xff0c 发现在使用QMap中 xff0c 出现过很多的问题 xff0c Map是一个很有用的数据结构 它以 键 值 的形式保存数据 在使用的时候 xff0c 通过提供字符标示 x
  • ubuntu 更新内核切换内核启动

    1 查看需要更新的内核命令 xff1a apt cache search linux 该命令将会显示所有可以获取的内核 2 安装内核 xff0c 假设你要安装的内核为2 6 39 0 xff0c 则使用下面的命令 sudo apt get
  • 多线程实现对同一个或多个文件的读写操作

    程序用途 xff1a 实现多个线程对同一文件的读写操作 程序代码 xff1a test c 该程序在Ubuntu下测试通过 include lt stdio h gt include lt pthread h gt include lt s
  • linux下设置共享目录

    Linux系统的文件或目录的共享功能是非常强大 xff0c 而且是非常灵活的 xff0c 其对权限的控制可以做到非常的细致 xff0c 当然如果你是通过命令行方式进行设置的 话 xff0c 那么对于刚接触linux系统的用户来说将是一件十分
  • shell 数组赋值

    shell编程 xff0c 给数组赋值及两个数组初始化与比较 bin sh output files 61 cat outfiles for i 61 0 i lt output files 64 43 43 i do echo 34 ar
  • vnc的两种配置方法及解决vnc连不上的情况

    1 vnc连不上的现象 xff1a Timed out waiting for a response from the computer 解决方法 xff1a sudo sbin iptables I INPUT 1 p TCP dport
  • linux制作本地镜像

    1 前提条件 xff1a 有安装linux系统的iso 2 添加yum文件 xff1a touch etc yum repos d iso repo iso name 61 CentOS releasever Media baseurl 6
  • 使用parted创建分区

    今天在网上查找分区方法 xff0c 发现都是用的fdisk xff0c 但自己使用总是出错 xff0c 后来请求大神帮忙 xff0c 发现了一个好用的工具 xff0c 这里把具体的使用过程记录下来 root 64 pc160 parted