Question

I moved a volume to a new droplet and all of the data was lost

I moved a volume that was attached to an existing droplet to a new droplet. Then I ran the commands to mount it to the new droplet.

mkdir -p /mnt/test
mount -o discard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_test /mnt/test

When i checked the directory it was empty, I tried to repeat it a few times and it still empty. When I run df -h can see it is mounted but empty


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
October 17, 2024

Heya,

You can confirm that /mnt/test is not already being used by another mounted volume or that there are no hidden files in the directory itself. Also you can try to mount the volume back to the old droplet and check if the data is present.

If there were any issues while detaching or attaching the volume, filesystem corruption could occur.

Run a filesystem check:

umount /mnt/test 
fsck -f /dev/disk/by-id/scsi-0DO_Volume_test

This will try to repair any filesystem issues that might be preventing the volume from being read properly. fsck can occasionally cause data corruption on active disks, so only attempt this on an unmounted file system.

Using fsck as a recovery option can be useful, but it comes with risks and isn’t guaranteed to work, so consider it a last resort method of data recovery. We recommend taking a snapshot of your Droplet first. If the recovery causes data loss, you can restore from the snapshot and try again or use a different method.

Regards

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more