I am working on a Debian 9 system. When I try to install a package, dpkg fails with following error:
Selecting previously unselected package mariadb-server-10.1.
Preparing to unpack .../3-mariadb-server-10.1_10.1.38-0+deb9u1_amd64.deb ...
/var/lib/mysql: found previous version 10.1
ERROR: There's not enough space in /var/lib/mysql/
dpkg: error processing archive /tmp/apt-dpkg-install-ShVFUI/3-mariadb-server-10.1_10.1.38-0+deb9u1_amd64.deb (--unpack):
Here is df -h:
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 791M 9.1M 782M 2% /run
/dev/sda2 55G 9.8G 43G 19% /
tmpfs 3.9G 158M 3.8G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 511M 132K 511M 1% /boot/efi
/dev/sda5 844G 540G 261G 68% /home
/dev/sda3 9.2G 8.7G 32K 100% /var
tmpfs 791M 12K 791M 1% /run/user/1001
fdisk -l output:
Disk /dev/sda: 931.5 GiB, Disklabel type: gpt
Disk identifier: AAF695F1-3DA1-4E89-86F4-59439A75BCBB
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 118237183 117186560 55.9G Linux filesystem
/dev/sda3 1933993984 1953523711 19529728 9.3G Linux filesystem
/dev/sda4 1917392896 1933993983 16601088 7.9G Linux swap
/dev/sda5 118237184 1917392895 1799155712 857.9G Linux filesystem
How can I move /var to a spacious partition (if at all possible)? Or, how can I increase the size of /dev/sda3 to, say, 30G?
Disk /dev/sda: 931.5 GiB, Disklabel type: gpt Disk identifier: AAF695F1-3DA1-4E89-86F4-59439A75BCBB Device Start End Sectors Size Type /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 118237183 117186560 55.9G Linux filesystem /dev/sda3 1933993984 1953523711 19529728 9.3G Linux filesystem /dev/sda4 1917392896 1933993983 16601088 7.9G Linux swap /dev/sda5 118237184 1917392895 1799155712 857.9G Linux filesystem Partition table entries are not in disk order. – Kusan Biswas Jul 09 '19 at 10:22