1

I have an Ubuntu server that stopped working this morning. I logged in and found out that it was out of disk space.

Results of lsblk :

ubuntu partitions

Free space left:

free space left

I can see that the root partition is 100% full, and that's why the server stopped working, however I don't understand why my ex-sysadmin made a partition of 111GB when the drive had 223.6GB of total disk space.

What's the best thing I can do now? Is there any way to increase the space of the actual partition in a safe way without causing any damage to the files inside or the file-system?

Or is there any way that I can clone this SSD to a bigger SSD, however if I clone the SSD I think the problem will remain because the partition will have the same size, right?

Results of df -h :

df -h command

Results of vgdisplay :

vgdisplay

I can see that there is 111GB free space on the drive. How can I add it to the existing partition?

David
  • 2,105
  • 13
  • 15
  • 25
j.manel.br
  • 11
  • 3
  • You can clean up disk space or resize a partition. – Pilot6 Feb 01 '23 at 12:24
  • do you think this is safe and correct? the data wont be loss? if you have any other better suggestion ... – j.manel.br Feb 01 '23 at 12:37
  • I am not very familiar with lvm – Pilot6 Feb 01 '23 at 12:45
  • 1
    thanks anyway for your help @Pilot6. I'll wait for someone who can point me in the correct direction – j.manel.br Feb 01 '23 at 12:46
  • 1
    You may find this previous answer helpful: [Ubuntu Server not mounting full harddrive](https://askubuntu.com/a/1417392/178692). For more background on your setup, take a look at [Grow partition on ubuntu server 18.04 inside virtualbox doesn't seem to work](https://unix.stackexchange.com/a/698495/65304) – steeldriver Feb 01 '23 at 12:57
  • Do you have physical access to this server or is it a VPS? – karel Feb 01 '23 at 13:04
  • Hi. I have physical access and im logged using putty, I tried the commands @steeldriver pointed me but i got the following error: write error failed: no space left on the device. I understand this is happening because the drive is currently at 100%. Can someone point me of how can i delete some files that are not needed? temporary files? packages? don't know.. something like that. i feel i just need to free up a little space to get this resize comand working – j.manel.br Feb 01 '23 at 13:10
  • @karel is there any folder that i can safely delete without compromising the working state of the ubuntuserver? i am still trying to figure it out the ls and cd commands, still searching for the delete command etc. – j.manel.br Feb 01 '23 at 13:29
  • [Root drive is running out of disk space. How can I free up space?](https://askubuntu.com/q/57994/) – karel Feb 01 '23 at 13:31
  • @karel thank you for pointing that out to me. I am running ubuntu server 20.04.2 LTS do you think its safe to run the "sudo apt autoremove" command without risking loosing any valuable data i have on the server? i have mysql running inside the ubuntu server. thank you – j.manel.br Feb 01 '23 at 14:23
  • I run `sudo apt autoremove` at least once a week without any problems. If you are able to update the software without getting package management error messages it is safe to run `sudo apt autoremove` otherwise if you are getting package management error messages you should solve them first. – karel Feb 01 '23 at 14:27
  • @karel damn, still no luck. im getting this error after running sudo apt autoremove: "Do you want to continue? [Y/n] y dpkg: unrecoverable fatal error, aborting: unable to fill /var/lib/dpkg/updates/tmp.i with padding: No space left on device you have any other suggestion? – j.manel.br Feb 01 '23 at 14:33
  • That's a bad error message. It means don't run `sudo apt autoremove`. Instead you should create additional storage space in your root partition first by adding the 111GB free space to it. **You can't do this while the root filesystem is in use!!!** Instead boot the Ubuntu live USB that you used to install Ubuntu and run the built-in GParted partition editor application from an Ubuntu live session. Here is a link: [How to resize partitions?](https://askubuntu.com/q/126153/). – karel Feb 01 '23 at 14:45
  • @karel thank you for the tip, do you think its best for me to clone the entire disk first? or the gpart is easy to use and shouldnt be a problem? thank you – j.manel.br Feb 01 '23 at 15:08
  • Cloning a disk with errors on it clones the errors too. All the experts recommend that you should at least backup all of the data that is currently stored on a partition before resizing that partition. – karel Feb 01 '23 at 15:13

0 Answers0