I'm running an EC2 instance in AWS with 12 GB volume attached to it. The OS is Ubuntu. I want to create a partition of 2GB from this 12GB volume.
So, here is the output of sudo fdisk -l
:
$ sudo fdisk -l
Disk /dev/xvda: 12 GiB, 12884901888 bytes, 25165824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x89cdb65f
Device Boot Start End Sectors Size Id Type
/dev/xvda1 * 2048 25165790 25163743 12G 83 Linux
How to create a partition without deleting the OS? To be exact how to create a partition from xvda1
and how to decide first and last sector values?
fdisk
allows you to specify the size in MB/GB/etc and automatically calculates the last sector based on the specified size. – mjturner Feb 02 '18 at 06:46