Disk is failing, how to move the entire YNH to a new one?

I have searched the forum for similar issues

on

This category is for general issues(=something is broken) regarding YunoHost, NOT apps.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What type of hardware are you using

Virtual machine

What YunoHost version are you running

12.1.41.2

How are you able to access your server

The webadmin
SSH
Direct access via physical keyboard/screen

Describe your issue

I was wondering…so I have a dedicated server, 1TB Nvme where YNH and the OS are + 8TB HDDs where I store the data for Peertube/Nextcloud. The Nvme disk is failing and we will replace it with a similar one. What would be the best to just clone/backup the bad Nvme and restore to the new one?

I was thinking to boot into a rescue system (Debian) and clone the Nvme to the HDDs and then restore to the new Nvme. Sounds a bit more complex for me…

Would Timeshift work to create a backup of the entire system on the HDDs and then restore the backup on a newly installed Debian? I was curious…

I have a lot of YNH apps and is a bit of a pain to restore them one by one…

Share relevant logs or error messages

Not having.

I recently migrated my entire system to a larger SSD. Just using dd.

sudo dd if=/dev/sdX of=/mnt/backup/disk.img bs=64M status=progress

sudo dd if=/mnt/backup/disk.img of=/dev/sdY bs=64M status=progress

Then I expanded the space using gparted. It works great.

Super interesting. So basically you have created an image and then restored to the new drive. I have an 8TB HDD attached to this server do you think I can simply do the same and sudo dd my Nvme onto it and then replace the Nvme and restore it from the HDD?

Did you have a lot of YNH apps on your system that also have big databases?

Thanks for the tip!

EDIT: Ofc I will do this via a rescue system not booting from the bad Nvme

rsync could be a good idea too


I hope this answer was helpful. Please keep in mind that most of YunoHost’s development is done by volunteers, including this answer. Some of them earn less than the minimum wage in their country. If you can afford it, please consider donating to the 2026 fundraising campaign to help us keep this project going without putting anyone at risk.

Would there be an advantage using rsync over dd?

rsync sync the tree files, dd copy each bits of the disk. So with rsync you can copy into a higher or smaller partition.


I hope this answer was helpful. Please keep in mind that most of YunoHost’s development is done by volunteers, including this answer. Some of them earn less than the minimum wage in their country. If you can afford it, please consider donating to the 2026 fundraising campaign to help us keep this project going without putting anyone at risk.

How about using ddrescue ? Would that be a better alternative for a failing disk?

I used ddrescue and wow it worked like a charm. Basically create an image of the entire 1TB Nvme to my external HDD with

ddrescue -f -n /dev/nvme0n1 /mnt/backup/yunohost-disk.img /mnt/backup/yunohost-disk.map

And then restore:

ddrescue -f -n /mnt/backup/yunohost-disk.img /dev/nvme0n1 /mnt/backup/restore.map

Around 2h each. All works perfectly fine. It was so easy. Ofc you have to make sure you boot into a recovery system, unmount the bad Nvme, mount hte external drive, etc etc.