Resize partition, not LVM, on debian

MarcoP

Active Member
Aug 15, 2018
20
4
43
Hello,

here some info about /dev/sdb1, mounted as /var/www/html into a debian VM.

Code:
df -Th
/dev/sda1      ext4       23G  3.4G   19G  16% /
/dev/sda8      ext4      206G   61M  195G   1% /home
/dev/sda7      ext4      1.9G  5.7M  1.7G   1% /tmp
/dev/sda5      ext4      9.2G  412M  8.3G   5% /var
/dev/sdb1      ext4      6.8T  6.3T  201G  97% /var/www/html

Code:
fdisk -l /dev/sdb
Disk /dev/sdb: 9.8 TiB, 10737418240000 bytes, 20971520000 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 76ACA7A0-7C57-414D-9726-26ADA281D5A6

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 14680061951 14680059904  6.9T Linux filesystem

Code:
lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0   256G  0 disk
|-sda1   8:1    0  23.3G  0 part /
|-sda2   8:2    0     1K  0 part
|-sda5   8:5    0   9.3G  0 part /var
|-sda6   8:6    0    12G  0 part [SWAP]
|-sda7   8:7    0   1.9G  0 part /tmp
`-sda8   8:8    0 209.6G  0 part /home
sdb      8:16   0   9.8T  0 disk
`-sdb1   8:17   0   6.9T  0 part /var/www/html

Code:
growpart -v -N /dev/sdb 1
update-partition set to true
resizing 1 on /dev/sdb using resize_sfdisk_gpt
20971520000 sectors of 512. total size=10737418240000 bytes
WARN: disk is larger than 2TB. additional space will go unused.
## sfdisk --unit=S --dump /dev/sdb
label: gpt
label-id: 76ACA7A0-7C57-414D-9726-26ADA281D5A6
device: /dev/sdb
unit: sectors
first-lba: 34
last-lba: 20971519966

/dev/sdb1 : start=        2048, size= 14680059904, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=A4FCB37F-57A0-4497-9F9D-2C9223B77B77
max_end=4294967296 tot=20971520000 pt_end=14680061952 pt_start=2048 pt_size=14680059904
NOCHANGE: partition 1 could only be grown by -10385094656 [fudge=2048]

Code:
resize2fs /dev/sdb1
resize2fs 1.44.5 (15-Dec-2018)
The filesystem is already 1835007488 (4k) blocks long.  Nothing to do!

growpart seems to report a negative value and resize2fs refuse to extend the partion, is it because the 4k partition sector size?

Any help would be appreciated.

Cheers