Accidentally deleted mongodb files

3.4k views Asked by At

Accidentally I deleted the folder with the data mongodb. I found some programs that retrieve linux system files, but they all need the instructions for file's header, footer, and extension.

Example, the Foremost and Scalpel provide instructions for find a jpg file:

jpg     y       200000000       \xff\xd8\xff\xe0\x00\x10        \xff\xd9

Does anyone know how I can find the mongodb files? (website_production.0 / website_production.1 / website_production.ns / mongodb.lock)

OS is Ubuntu Server 10.04

Sorry for my english.

Thanks!

1

There are 1 answers

1
Mark Hillick On

If you've deleted the /data directory and you've no possible back-up (either through mongodump, mongoexport, replica set, secondary device or file system image) then you're essentially in a bad place and you'll have to create the data in a new database from scratch.

To confirm your file location questions specifically - they're all found in the data directory and if you've deleted that directory, they're gone and I doubt foremost will recover them. With its default settings, foremost most definitely will not recover as it doesn't know the file structure afaik. By default with the ubuntu install from the 10gen .deb package, the data directory is in /var/lib/mongodb. I'm not familiar with scalpel.

Sorry!