Eu criei um disco virtual (com caixa virtual) inicialmente com 10 GB de armazenamento. Eu instalei o Ubuntu nele. Ele começou a mostrar avisos de que o armazenamento estava baixo, então eu mudei a capacidade do disco virtual para 25 GB. Mas quando eu executo o ubuntu ele continua mostrando os mesmos avisos, parece que o Ubuntu não reconhece o novo espaço disponível.
Como pode e resolver isso?
Depois de executar este comando:
lsblk -o name,size,type,fstype,mountpoint
Eu tenho isso:
NAME SIZE TYPE FSTYPE MOUNTPOINT
loop0 4.9M loop squashfs /snap/canonical-livepatch/41
loop1 29.5M loop squashfs /snap/sublime-text/18
loop2 86.6M loop squashfs /snap/core/4486
loop3 139.4M loop squashfs /snap/chromium/343
loop4 86.6M loop squashfs /snap/core/4650
loop5 139.8M loop squashfs /snap/chromium/353
sda 25G disk
├─sda1 1M part
└─sda2 10G part ext4 /
sr0 55.3M rom iso9660 /media/dk/VBox_GAs_5.2.12
sudo parted /dev/sda resizepart 2 -1s
[sudo] password for dk:
parted: invalid option -- '1'
Usage: parted [-hlmsv] [-a<align>] [DEVICE [COMMAND [PARAMETERS]]...]
dk@dkserver:/opt$ sudo resize2fs /dev/sda2
resize2fs 1.44.1 (24-Mar-2018)
The filesystem is already 2620672 (4k) blocks long. Nothing to do!
(não funcionou)
Resultado 3:
sudo parted /dev/sda -- resizepart 2 -1s
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to
use all of the space (an extra 31457280 blocks) or continue with the current setting?
parted: invalid token: 2
Fix/Ignore? y
parted: invalid token: y
Fix/Ignore? f
Partition number?
Qual o número da partição que devo colocar?
Qual valor devo colocar? 25 gb (ou é em megabytes?) Ou devo dar menos (contando com outros sistemas / espaço de partições)?
sudo parted /dev/sda
[sudo] password for dk:
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free
space, all found partitions, or a particular partition
quit exit program
rescue START END rescue a lost partition near START and END
resizepart NUMBER END resize partition NUMBER
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information
of GNU Parted
(parted) resizepart 2
Warning: Partition /dev/sda2 is being used. Are you sure you want to continue?
Yes/No? y
End? [10.7GB]?
Resultado 4:
lsblk -o name,size,type,fstype,mountpoint
NAME SIZE TYPE FSTYPE MOUNTPOINT
loop0 4.9M loop squashfs /snap/canonical-livepatch/41
loop1 86.6M loop squashfs /snap/core/4650
loop2 139.8M loop squashfs /snap/chromium/353
loop3 86.6M loop squashfs /snap/core/4486
loop4 29.5M loop squashfs /snap/sublime-text/18
loop5 139.4M loop squashfs /snap/chromium/343
sda 25G disk
├─sda1 1M part
└─sda2 25G part ext4 /
sr0 55.3M rom iso9660 /media/dk/VBox_GAs_5.2.12
dk@dkserver:~$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.8G 9.1G 230M 98% /