精华内容
下载资源
问答
  • 磁盘分区-gdisk用法,磁盘分区-gdisk
    2021-05-16 17:33:34

    磁盘分区-gdisk用法,磁盘分区-gdisk

    gdisk用法

    gdisk-InteractiveGUIDpartitiontable(GPT)manipulator

    GPTfdisk(akagdisk)isatext-modemenu-drivenprogramforcreationandmanipulation

    ofpartitiontables.

    1使用gdisk的原因

    (1)由于fdisk命令不能很好的支持GPT分区

    [root@local ~]# fdisk /dev/sdb

    WARNING: fdiskGPTsupportiscurrentlynew, andthereforeinanexperimentalphase. Useatyourowndiscretion.

    Welcometofdisk (util-linux 2.23.2).

    Changeswillremaininmemoryonly, untilyoudecidetowritethem.

    Becarefulbeforeusingthewritecommand.

    Command (mforhelp):

    而MBR分区不支持大于2T的分区,所有对于现在打的硬盘分区来说只能使用GPT分区,所以就要使用gdisk命令

    (2)gdisk也可以处理MBR分区的硬盘,不管你硬盘多大,都不在话下。

    2用gdisk对硬盘就行分区,这里以vmware虚拟机为例

    (1)查看为分区之前的磁盘信息,这里以/dev/sdc为例

    [root@local ~]# gdisk -l /dev/sdd

    GPT fdisk (gdisk) version 0.8.6

    Partition table scan:

    MBR: not present

    BSD: not present

    APM: not present

    GPT: not present

    Creating new GPT entries.

    Disk /dev/sdd: 10485760 sectors, 5.0 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 5ECA06B5-A105-4DCB-B6DD-96A13D0C1A93

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 10485726

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 10485693 sectors (5.0 GiB)

    Number Start (sector) End (sector) Size Code Name

    当然也可用fdis命令查看

    [root@local ~]# fdisk -l /dev/sdc

    Disk /dev/sdc: 5368 MB, 5368709120 bytes, 10485760 sectors

    Units = sectors of 1 * 512 = 512 bytes

    Sector size (logical/physical): 512 bytes / 512 bytes

    I/O size (minimum/optimal): 512 bytes / 512 bytes

    (2)gdisk命令对磁盘进行操作

    [root@local ~]# gdisk /dev/sdc

    GPTfdisk (gdisk) version 0.8.6

    Partitiontablescan:

    MBR: notpresent

    BSD: notpresent

    APM: notpresent

    GPT: notpresent

    CreatingnewGPTentries.

    Command (? forhelp):

    (3)根据提示,输入?获得帮助

    Command (? forhelp): ?

    b backupGPTdatatoafile

    c changeapartition'sname

    d deleteapartition #删除分区

    i showdetailedinformationonapartition

    l listknownpartitiontypes #列出分区类型

    n addanewpartition #添加新分区

    o createanewemptyGUIDpartitiontable (GPT)

    p printthepartitiontable #打印分区列表

    q quitwithoutsavingchanges #不保存退出

    r recoveryandtransformationoptions (expertsonly)

    s sortpartitions

    t changeapartition'stypecode #修改分区类型

    v verifydisk

    w writetabletodiskandexit #保存退出

    x extrafunctionality (expertsonly)

    ? printthismenu

    (4)添加一个新分区

    Command (? forhelp): n

    Partitionnumber (1-128, default 1): 1 #输入分区编号,默认为1,因为是/dev/sdc硬盘的第一块分区。

    Firstsector (34-10485726, default = 2048) or {+-}size{KMGTP}: #输入扇区的开始位置,选择默认即可,也可手动指定。

    Lastsector (2048-10485726, default = 10485726) or {+-}size{KMGTP}:+2G #输入扇区的结束位置,当然一般都是指定磁盘大小,这里输入+2G表示新分区大小为2G。

    Currenttypeis 'Linuxfilesystem'

    HexcodeorGUID (Ltoshowcodes, Enter = 8300): #指定文件系统,默认即可,分区完成后可以修改。

    Changedtypeofpartitionto 'Linuxfilesystem'

    (5)查看分区后的分区列表

    Command (? forhelp): p #查看分区列表

    Disk /dev/sdc: 10485760 sectors, 5.0 GiB

    Logicalsectorsize: 512 bytes

    Diskidentifier (GUID): 428D4D72-0C16-4AD6-80A3-7BCACED6F40C

    Partitiontableholdsupto 128 entries

    Firstusablesectoris 34, lastusablesectoris 10485726

    Partitionswillbealignedon 2048-sectorboundaries

    Totalfreespaceis 6291389 sectors (3.0 GiB)

    NumberStart (sector) End (sector) SizeCodeName

    1 2048 4196351 2.0 GiB 8300 Linuxfilesystem #看到分区已经添加成功

    (6)保存分区并退出

    Command (? forhelp):w

    Finalcheckscomplete. AbouttowriteGPTdata. THISWILLOVERWRITEEXISTING

    PARTITIONS!!

    Doyouwanttoproceed? (Y/N): y

    OK; writingnewGUIDpartitiontable (GPT) to /dev/sdc.

    Theoperationhascompletedsuccessfully.

    可以看到分区以添加成功

    3创建文件系统

    [root@local ~]# mkfs.xfs /dev/sdc1

    meta-data=/dev/sdc1 isize=512 agcount=4, agsize=131072 blks

    = sectsz=512 attr=2, projid32bit=1

    = crc=1 finobt=0, sparse=0

    data = bsize=4096 blocks=524288, imaxpct=25

    = sunit=0 swidth=0 blks

    naming =version 2 bsize=4096 ascii-ci=0 ftype=1

    log =internal log bsize=4096 blocks=2560, version=2

    = sectsz=512 sunit=0 blks, lazy-count=1

    realtime =none extsz=4096 blocks=0, rtextents=0

    到此分区、文件系统创建成功,通过挂载就可以使用磁盘了

    http://www.dengb.com/Linuxjc/1213081.htmlwww.dengb.comtruehttp://www.dengb.com/Linuxjc/1213081.htmlTechArticle磁盘分区-gdisk用法,磁盘分区-gdisk gdisk 用法 gdisk - InteractiveGUIDpartitiontable ( GPT ) manipulator GPTfdisk ( akagdisk ) isatext - modemenu - drivenprogramforcrea...

    更多相关内容
  • gdisk 是一个命令界面的用于创建和操作分区表的工具。 它会自动将MBR分区表转换为较新的GPT分区表格式,或者加载GUID分区表。 与-l命令行选项一起使用时,程序将显示当前分区表。 语法格式:gdisk [参数] 常用参数...
  • CentOS yum源挂了,留个根,以备用得着的人可以下载......希望对大家有用啊 可以用于磁盘各种骚操作
  • gDisk-开源

    2021-05-30 08:27:38
    gDisk 是一款可以将您的 GMail 帐户变成便携式硬盘的软件,因此您可以随时通过 Internet 访问您的重要文件。
  • Android上的gdisk

    2020-04-12 12:23:27
    Android上的gdisk,主要使用场景为gpt保护的分区类型,Android5以后均如此,除非是从旧设备升级过来
  • 苹果 macOS 下的 gdisk 命令。跟 Linux 下的 gdisk 命令一样,以命令行方式编辑和调整GPT磁盘分区。
  • gdisk-windows-1.0.1

    2018-06-22 22:58:32
    gdisk -l /dev/sdX 查看分区信息 gdisk (?|m) 帮助 n 建立分区 d 删除分区 c 更改分区名字  I 显示分区的详细信息 p 显示分区信息 t转换分区类型 a 将指定分区设置/取消 活动分区 l 查看分区...
  • gdisk-1.0.3-8.el8.x86_64.rpm

    2021-12-23 00:51:52
    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
  • 离线安装包,亲测可用
  • gdisk

    2008-04-05 22:57:56
    很好用的DOS下分区工具,创建,删除,格式化,大于32G的FAT32分区.
  • gdisk分区命令

    2021-05-09 07:38:35
    GPT fdisk(由gdisk、cgdisk、sgdisk和fixparts程序组成)是一组用于Linux、FreeBSD、Mac OS X和Windows的文本模式分区工具。gdisk、cgdisk和sgdisk程序在全局惟一标识符(GUID)分区表(GPT)磁盘上工作,而不是在旧的(也...

    GPT fdisk(由gdisk、cgdisk、sgdisk和fixparts程序组成)是一组用于Linux、FreeBSD、Mac OS X和Windows的文本模式分区工具。gdisk、cgdisk和sgdisk程序在全局惟一标识符(GUID)分区表(GPT)磁盘上工作,而不是在旧的(也是最常见的)主引导记录(MBR)分区表上工作。fixparts程序修复MBR磁盘的某些类型的损坏,并允许将分区类型从主分区更改为逻辑分区,反之亦然。这个命令用来对GPT分区进行操作,请不要在MBR分区上操作,先通过parted /dev/sdb print 命令查看分区表的类型(/dev/sdb换成要操作的磁盘)。

    现在大部分发行版都默认自带了gdisk,如果没有自带自行安装,CentOS7-1810、Debian9.5搜索软件gdisk安装,openSUSE15搜索gptfdisk 安装

    一、gdisk参数使用方法:

    # gdisk 设备名

    使用这个命令前应该先用lsblk命令查看系统上可用的磁盘,因为这个命令不能查看系统上可用的磁盘有那些。

    -----------------------------------------------

    root@debian:~# gdisk /dev/sdc            #对/dev/sdc进行分区

    GPT fdisk (gdisk) version 1.0.1            #GPT fdisk版本

    Partition table scan:                  #分区表扫描:

    MBR: not present                 #MBR:不存在

    BSD: not present                  #BSD:不存在

    APM: not present                 #APM:不存在

    GPT: not present                  #GPT:不存在

    Creating new GPT entries.             #创建新的GPT条目

    Command (? for help): ?                 #输入?号查看可用的指令

    b  back up GPT data to a file                       #将GPT数据备份到文件中

    c  change a partition's name                     #更改分区的名称

    d  delete a partition                         #删除分区

    i  show detailed information on a partition         #将显示分区的详细信息

    l  list known partition types                   #列出已知的分区类型

    n  add a new partition                  #添加一个新的分区

    o  create a new empty GUID partition table (GPT)       #创建一个新的空GUID分区表(GPT)

    p  print the partition table                  #打印分区表

    q  quit without saving changes               #不保存更改就退出

    r  recovery and transformation options (experts only)      #恢复和转换选项(仅限专家使用)

    s  sort partitions                      #分类分区

    t  change a partition's type code                 #更改分区的类型

    v  verify disk                       #验证磁盘

    w  write table to disk and exit                   #将表写入磁盘并退出

    x  extra functionality (experts only)           #额外功能(仅限专家使用)

    ?  print this menu                   #查看可用的指令

    Command (? for help):

    二、gdisk交互模式磁盘分区

    1、新建分区

    root@debian:~# gdisk /dev/sdc       #对磁盘/dev/sdc进行分区

    GPT fdisk (gdisk) version 1.0.1                               #GPT fdisk版本

    Partition table scan:

    MBR: not present

    BSD: not present

    APM: not present

    GPT: not present

    Creating new GPT entries.           #自动创建GPT分区表

    Command (? for help): n              #输入n新建分区,默认已经创建了分区表

    Partition number (1-128, default 1):     #输入分区号,直接回车就行,默认为1

    First sector (34-10485726, default = 2048) or {+-}size{KMGTP}:       #输入起始扇区,直接回车就行,默认2048最前面开始

    Last sector (2048-10485726, default = 10485726) or {+-}size{KMGTP}: +1G          #这里输入新增分区的大小可以通过扇区数来增加,也可以通过+size{KMGTP}方式来增加,这里要增加1G的容量就表示为+1G

    Current type is 'Linux filesystem'

    Hex code or GUID (L to show codes, Enter = 8300):               #这里要求输入分区的类型,直接回车就行,也可以输入l回车查看所有分区的类型

    Changed type of partition to 'Linux filesystem'

    2、查看剩余可用的空间等信息

    Command (? for help): p                     #输入p查看创建的分区

    Disk /dev/sdc: 10485760 sectors, 5.0 GiB         #磁盘总容量

    Logical sector size: 512 bytes

    Disk identifier (GUID): AC08E842-007B-4604-9545-B0BFF427F928 #分区类型为GPT

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 10485726

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 8388541 sectors (4.0 GiB)          #磁盘可用剩余空间

    Number    Start (sector)   End (sector)    Size      Code    Name

    1        2048       2099199    1024.0 MiB   8300    Linux filesystem        #已经创建的分区

    3、删除分区

    Command (? for help): d        #输入d删除分区

    Partition number (1-2): 2       #删除分区2

    4、修改分区类型

    Command (? for help):  l

    #回车可以查看更多的信息,其中8200为Linux swap分区、8300为Linux分区、8e00为LinuxLVM分区

    Command (? for help): t        #输入t更改分区类型,这里输入l也可以查看分区的类型

    Partition number (1-2): 2      #输入要更改的分区

    Current type is 'Linux filesystem'

    Hex code or GUID (L to show codes, Enter = 8300): 8e00     #输入分区类型的编号

    Changed type of partition to 'Linux LVM'               #更改成功

    Command (? for help): p

    Disk /dev/sdc: 10485760 sectors, 5.0 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 170FC283-67F2-4188-A687-6882B68F3C3C

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 10485726

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 8388540 sectors (4.0 GiB)

    Number    Start (sector)    End (sector)    Size        Code    Name

    1        2048       2099199     1024.0 MiB    8300    Linux filesystem

    2        2099200      2099200      512 bytes       8E00    Linux LVM       #更改成功

    Command (? for help):

    5、保存修改的结果

    Command (? for help): w          #输入w保存配置,如果不想保存可以输入q退出

    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

    PARTITIONS!!

    Do you want to proceed? (Y/N): y              #问你是否相想继续,输入y继续

    OK; writing new GUID partition table (GPT) to /dev/sdc.

    The operation has completed successfully.         #写入成功

    root@debian:~#

    展开全文
  • gdisk-windows

    2015-09-10 15:48:02
    windows下gdisk工具,可以恢复gpt分区。如果mac系统安装windows后重新分区引起异常。可以使用此方法重新还原分区。
  • gdisk进行磁盘扩展

    2021-11-19 17:19:12
    GPT fdisk(由gdisk、cgdisk、sgdisk和fixparts程序组成)是一组用于Linux、FreeBSD、Mac OS X和Windows的文本模式分区工具。gdisk、cgdisk和sgdisk程序在全局惟一标识符(GUID)分区表(GPT)磁盘上工作,而不是在旧的(也...

    前言

    GPT fdisk(由gdisk、cgdisk、sgdisk和fixparts程序组成)是一组用于Linux、FreeBSD、Mac OS X和Windows的文本模式分区工具。gdisk、cgdisk和sgdisk程序在全局惟一标识符(GUID)分区表(GPT)磁盘上工作,而不是在旧的(也是最常见的)主引导记录(MBR)分区表上工作。fixparts程序修复MBR磁盘的某些类型的损坏,并允许将分区类型从主分区更改为逻辑分区,反之亦然。这个命令用来对GPT分区进行操作,请不要在MBR分区上操作。
    

    gdisk单独挂在新目录

    # gdisk 设备名
    使用这个命令前应该先用lsblk命令查看系统上可用的磁盘,因为这个命令不能查看系统上可用的磁盘有那些。
    -----------------------------------------------
    root@debian:~# gdisk /dev/sdb            #对/dev/sdb进行分区
    GPT fdisk (gdisk) version 1.0.1          #GPT fdisk版本
    
    Partition table scan:                 #分区表扫描:
    MBR: not present                     #MBR:不存在
    BSD: not present                     #BSD:不存在
    APM: not present                     #APM:不存在
    GPT: not present                     #GPT:不存在
    
    Creating new GPT entries.              #创建新的GPT条目
    
    Command (? for help): ?                #输入?号查看可用的指令
    b   back up GPT data to a file          #将GPT数据备份到文件中
    c   change a partition's name           #更改分区的名称
    d   delete a partition               #删除分区
    i   show detailed information on a partition #将显示分区的详细信息
    l   list known partition types           #列出已知的分区类型
    n   add a new partition               #添加一个新的分区
    o   create a new empty GUID partition table (GPT)       #创建一个新的空GUID分区表(GPT)
    p   print the partition table                  #打印分区表
    q   quit without saving changes               #不保存更改就退出
    r   recovery and transformation options (experts only)      #恢复和转换选项(仅限专家使用)
    s   sort partitions                      #分类分区
    t   change a partition's type code           #更改分区的类型
    v   verify disk                       #验证磁盘
    w   write table to disk and exit            #将表写入磁盘并退出
    x   extra functionality (experts only)       #额外功能(仅限专家使用)
    ?   print this menu                   #查看可用的指令
    

    新建分区

    root@debian:~# gdisk /dev/sdb      #对磁盘/dev/sdc进行分区
    GPT fdisk (gdisk) version 1.0.1                               #GPT fdisk版本
    
    Partition table scan:
    MBR: not present            
    BSD: not present
    APM: not present
    GPT: not present
    
    Creating new GPT entries.           #自动创建GPT分区表
    
    Command (? for help): n              #输入n新建分区,默认已经创建了分区表
    Partition number (1-128, default 1):     #输入分区号,直接回车就行,默认为1
    First sector (34-10485726, default = 2048) or {+-}size{KMGTP}:       #输入起始扇区,直接回车就行,默认2048最前面开始
    Last sector (2048-10485726, default = 10485726) or {+-}size{KMGTP}:           #这里输入新增分区的大小可以通过扇区数来增加,也可以通过+size{KMGTP}方式来增加,这边默认全部扩展
    Current type is 'Linux filesystem'
    Hex code or GUID (L to show codes, Enter = 8300):  L             #这里要求输入分区的类型,直接回车也行,也可以输入l回车查看所有分区的类型
    #回车可以查看更多的信息,其中8200为Linux swap分区、8300为Linux分区、8e00为LinuxLVM分区
    Hex code or GUID (L to show codes, Enter = 8300):  8e00
    Changed type of partition to 'Linux LVM'
    

    查看分区

    Command (? for help): p                     #输入p查看创建的分区
    Disk /dev/sdb: 6442450944 sectors, 3.0 TiB         #磁盘总容量
    Logical sector size: 512 bytes
    Disk identifier (GUID): BF232D8C-FFF6-4313-94F3-72FF187CE468   #分区类型为gpt
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 6442450910
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2014 sectors (1007.0 KiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048      6442450910   3.0 TiB     8E00  Linux LVM     
    
    
    
    Command (? for help): w                         #输入w保存配置,如果不想保存可以输入q退出
    
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    
    Do you want to proceed? (Y/N): y                #问你是否相想继续,输入y继续
    OK; writing new GUID partition table (GPT) to /dev/sdb.
    The operation has completed successfully.       #写入成功
    

    gdisk -l /dev/sdb命令查看

    创建物理卷-卷组-逻辑卷

    其他操作

    更改分区名称
    
    Command (? for help): c                             #输入c更改分区名称
    Partition number (1-2): 2                            #输入要更改的分区
    Enter name: pv1 LVM                                    #输入更改后的名称
    
     
    
    Command (? for help): p
    Disk /dev/sdc: 10485760 sectors, 5.0 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 170FC283-67F2-4188-A687-6882B68F3C3C
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 10485726
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 8388540 sectors (4.0 GiB)
    
     
    
    Number    Start (sector)   End (sector)    Size      Code    Name
    1       2048        2099199     1024.0 MiB   8300    Linux filesystem
    2       2099200       2099200      512 bytes     8E00    pv1 LVM                       #分区名称已经更改
    
    
    删除分区
    
    Command (? for help): d        #输入d删除分区
    Partition number (1-2): 2       #删除分区2
    

    gdisk增加磁盘空间

    如图所示,/dev/vdb磁盘已使用2T,还剩余1000G,现需将1000G磁盘空间扩容到现有的卷组中
    

    gdisk /dev/vdb
    依次输入参数 ?  n  8e00 p w y
    

    [root@iZm5e1xptiqc7sk28pyigaZ opt]# partprobe  /dev/vdb
    
    [root@iZm5e1xptiqc7sk28pyigaZ opt]# pvcreate /dev/vdb2
      Physical volume "/dev/vdb2" successfully created.
      
    [root@iZm5e1xptiqc7sk28pyigaZ opt]# vgextend vg_opt /dev/vdb2
      Volume group "vg_opt" successfully extended
      
    [root@iZm5e1xptiqc7sk28pyigaZ opt]# lvextend -l +100%FREE /dev/mapper/vg_opt-lv_opt
      Size of logical volume vg_opt/lv_opt changed from 1.95 TiB (511999 extents) to <2.93 TiB (767998 extents).
      Logical volume vg_opt/lv_opt successfully resized.
      
    [root@iZm5e1xptiqc7sk28pyigaZ opt]# xfs_growfs /dev/mapper/vg_opt-lv_opt
    
    [root@iZm5e1xptiqc7sk28pyigaZ opt]# df -h
    Filesystem                 Size  Used Avail Use% Mounted on
    devtmpfs                   234M     0  234M   0% /dev
    tmpfs                      244M     0  244M   0% /dev/shm
    tmpfs                      244M  480K  243M   1% /run
    tmpfs                      244M     0  244M   0% /sys/fs/cgroup
    /dev/vda1                   40G  2.2G   36G   6% /
    tmpfs                       49M     0   49M   0% /run/user/0
    /dev/mapper/vg_opt-lv_opt  3.0T   33M  3.0T   1% /opt
    
    展开全文
  • gdisk_sd (1).rar

    2014-07-30 07:21:54
    SD分区格式化,非常实用的一款软件
  • : 打印gdisk下命令的用法 p: 查看分区表 b: 备份分区表,以便后面操作失误可以恢复分区表 [root@tanghuimin ~]# gdisk /dev/sda GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: protective BSD: not ...

    主机:CentOS release 6.4 (Final)

    目的:从/home分区分出100G来创建新分区/vm

    1. 查看当前分区情况

    [root@tanghuimin /]# df -Th

    Filesystem Type Size Used Avail Use% Mounted on

    /dev/sda3 ext4 9.7G 6.6G 2.6G 72% /

    tmpfs tmpfs 1.8G 280K 1.8G 1% /dev/shm

    /dev/sda1 ext4 426G 37G 368G 10% /home

    /dev/sda2 ext4 20G 4.2G 15G 23% /opt

    /home分区在/dev/sda1.

    2. gdisk /dev/sda

    ?: 打印gdisk下命令的用法

    p: 查看分区表

    b: 备份分区表,以便后面操作失误可以恢复分区表

    [root@tanghuimin ~]# gdisk /dev/sda

    GPT fdisk (gdisk) version 0.8.10

    Partition table scan:

    MBR: protective

    BSD: not present

    APM: not present

    GPT: present

    Found valid GPT with protective MBR; using GPT.

    Command (? for help): ?

    b back up GPT data to a file

    c change a partition's name

    d delete a partition

    i show detailed information on a partition

    l list known partition types

    n add a new partition

    o create a new empty GUID partition table (GPT)

    p print the partition table

    q quit without saving changes

    r recovery and transformation options (experts only)

    s sort partitions

    t change a partition's type code

    v verify disk

    w write table to disk and exit

    x extra functionality (experts only)

    ? print this menu

    Command (? for help): p

    Disk /dev/sda: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): FB42D8BC-9B54-4B3B-A16C-A39A39B902FF

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 976773134

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 2029 sectors (1014.5 KiB)

    Number Start (sector) End (sector) Size Code Name

    1 2048 907141119 432.6 GiB 0700

    2 907141120 948101119 19.5 GiB 0700

    3 948101120 968581119 9.8 GiB EF00

    4 968581120 976773119 3.9 GiB 8200

    Command (? for help): b

    Enter backup filename to save: /root/gpt.sda.bak

    The operation has completed successfully.

    3. 卸载即将被调整的分区/home

    [root@tanghuimin ~]# umount /home/

    [root@tanghuimin ~]# df -Th

    Filesystem Type Size Used Avail Use% Mounted on

    /dev/sda3 ext4 9.7G 6.6G 2.6G 72% /

    tmpfs tmpfs 1.8G 296K 1.8G 1% /dev/shm

    /dev/sda2 ext4 20G 4.2G 15G 23% /opt

    4. 检测文件系统错误

    [root@tanghuimin ~]# e2fsck -f /dev/sda1

    e2fsck 1.41.12 (17-May-2010)

    Pass 1: Checking inodes, blocks, and sizes

    Pass 2: Checking directory structure

    Pass 3: Checking directory connectivity

    Pass 4: Checking reference counts

    Pass 5: Checking group summary information

    /dev/sda1: 268432/28352512 files (0.1% non-contiguous), 11359488/113392384 blocks

    5. 用resize2fs调整文件系统大小

    [root@tanghuimin ~]# resize2fs /dev/sda1 326G

    resize2fs 1.41.12 (17-May-2010)

    Resizing the filesystem on /dev/sda1 to 85458944 (4k) blocks.

    The filesystem on /dev/sda1 is now 85458944 blocks long.

    6. 用gdisk调整分区大小,先用d删除分区,后用n创建分区

    [root@tanghuimin ~]# gdisk /dev/sda

    GPT fdisk (gdisk) version 0.8.10

    Partition table scan:

    MBR: protective

    BSD: not present

    APM: not present

    GPT: present

    Found valid GPT with protective MBR; using GPT.

    Command (? for help): p

    Disk /dev/sda: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): FB42D8BC-9B54-4B3B-A16C-A39A39B902FF

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 976773134

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 2029 sectors (1014.5 KiB)

    Number Start (sector) End (sector) Size Code Name

    1 2048 907141119 432.6 GiB 0700

    2 907141120 948101119 19.5 GiB 0700

    3 948101120 968581119 9.8 GiB EF00

    4 968581120 976773119 3.9 GiB 8200

    Command (? for help): d

    Partition number (1-4): 1

    Command (? for help): p

    Disk /dev/sda: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): FB42D8BC-9B54-4B3B-A16C-A39A39B902FF

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 976773134

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 907141101 sectors (432.6 GiB)

    Number Start (sector) End (sector) Size Code Name

    2 907141120 948101119 19.5 GiB 0700

    3 948101120 968581119 9.8 GiB EF00

    4 968581120 976773119 3.9 GiB 8200

    Command (? for help): n

    Partition number (1-128, default 1):

    First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:

    Last sector (2048-907141119, default = 907141119) or {+-}size{KMGTP}: 326G

    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): 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/sda.

    Warning: The kernel is still using the old partition table.

    The new table will be used at the next reboot.

    The operation has completed successfully.

    分区大小调整完毕。

    7. 将/dev/sda1挂载到/home

    [root@tanghuimin ~]# df -Th

    Filesystem Type Size Used Avail Use% Mounted on

    /dev/sda3 ext4 9.7G 6.6G 2.6G 72% /

    tmpfs tmpfs 1.8G 296K 1.8G 1% /dev/shm

    /dev/sda2 ext4 20G 4.2G 15G 23% /opt

    [root@tanghuimin ~]# mount /dev/sda1 /home/

    [root@tanghuimin ~]# df -Th

    Filesystem Type Size Used Avail Use% Mounted on

    /dev/sda3 ext4 9.7G 6.6G 2.6G 72% /

    tmpfs tmpfs 1.8G 296K 1.8G 1% /dev/shm

    /dev/sda2 ext4 20G 4.2G 15G 23% /opt

    /dev/sda1 ext4 321G 37G 269G 12% /home

    reboot.

    8. 在/dev/sda所有free的空间上创建新分区

    [root@tanghuimin ~]# gdisk /dev/sda

    GPT fdisk (gdisk) version 0.8.10

    Partition table scan:

    MBR: protective

    BSD: not present

    APM: not present

    GPT: present

    Found valid GPT with protective MBR; using GPT.

    Command (? for help): p

    Disk /dev/sda: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): FB42D8BC-9B54-4B3B-A16C-A39A39B902FF

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 976773134

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 221374444 sectors (105.6 GiB)

    Number Start (sector) End (sector) Size Code Name

    1 2048 685768704 327.0 GiB 8300 Linux filesystem

    2 907141120 948101119 19.5 GiB 0700

    3 948101120 968581119 9.8 GiB EF00

    4 968581120 976773119 3.9 GiB 8200

    Command (? for help): n

    Partition number (5-128, default 5):

    First sector (34-976773134, default = 685770752) or {+-}size{KMGTP}:

    Last sector (685770752-907141119, default = 907141119) or {+-}size{KMGTP}:

    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): 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/sda.

    Warning: The kernel is still using the old partition table.

    The new table will be used at the next reboot.

    The operation has completed successfully.

    9. 将新分区的文件系统类型设为ext4

    [root@tanghuimin ~]# mkfs -t ext4 /dev/sda5

    mke2fs 1.41.12 (17-May-2010)

    Filesystem label=

    OS type: Linux

    Block size=4096 (log=2)

    Fragment size=4096 (log=2)

    Stride=1 blocks, Stripe width=0 blocks

    6922240 inodes, 27671296 blocks

    1383564 blocks (5.00%) reserved for the super user

    First data block=0

    Maximum filesystem blocks=4294967296

    845 block groups

    32768 blocks per group, 32768 fragments per group

    8192 inodes per group

    Superblock backups stored on blocks:

    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

    4096000, 7962624, 11239424, 20480000, 23887872

    Writing inode tables: done

    Creating journal (32768 blocks): done

    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 33 mounts or

    180 days, whichever comes first. Use tune2fs -c or -i to override.

    10. 将新分区/dev/sda5挂载到/vm

    [root@tanghuimin ~]# mount /dev/sda5 /vm

    [root@tanghuimin ~]# df -Th

    Filesystem Type Size Used Avail Use% Mounted on

    /dev/sda3 ext4 9.7G 6.6G 2.6G 72% /

    tmpfs tmpfs 1.8G 224K 1.8G 1% /dev/shm

    /dev/sda1 ext4 321G 37G 269G 12% /home

    /dev/sda2 ext4 20G 4.2G 15G 23% /opt

    /dev/sda5 ext4 104G 188M 99G 1% /vm

    11. 在/etc/fstab中添加如下行,使在系统启动时/dev/sda5被挂载到/vm

    /dev/sda5 /vm ext4 defaults 1 2

    reboot.

    展开全文
  • 磁盘分区-gdisk用法

    千次阅读 2021-05-16 17:33:36
    gdisk用法gdisk-InteractiveGUIDpartitiontable(GPT)manipulatorGPTfdisk(akagdisk)isatext-modemenu-drivenprogramforcreationandmanipulationofpartitiontables.1使用gdisk的原因(1)由于fdisk命令不能很好的支持...
  • Linux命令之gdisk详解

    2021-05-09 07:38:10
    gdisk -l [设备]gdisk又叫GPT fdisk,算是fdisk的延伸吧,主要使用的是GPT分区类型,用来划分容量大于2T的硬盘。扩展1:分区类型GPT和MBR。GPT最大支持18EB(1EB=1024PB,1PB=1024TB),MBR最大支持2TB。扩展2(了解):...
  • Linux命令之gdisk

    2021-03-06 23:34:56
    gdisk -l [设备]  gdisk又叫GPT fdisk,算是fdisk的延伸吧,主要使用的是GPT分区类型,用来划分容量大于2T的硬盘。  扩展1:分区类型GPT和MBR。GPT最大支持18EB(1EB=1024PB,1PB=1024TB),MBR最大支持2TB。 ...
  • linux磁盘扩容 gdisk

    2020-12-17 14:38:38
    fdisk和gdisk用法大同小异,gdisk换成fdisk即可 首先查看硬盘空间使用率 df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 9.0T 6.8T 2.3T 76% / devtmpfs 16G 0 16G 0% /dev tmpfs 16G 0...
  • GPT Disk (gdisk.exe)是一个全面支持 GPT/MBR 磁盘的管理工具、支持GPT 或者 MBR 分区操作,是命令行工具,程序740KB, 原本是 UNIX 操作系统下的工具,现在发布了支持 Windows 操作系统的版本。内附一个俄国网站下载...
  • 磁盘分区--fdisk/gdisk

    2021-08-19 13:50:19
    fdisk分区 1、列出磁盘分区情况 fdisk -l 列出所有 fdisk -l /dev/sdb 列出某一块磁盘 [root@docker ~]# fdisk -l /dev/sdb 磁盘 /dev/sdb:10.7 GB, 10737418240 字节,20971520 个扇区 Units = 扇区 of 1 * 512 =...
  • gdisk 磁盘分区工具 gdisk主要是用来划分容量大于2T的硬盘,大于2T fdisk搞不定 两种类型的分区表:GPT和MBR ; MBR不支持4T以上 GPT分区:GPT,全局唯一标识分区表(GUID Partition Table),它使用128位GUID来唯一...
  • gdisk32磁盘分区

    2012-04-03 08:32:40
    gdisk32磁盘分区工具详细的资源描述有机会获得我们的推荐,更有利于他人下载,赚取更多积分
  • # gdisk /dev/vdb GPT fdisk (gdisk) version 0.8.6 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Command (? for help): p Disk /dev/...
  • 当我们给系统添加一块新硬盘时,我们是无法使用的,因为他还没有分区和格式化,只有当我们将新硬盘分区并格式化之后,挂载在某个目录下,才能供我们正常使用,接下来我们要学习三种硬盘分区工具,fdisk,gdisk,...
  • gdisk命令
  • Gdisk 磁盘软件

    2020-09-29 21:35:18
    Gdisk 分区工具与GHOST出于同一公司。 GDISK – Fixed Disk Partitioning Utility

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 2,967
精华内容 1,186
关键字:

gdisk

友情链接: Sistem Curso Java.rar