0

I am using a ubuntu vm on microsoft azure. I am facing a problem with creating new files and data being stored in database. It is throwing an error which says vm out of space. When i run df -h --total output in vm is

enter image description here

/dev/sdd1 is where all my data is and I am on working on. /dev/sdc1 has a lot of space. How can I make use of that space?

Thanks

chink
  • 101
  • Isn't a problem with /dev/sda1 instead of /dev/sdd1? If you can change mounting points, then mount /dev/sdc1 to a folder where you need to store your files or database – Jirka Picek Jan 22 '20 at 07:35
  • can you help me with how to change the mounting points of a folder? – chink Jan 22 '20 at 07:38
  • I guess that it's mounted during boot then it could be done by editing /etc/fstab, but the folder which will be new mounting point must be empty. – Jirka Picek Jan 22 '20 at 07:50

1 Answers1

0

/dev/sda1 is very important for your OS, so first you have to move some of those files occupying space to /mnt/datadrive or /home/amitbhanja/BertLabs1. You need to figure out what those files are using du.

# du -a / | sort -n

The last lines has the largest files and directories. Or better to use ncdu and check this post for more detailed information.

If it turned out to be the database e.g which is on /var/lib/mysql, you can configure mysql data directory datadir or symlink it to the new location. You need to be careful and always take backups. Moving your own files are preferred to move system files, especially for unexperienced users. Issues could arise if your vm is using AppArmor e.g.

Munzir Taha
  • 1,490