I would like to extend one of my Ubuntu servers main/boot drive beyond 2TB. I know that I need to convert the drive to use GPT, and I'm confident that I can extend the size as needed once I'm able to convert to GPT successfully.
I set up a test server to test out the process before attempting anything on an actual production server, and here's what I've tried so far.
- I detached the EBS volume from my server (was mounted at
/dev/xvda1
). - I attached the volume to another running server, at
/dev/sdf
(which shows up as/dev/xvdf
on the running server. sudo gdisk /dev/xvdf
followed byp
and get the following output:GPT fdisk (gdisk) version 1.0.1 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! *************************************************************** Command (? for help): p Disk /dev/xvdf: 104857600 sectors, 50.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 4FD95BA1-74A4-4241-98E5-CA0276008D62 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 104857566 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 104857566 50.0 GiB 8300 Linux filesystem
I attempt to just write the table as-is:
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/xvdf. The operation has completed successfully.
At this point, I detach the volume and reattach to the original EC2 instance and attempt to reboot. The server never becomes reachable.
I do a little more research and believe my issue is that I need to create a bios boot partition and install grub. Reattaching my volume to another instance, I created a new partition, so now I have the following:
Number Start (sector) End (sector) Size Code Name 1 2048 104857566 50.0 GiB 8300 Linux filesystem 2 34 2047 1007.0 KiB EF02 BIOS boot partition
Then I needed to install GRUB, so I did the following: $ sudo grub-install /dev/xvdf Installing for i386-pc platform. Installation finished. No error reported.
Detached/Reattached and no dice again. At this point I learned that I could view a screenshot from the EC2 dashboard and captured the following:
At this point I'm just throwing things at the wall to see if they stick. I have no idea what I am doing, but feel I'm missing something basic.
As I said, if I can add GPT to the volume and successfully boot it, I'm not worried about the steps needed to actually resize the volume.