Size used by a VPS

hello,

how can I find out the size of a VPS (I feel like I'm running low on disk space)

I have synced the photos from my phone to my Nextcloud VPS

thanks for your help

Hi @DanielG34

You can easily check it from the command line of your VPS. The command that will give you a quick overview is df -h, which will show you the used and available space on your disks.

Kind regards,
Sergio Turpín

Hello,\n\nI installed a VPS vps-1 with 40 GB of disk space.\n\nWhen I run the lsblk command I get the following result:\n\nNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS\nsda 8:0 0 2.9G 0 disk\n└─sda1 8:1 0 2.9G 0 part /\nsdb 8:16 0 40G 0 disk\n├─sdb1 8:17 0 38.9G 0 part\n├─sdb13 8:29 0 1023M 0 part\n├─sdb14 8:30 0 4M 0 part\n└─sdb15 8:31 0 106M 0 part\n\nI would like to know the available size of sdb1.\n\nThe df -h command gives the result:\n\nV\[RESCUE\] root@vps-a71e1ee4:/dev $ df -h\nFilesystem Size Used Avail Use% Mounted on\nudev 1.9G 0 1.9G 0% /dev\ntmpfs 382M 528K 382M 1% /run\n/dev/sda1 2.9G 2.4G 308M 89% /\ntmpfs 1.9G 0 1.9G 0% /dev/shm\ntmpfs 5.0M 0 5.0M 0% /run/lock\n\nLinux is hard for a 74‑year‑old retiree......

Hi @DanielG34

What happened is that when you set up your VPS, the operating system was installed on the small disk sda. The large disk sdb is there, but unused. You need to mount it to be able to use it.

Since you haven't used the large disk, it is probably empty…
Warning! :warning: - These commands will erase any data that might be on sdb1. Since it looks like you haven't used it, it's safe, but keep that in mind :wink:

The steps to follow are:

  1. Format the partition with sudo mkfs.ext4 /dev/sdb1
  2. Create a mount point with sudo mkdir -p /home/nextcloud
  3. Mount the disk with sudo mount /dev/sdb1 /home/nextcloud
    1. So you don't have to mount the disk manually each time you restart the VPS, add a line to the /etc/fstab file. You can do this with the command:
      echo '/dev/sdb1 /home/nextcloud ext4 defaults 0 2' | sudo tee -a /etc/fstab
  4. Verify with df -h that the large disk appears and then move your Nextcloud data to the new location.

I hope this helps. Keep me posted!

Regards :waving_hand:
Sergio Turpín

Thanks for your help

I ran the commands successfully (I didn’t move the Nextcloud data)

After these steps, my VPS server no longer boots....

Hola @DanielG34

Vaya! Es comprensible, pero no te preocupes, es un problema que tiene solución y es bastante común cuando se manipulan discos y particiones...

Lo más probable es que el VPS no arranque porque, al montar el nuevo disco/dev/sdb1 en /home/nextcloud y editarlo para que el montaje sea permanente, se haya modificado el archivo de configuración del sistema de una forma que no era la esperada.

La solución pasa por usar el modo rescate de OVHcloud, que es como tener un "sistema operativo de emergencia" para poder acceder al VPS y repararlo manualmente:

  1. Activamos el modo rescate :right_arrow: Desde el área de cliente, ve a tu VPS y selecciona la opción de "Reiniciar en modo de rescate" en el menú de arranque.
  2. Conéctate a tu VPS por SSH usando las credenciales del modo rescate. Una vez dentro, identifica el disco principal de tu VPS. Es el disco de 40 GB (sdb) que ya viste con el comando lsblk. La partición que contiene tu sistema es sdb. Debes montarla en el directorio /mnt para poder ver y modificar sus archivos.
    Por ejemplo:
    mount /dev/sdb1 /mnt
  3. Posteriormente vamos a reparar el archivo /etc/fstab El problema es que tu archivo de configuración de montaje puede estar mal. Debes editarlo para corregirlo.
    nano /mnt/etc/fstab
  4. Busca la línea que añadiste para montar el disco en /home/nextcloud. Lo más seguro es que no sea necesaria para el arranque inicial. (puedes comentarla poniendo delante un #)
  5. Reinstalamos el gestor de arranque :right_arrow: Es muy probable que, al modificar las particiones, GRUB se haya dañado.
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    mount --bind /dev /mnt/dev
    chroot /mnt /bin/bash
    Ahora, ya dentro del entorno de tu sistema, reinstala GRUB en el disco principal
    grub-install /dev/sdb
    update-grub
  6. Reiniciamos nuestro VPS, pero esta vez seleccionando «Arrancar desde el disco duro»

El sistema debería volver a la vida :smiling_face_with_three_hearts:

Mantenme informado. Recibe un cordial saludo.
Sergio Turpín

Hello

When I run the command nano /mnt/etc/fstab, I get the message [ Directory '/mnt/etc' does not exist ]

I edited the file /etc/fstab directly; I’m not sure if that’s correct..

Then I entered the command mount --bind /proc /mnt/proc

I get the message:

mount: /mnt/proc: mount point does not exist.
dmesg(1) may have more information after failed mount system call.

I’m a bit lost...

Hello @DanielG34

I think you skipped the command to mount the drive.

Let's start over from the beginning, calmly. The goal is to mount the disk of your VPS so we can repair its system.

  1. First, let's identify the correct disk; run lsblk.
  2. We'll mount the root partition of your system (sdb1)
    mount /dev/sdb1 /mnt :left_arrow: make sure you don't forget this command. If all goes well, the system won't return any message.
  3. We prepare the working environment.
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    mount --bind /dev /mnt/dev
    Now these directories exist inside /mnt.
  4. We access the system with chroot.
    chroot /mnt /bin/bash
    From here we repair our system’s /etc/fstab with nano /etc/fstab
  5. We reinstall GRUB, if you need it.
    grub-install /dev/sdb
    update-grub
  6. We exit and reboot. When you're done, leave the chroot environment with the exit command.
  7. To avoid other errors, unmount the directories:
    umount /mnt/dev
    umount /mnt/sys
    umount /mnt/proc
    umount /mnt

Please follow these commands strictly; if we skip the «mount» command the system won't be mounted and the rest of the commands will fail :smirking_face:

I look forward to your response, best regards.
Sergio Turpín

Hello,
if you still have a bit of time to spare for me, I can give you control.
I can send you the login credentials by email -

I have just restored the VPS.
I installed Nextcloud with Docker (OVH recommendation).
I wonder if it might be better to uninstall it and do a fresh installation without Docker.

Thanks again for your help.

Daniel

Hi @DanielG34

We had to hide your previous message because it contained confidential information, so please, when you post something on the forum make sure you don’t share credentials or personal data :folded_hands:

I’m glad you were able to restore the VPS. Regarding your question, my recommendation is not to uninstall Docker. On the contrary, if you already have Nextcloud running with Docker, it’s an excellent foundation and OVHcloud recommends it because it greatly simplifies maintenance and updates.

Docker is not the problem. If something fails, it’s easier to fix it with containers than to reinstall everything from scratch. Don’t get tangled in a reinstall, you already have the work done.

If you have any questions, we’re here to help.

Best regards,
Sergio Turpín

Hello @sturpin

Are you part of the OVH Team?

If NOT, how were you able to hide a visitor's message?

Hey buddy @Gaston!

No :wink:

I reported the post and a moderator acted accordingly.

Now that you mention it, it might be nice if OVH created a "Community Support OVHcloud" and added @Gaston, @fritz2cat and me :slightly_smiling_face: to it to help with some community administrative tasks. I'll leave it at that! @FabL :wink:

Cheers, friend!
Sergio Turpín

Hello @sturpin,

I’m not sure I understood your request; what would be the purpose of this group?

^FabL

Answered by DM

the space was taken by the Nextcloud trash
I emptied it