By doug.landau
As the title indicates. I added a new 500GB volume of block storage last night. Called “degree”. I then proceeded to absent-mindedly run mkfs.ext4 on my existing 100GB system disk, instead of on the new one. I mounted the new volume and cd’d to it and saw it empty and said df and saw it had 89GB free out of 94. I unmounted it, realized my mistake, ran mkfs.ext4 on the new storage and mounted that. The system is still running and files I look for appear to still be there. what have I screwed up? Will it reboot? I thought to try fsck, but all I get so far is “fsck from util-linux 2.34”. Thank you
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!
Heya,
When you ran mkfs.ext4 on your already-mounted root disk, you overwrote the filesystem metadata on disk, but the system keeps running because everything was already mounted and a lot of data is cached in RAM. That’s why files still appear to be there and why nothing immediately exploded.
The dangerous part comes when you reboot. Once the system restarts, the kernel has to read the filesystem metadata from disk again — and that metadata is what mkfs.ext4 destroys first. Try to snapshot the Droplet before you reboot also you’ll need to check this article out:
https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-iso/
You will most probably need to boot it like that and try to recover your data. When you go into recovyer run something like:
fsck.ext4 -n /dev/<root-device>
(-n = read-only, no changes)
From there, you decide whether repair is viable or whether you’re in file-recovery territory (TestDisk / extundelete / backups).
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.