Ok, consegui fazer isso. Aqui está como:
Removida a partição de troca com
# swapoff /dev/sda2
Em seguida, iniciei fdisk
:
# fdisk /dev/sda
Listou as informações das partições, preocupadas com a coluna Start
da primeira partição:
Command (m for help): p
Device Boot Start End Blocks Id System
/dev/sda1 * 4096 47029167 1903512536 83 Linux
/dev/sda2 47029168 57029167 50000000 83 Linux
Removidas as duas partições:
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 1 has been deleted.
Command (m for help): d
Partition number (1): 1
Partition 1 has been deleted.
Criaram novas partições com novos tamanhos, mas a partir de Start (4096)
em vez do padrão:
Command (m for help): n
Select (default p): p
Partition number (1, default 1): 1
First sector (2048-3907029167, default 2048): 4096 //Important. Notice that is not the same as the default (in my case).
Last sector (default 3907029167): 3807029167 //I've put less to have spare space for partition 2
Command (m for help): n
Select (default p): p
Partition number (2, default 2): 2
First sector (2048-3907029167, default 2048): 3807029168 //Important. Notice that starts with 20148 because is the first empty space detected, but in reality I want it AFTER the first partition, so I've put another number (in my case).
Last sector (default 3907029167): 3907029167
Em seguida, defini o sinal Boot
de sda1
:
Command (m for help): a
Partition number (1,2, default 2): 1
Em seguida, reinicie e execute (após a reinicialização):
# resize2fs /dev/sda1
E então está tudo bem:
################################
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.8T 2.1G 1.7T 1% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 9.5M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
################################
# fdisk -l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 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 label type: dos
Disk identifier: 0x00044686
Device Boot Start End Blocks Id System
/dev/sda1 * 4096 3807029167 1903512536 83 Linux
/dev/sda2 3807029168 3907029167 50000000 83 Linux
Agora preciso criar a troca novamente e pronto.