for debug purposes i need to extend my disk to all unallocated space, for example
my full disk size is 931.5GB and i have the following partitions
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 107.5G 0 part /
└─sda3 8:3 0 3.8G 0 part [SWAP]
so my /dev/sda2 partiton is less than 931.5GB and i need to increase this partition with parted command to have more espace
unallocated space is : 819.72GB (see with gparted) parted /dev/sda resizepart 2 500GB but this command returns the following error :
Can't have overlapping partitions
i am doing all this with a live usb in order to do not have mounted /dev/sda, the curious thing is that parted allow me to shrink the partition, i mean this
parted /dev/sda resizepart 2 50GB
one more thing, if i can get the solution to this problem i would like to use the option -s in order to automate this process with some bash scripts
This is the output for fdisk -l command
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C680462D-DE3F-4A97-B2A2-50226E7F9668
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 226453503 225402880 107.5G Linux filesystem
/dev/sda3 226453504 234440703 7987200 3.8G Linux swap
Thanks
sudo fdisk -l
so that we can see where your partitions begin and end. – Elder Geek Sep 15 '16 at 19:15