# Structure needs cleaning

**URL:** <https://forum.storj.io/t/structure-needs-cleaning/22960>\
**Category:** troubleshooting\
**Tags:** docker, corrupted-filesystem\
**Created:** [June 15, 2023, 12:30am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960 "2023-06-15T00:30:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariuspuri](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mariuspuri/32/7831_2.png) [@mariuspuri](https://forum.storj.io/u/mariuspuri)\
**Post date:** [June 15, 2023, 12:30am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/1 "2023-06-15T00:30:10Z")

</div>

Hi, today there was a power outage and when I start the Node I get this error and it doesn’t start.  
It is a 3-year-old node and 12TB of information, I want to do everything possible to recover it.  
txh

Error: Error starting master database on storagenode: database: piece\_spaced\_used opening file “config/storage/piece\_spaced\_used.db” failed: unable to open database file: structure needs cleaning

[storj.io/storj/storagenode/storagenodedb.(\*DB).openDatabase:347](http://storj.io/storj/storagenode/storagenodedb.(*DB).openDatabase:347)

[storj.io/storj/storagenode/storagenodedb.(\*DB).openExistingDatabase:324](http://storj.io/storj/storagenode/storagenodedb.(*DB).openExistingDatabase:324)

[storj.io/storj/storagenode/storagenodedb.(\*DB).openDatabases:299](http://storj.io/storj/storagenode/storagenodedb.(*DB).openDatabases:299)

[storj.io/storj/storagenode/storagenodedb.OpenExisting:266](http://storj.io/storj/storagenode/storagenodedb.OpenExisting:266)

main.cmdRun:62

main.newRunCmd.func1:32

[storj.io/private/process.cleanup.func1.4:399](http://storj.io/private/process.cleanup.func1.4:399)

[storj.io/private/process.cleanup.func1:417](http://storj.io/private/process.cleanup.func1:417)

[github.com/spf13/cobra.(\*Command).execute:852](http://github.com/spf13/cobra.(*Command).execute:852)

[github.com/spf13/cobra.(\*Command).ExecuteC:960](http://github.com/spf13/cobra.(*Command).ExecuteC:960)

[github.com/spf13/cobra.(\*Command).Execute:897](http://github.com/spf13/cobra.(*Command).Execute:897)

[storj.io/private/process.ExecWithCustomOptions:113](http://storj.io/private/process.ExecWithCustomOptions:113)

main.main:30

runtime.main:250

2023-06-14 22:43:17,219 INFO exited: storagenode (exit status 1; not expected)

2023-06-14 22:43:18,221 INFO gave up: storagenode entered FATAL state, too many start retries too quickly

2023-06-14 22:43:18,747 WARN received SIGTERM indicating exit request

2023-06-14 22:43:18,747 INFO waiting for processes-exit-eventlistener, storagenode-updater to die

2023-06-14T22:43:18.749Z INFO Got a signal from the OS: “terminated” {“Process”: “storagenode-updater”}

2023-06-14 22:43:18,750 WARN received SIGQUIT indicating exit request

2023-06-14 22:43:18,753 INFO stopped: storagenode-updater (exit status 0)

2023-06-14 22:43:19,756 INFO stopped: processes-exit-eventlistener (terminated by SIGTERM)

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [June 15, 2023, 12:38am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/2 "2023-06-15T00:38:54Z")

</div>

> **[How to fix a "database disk image is malformed"](https://support.storj.io/hc/en-us/articles/360029309111-How-to-fix-a-database-disk-image-is-malformed-)**
>
> Problem
> Sometimes a Storage Node Operator may encounter the "database disk image is malformed" error in their log. This could happen during unplanned shutdown or reboot. The error indicates that on...

Please use a UPS.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 15, 2023, 5:01am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/3 "2023-06-15T05:01:54Z")

</div>

> [@mariuspuri](#):
>
> unable to open database file: structure needs cleaning

meaning that your filesystem is corrupted. So, before trying to fix a database you need to fix your filesystem first with `fsck`, the node should be stopped and the disk is unmounted.  
In case of xfs you need to use a different procedure, see

> [@Node crash keep crashing after 48H+](https://forum.storj.io/t/node-crash-keep-crashing-after-48h/22410/20):
>
> You need to stop your node, unmount disk and fix the filesystem with fsck, until all errors will be fixed. If your filesystem is xfs, then you need to use a different method: [How to Check and Repair XFS Filesystem in RHEL | 2DayGeek](https://www.2daygeek.com/repairing-xfs-file-system-in-rhel/) After that you can mount disk back and run the node. Docker have no relation to the corrupted file system, so no need to reinstall.

After you fix the filesystem, you may check databases and fix them as well.

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 15, 2023, 5:37am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/4 "2023-06-15T05:37:56Z")

</div>

Ohoh, not another database failing… ☹  
But seems FS-related indeed.

---

<div class="post-metadata">

**Author:** ![mariuspuri](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mariuspuri/32/7831_2.png) [@mariuspuri](https://forum.storj.io/u/mariuspuri)\
**Post date:** [June 15, 2023, 6:19pm UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/5 "2023-06-15T18:19:44Z")

</div>

Hi, can you give me the commands to run fsck ?

---

<div class="post-metadata">

**Author:** ![JWvdV](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/jwvdv/32/7814_2.png) [@JWvdV](https://forum.storj.io/u/JWvdV)\
**Post date:** [June 15, 2023, 6:39pm UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/6 "2023-06-15T18:39:19Z")

</div>

umount -A /dev/DISK  
e2fsck /dev/DISK # same as fsck.ext4 /dev/DISK

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 16, 2023, 1:41am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/7 "2023-06-16T01:41:53Z")

</div>

```auto
sudo umount /dev/DISK
sudo fsck /dev/DISK

```

---

<div class="post-metadata">

**Author:** ![ItsHass](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/itshass/32/1122_2.png) [@ItsHass](https://forum.storj.io/u/ItsHass)\
**Post date:** [February 21, 2025, 11:03am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/8 "2025-02-21T11:03:56Z")

</div>

should you use the -y flag on fsck ?

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [February 21, 2025, 11:34am UTC](https://forum.storj.io/t/structure-needs-cleaning/22960/9 "2025-02-21T11:34:58Z")

</div>

Yes, otherwise you will be prompted for a yes/no to fix any file. `-y` is a YES to all prompts.
