Have additional ~130GB for upload, but not enough space on the “/osm” volume, as can be seen with pydf command.
# pydf
Filesystem Size Used Avail Use% Mounted on
/dev/osmhr/root 49G 6300M 41G 12.5 [####…………………………] /
/dev/md0 921M 155M 703M 16.8 [######………………………] /boot
/dev/osmhr/osm 837G 730G 106G 87.3 [##############################…] /osm
Let’s check available space on the drives.
# pvscan
PV /dev/md1 VG osmhr lvm2 [1,36 TiB / <490,11 GiB free]
Total: 1 [1,36 TiB] / in use: 1 [1,36 TiB] / in no VG: 0 [0 ]
We can see there is enough free space fo extend our volume, and we can check individual volumes.
# lvscan
ACTIVE '/dev/osmhr/swap' [4,00 GiB] inherit
ACTIVE '/dev/osmhr/root' [50,00 GiB] inherit
ACTIVE '/dev/osmhr/osm' [850,00 GiB] inherit
Decision is made to extend the volume from 850 Gib to 1000 GiB so we are clear for some time. First to stop services using that volume, and unmount it.
# systemctl stop apache2.service
# umount /osm
Now that the volume is free for manipulation it’s time to extend it
# lvextend -L1000G /dev/osmhr/osm
Size of logical volume osmhr/osm changed from 850,00 GiB (217600 extents) to 1000,00 GiB (256000 extents).
Logical volume osmhr/osm successfully resized.
After the volume resize it’s time to check file system
# e2fsck -f /dev/osmhr/osm
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/osmhr/osm: 10052064/55705600 files (0.1% non-contiguous), 194923328/222822400 blocks
With clean file system it’s safe to resize it
# resize2fs /dev/osmhr/osm
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on /dev/osmhr/osm to 262144000 (4k) blocks.
The filesystem on /dev/osmhr/osm is now 262144000 (4k) blocks long.
To be safe you can check file system once more, now with new size
# e2fsck -f /dev/osmhr/osm
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/osmhr/osm: 10052064/65536000 files (0.1% non-contiguous), 195540128/262144000 blocks
Time to mount the volume back
# mount -a
And check the disk usage to see there is enough space for new data upload
# pydf
Filesystem Size Used Avail Use% Mounted on
/dev/osmhr/root 49G 6300M 41G 12.5 [####…………………………] /
/dev/md0 921M 155M 703M 16.8 [######………………………] /boot
/dev/osmhr/osm 984G 730G 254G 74.2 [#########################………] /osm
Available space on drives has shrinked
# pvscan
PV /dev/md1 VG osmhr lvm2 [1,36 TiB / <340,11 GiB free]
Total: 1 [1,36 TiB] / in use: 1 [1,36 TiB] / in no VG: 0 [0 ]
And our logical volume has inreased
# lvscan
ACTIVE '/dev/osmhr/swap' [4,00 GiB] inherit
ACTIVE '/dev/osmhr/root' [50,00 GiB] inherit
ACTIVE '/dev/osmhr/osm' [1000,00 GiB] inherit
Last thing, don’t forget to restart the services stopped earlier
# systemctl start apache2.service
Everything is back to normal, but there is lot more space for new data.