I'm booting my FreeNAS from an USB stick. But it became bad and won't boot up.

bad dir ino {X} at offset {X}: mangled entry

I now attached the USB drive to a VM with FreeNAS to mount / or repair the fs on the stick with fsck.

After running fsck -y -t ufs once, the partition seems to be totally destroyed (can't even rerun fsck as it just gives "no superblock found"). So I guess the fs can't be repaired.

That's why I'm now trying to retrieve the config /data/freenas-v1.db.

I mounted "mount -t ufs /dev/da0s1a /tmp/test" but "ls /tmp/test/data/" just gives:

ls: zfs: Bad file descriptor
./ ../

In a working install the config file freenas-v1.db is within that folder and zfs is an ordinary subdir of the folder.

Is the file lost? Any chance to get it back?


Finally got the file. Didn't realized /data is mounted from the 4th partition and is not part of the root filesystem.

Unfortunately, it's corrupted and can't be opened and sqlite doesn't seem to have a good tool to repair corrupted databases. So I'm finally out of luck with this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.