MBR TO GPT

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску


MBR to GPT

Это заметка о том как сконвертить MBR в GPT, что бы долго не искать. Нужно бывает не часто, просто запишу что бы не забыть

Проверить размеры дисков и партиций lsblk -f

lsblk -f
NAME        FSTYPE   LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINT
nvme0n1
└─nvme0n1p1 ext4     cloudimg-rootfs e8070c31-bfee-4314-a151-d1332dc23486    1.1G    94% /
nvme2n1
└─nvme2n1p1 ext4                     2706eb45-cde8-44e0-ac6b-6a228c99dd06   62.8G    93% /mnt

1

gdisk -l /dev/nvme2n1
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

Disk /dev/nvme2n1: 4613734400 sectors, 2.1 TiB
Model: Amazon Elastic Block Store
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 9BF40982-9625-4B6C-899E-53B15E99EB20
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 4613734366
Partitions will be aligned on 2048-sector boundaries
Total free space is 318769085 sectors (152.0 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      4294967295   2.0 TiB     8300  Linux filesystem


  • MBR: MBR only
  • GPT: not present

2

growpart /dev/nvme2n1 1
CHANGED: partition=1 start=2048 old: size=4294965248 end=4294967296 new: size=4613732319 end=4613734367

3

gdisk  -l /dev/nvme2n1
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme2n1: 4613734400 sectors, 2.1 TiB
Model: Amazon Elastic Block Store
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 463B39F6-7731-49E9-B840-CE7A41DA2DD7
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 4613734366
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      4613734366   2.1 TiB     8300  Linux filesystem

4

# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme0n1     259:1    0   20G  0 disk
└─nvme0n1p1 259:2    0   20G  0 part /
nvme2n1     259:4    0  2.2T  0 disk
└─nvme2n1p1 259:5    0  2.2T  0 part /mnt

5

resize2fs /dev/nvme2n1p1
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/nvme2n1p1 is mounted on /mnt; on-line resizing required
old_desc_blocks = 256, new_desc_blocks = 275
The filesystem on /dev/nvme2n1p1 is now 576716539 (4k) blocks long.

67



7



8



9



10