1

I've got a MySQL DB running in EC2 that I've had to continually add space to the EBS volume, then grow it (using growpart/xfs_growfs). I finally hit 2TB and couldn't figure out why I could no longer grow the partition, its because of course it's an MBR partition table.

The thing is, these DBs are in a cluster w/ (what I thought was) the exact same configurations. On the others, I was able to convert to GPT without any errors. It's just this one that I'm having trouble with.

Thanks in advance

Here are the outputs of gdisk, parted, fdisk.

I'm a bit confused why the xvdn1 shows as GPT but not xvdn .. I might have screwed up somewhere in the past?

What is the best way forward? The error message says to delete/resize in another utility, I've tried that and everytime I either end up with the same error or I'm unable to mount it. It's possible I'm not using the correct values to recreate the partition 33 blocks smaller?

Here is the command, and the error message. Everything else below that is just outputs of fdisk/parted/sfdisk showing the disk. Ever

gdisk /dev/xvdn
GPT fdisk (gdisk) version 0.8.8

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. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Warning! Main partition table overlaps the first partition by 33 blocks!
You will need to delete this partition or resize it in another utility.

Disk / Partition Table Let me know if there's any other debug info that would be helpful

parted /dev/xvdn unit s print
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdn: 5033164800s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End          Size         Type     File system  Flags
 1      1s     4194298394s  4194298394s  primary  xfs
parted /dev/xvdn1 unit s print
Model: Unknown (unknown)
Disk /dev/xvdn1: 4194298394s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags
fdisk -l -u /dev/xvdn

Disk /dev/xvdn: 2577.0 GB, 2576980377600 bytes
255 heads, 63 sectors/track, 313300 cylinders, total 5033164800 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
Disk identifier: 0x000b6274

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdn1               1  4194298394  2097149197   83  Linux
lsblk /dev/xvdn
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
xvdn    202:208  0   2.4T  0 disk
└─xvdn1 202:209  0     2T  0 part

Made backups ...

dd if=/dev/xvdn of=/root/mbrbackups/xvdnbackup.mbr bs=512 count=1

sfdisk -d /dev/xvdn > sfdiskbackup.txt
cat sfdiskbackup.txt
# partition table of /dev/xvdn
unit: sectors

/dev/xvdn1 : start=        1, size=4194298394, Id=83
/dev/xvdn2 : start=        0, size=        0, Id= 0
/dev/xvdn3 : start=        0, size=        0, Id= 0
/dev/xvdn4 : start=        0, size=        0, Id= 0

Note: I see similar questions/answers but they seem a bit different than mine. In my case, I only have 1 partition on a disk. I've also gone thru this procedure on (what I thought) was the exact same configuration, and was able to do the procedure online.

(crossposted to ubuntu forums -- will update here and vice/versa if

Versions

root@ip-10-0-2-189:~# sfdisk --version
sfdisk from util-linux 2.20.1
root@ip-10-0-2-189:~# sgdisk --version
GPT fdisk (sgdisk) version 0.8.8

These are the same versions that I did conversion on another instance.

and yes, my data is backed up, and this is actually a copy of the db i'm trying this on. this isn't the live -production DB.

skrewler
  • 308
  • 1
  • 3
  • 13
  • Do you have a secondary instance capable of handling production load? Would enable making that primary, destroying these disks, and creating the desired storage layout. – John Mahowald Mar 29 '20 at 14:45
  • Yeah I've got some alternative ways forward, but ideally, I'd like to get this working. – skrewler Mar 29 '20 at 21:46

0 Answers0