# Moving databases on ssd?

**URL:** <https://forum.storj.io/t/moving-databases-on-ssd/20045>\
**Category:** FAQ\
**Created:** [October 25, 2022, 12:06pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045 "2022-10-25T12:06:41Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![daki82](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/daki82/32/1128_2.png) [@daki82](https://forum.storj.io/u/daki82)\
**Post date:** [January 27, 2024, 10:14pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/21 "2024-01-27T22:14:08Z")

</div>

> [@snorkel](#):
>
> “We know that the 1GB test sample is not representative for the entire capacity of the drive, but we show you only these tests”.

i find it verry informative, its all there

 ![iops](https://storj-s3.bcdn.literatehosting.net/original/2X/4/4c8c7d4f01e9a44831be96eb281d7869029958fc.png)  
especialy the random 4kiops count for the dbs, my guess.

- you can verify the test with different test sizes, i did, and it matched.

> [@snorkel](#):
>
> BTW… how should I format these flash drives for linux use? I have zero expirience with manual formating of drives, in linux.

Many distributions have a gui tool for partitions (GParted). i think ext4 (4k cluster) for linux is ok.

---

<div class="post-metadata">

**Author:** ![Roxor](https://storj.bcdn.literatehosting.com/letter_avatar/roxor/32/5_5575768a8748004e209b776fc1b2916d.png) [@Roxor](https://forum.storj.io/u/Roxor)\
**Post date:** [January 27, 2024, 11:22pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/22 "2024-01-27T23:22:32Z")

</div>

I’m interested in how this turns out. I’ve had good experiences using USB flash drives to move occasional batches of large media files around (so occasional large sequential writes). I’ve had poor experiences using them as general filesystems with constant small writes (like node logs or a database). They just seemed to wear out: throwing errors, then the system drops them entirely or remounts them read-only.

But I can’t comment on any particular make or model: perhaps that Samsung has great write endurance.

---

<div class="post-metadata">

**Author:** ![daki82](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/daki82/32/1128_2.png) [@daki82](https://forum.storj.io/u/daki82)\
**Post date:** [January 28, 2024, 8:15am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/23 "2024-01-28T08:15:30Z")

</div>

many of them are pre-formated in exfat for compatibility. with a big cluster size, resulting in wearing out quick in normal operation.  
sd-cards have that problem usualy too.  
flash-drives are not usb-sticks per se, they have an own controler.  
also great quality differences can occur.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [January 28, 2024, 9:26am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/24 "2024-01-28T09:26:18Z")

</div>

With 600MB of databases and 128GB of space, you get at least 200 complete rewrites of the databases. Multiply that by the number of times the entire stick can be rewritten. I believe we are safe for at least 10 years, if the controller dosen’t fail.

---

<div class="post-metadata">

**Author:** ![Toyoo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/toyoo/32/1126_2.png) [@Toyoo](https://forum.storj.io/u/Toyoo)\
**Post date:** [January 28, 2024, 11:01pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/25 "2024-01-28T23:01:53Z")

</div>

This is not exactly true due to write amplification. A single 4kB write to a flash drive may trigger a rewrite of a full flash memory’s erase block, apparently even megabytes depending on the flash memory’s controller. It then pays off to get a quality drive with a good controller.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [February 1, 2024, 10:37pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/26 "2024-02-01T22:37:08Z")

</div>

I installed the USB stick (Samsung Bar Plus 128GB) in Synology, to move the databases on it, I formatted it as ext4, and there is an option, disabled by default: “enable delayed allocation for ext4 - …can improve write performance, but might result in data loss…”.  
What is this and should I enable it?

---

<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:** [February 2, 2024, 4:52am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/27 "2024-02-02T04:52:33Z")

</div>

> [@snorkel](#):
>
> enable delayed allocation for ext4

[https://ext4.wiki.kernel.org/index.php/Frequently\_Asked\_Questions#What\_is\_delayed\_allocation\_.28delalloc.29.3F\_What\_are\_its\_advantages\_in\_Ext4.3F](https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions#What_is_delayed_allocation_.28delalloc.29.3F_What_are_its_advantages_in_Ext4.3F)

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [February 2, 2024, 5:39am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/28 "2024-02-02T05:39:26Z")

</div>

I have UPS and db-es are not critical, so I’ll set it to enabled. I started non lazzy FW to see if USB makes any difference for it.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [February 10, 2024, 9:07pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/29 "2024-02-10T21:07:06Z")

</div>

Test results here for the USB stick:  
[https://forum.storj.io/t/tuning-the-filewalker/19203/221?u=snorkel](https://forum.storj.io/t/tuning-the-filewalker/19203/221)

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [February 17, 2024, 10:14pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/30 "2024-02-17T22:14:33Z")

</div>

If you are on Synology, you should set noatime for the USB drive too.  
You can use a script to run as root, at boot:

```auto
mount -o remount,noatime "/volumeUSB1/usbshare"

```

where `/volumeUSB1/usbshare` is the mount point that you get with `sudo mount` command.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [March 20, 2024, 9:54pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/32 "2024-03-20T21:54:06Z")

</div>

Setting up my Ubuntu Server, I just learned about `mount` and the device names that are changing, and yes, it is recommended to use UUID for mount, but for my Synologys, I only use 1 USB port for the flash drive, the front one. The back one is linked to UPS. So, I doubt that the device name will change after reboots or even if I change an HDD.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [May 21, 2024, 3:24pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/33 "2024-05-21T15:24:28Z")

</div>

> [@snorkel](#):
>
> **Corsair Flash Voyager GTX USB 3.1 128GB** (CMFVYGTX3C-128GB). It is built with 3D NAND SSD cels.

I just switched from Samsung Bar to Corsair, but 256GB model. It works with Synology DS220+. I didn’t even need to modify paths or settings. Just:

- stop nodes;
- move db-es to HDD;
- eject old stick;
- shutdown NAS;
- replace stick;
- start NAS;
- format external drive to ext4;
- move db-es back to stick (after pragma check and vacuum);
- start nodes.

That model dosen’t work with DS219+.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [September 6, 2024, 10:30am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/34 "2024-09-06T10:30:03Z")

</div>

Update about Samsung Bar with DS216+… it just died. 🤦🏻‍♂️  
I guess I will move the databases back to HDD for this Syno, because it’s USB support for newer USB SSD drives is none.  
At least I updated the RAM from 1 to 8GB, and will help a little bit with the 2x7TB nodes running on it. No lazzy, no badger, no SSD/USB cache… Will see.

For refference, the original databases location on Syno is here, if you didn’t moved them:

```auto
/volume1/Storj/storage/

```

---

<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:** [September 7, 2024, 7:20am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/35 "2024-09-07T07:20:11Z")

</div>

> [@snorkel](#):
>
> No lazzy, no badger, no SSD/USB cache… Will see.

Hm. If no lazy, then I would recommend to enable the badger cache, it would speedup all things.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [September 7, 2024, 7:28am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/36 "2024-09-07T07:28:43Z")

</div>

I will not enable the badger just to have one more thing to worrie about. And it would run on the storage drive, so I don’t know if it can hadle it.  
After system restart, the USB stick is recognised again. Syno told me that it was disconected and wasn’t present in the system. I’m wondering what happened? Phisicaly, nobody has access there to remove it, so it just dissapeared from the system. No reboots in that time. Maybe an update to a DSM component? Or the stick is just dieing.  
Anyway, I moved the db-es to HDD and won’t use an USD drive on that system.

---

<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:** [September 7, 2024, 8:00am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/37 "2024-09-07T08:00:37Z")

</div>

> [@snorkel](#):
>
> so I don’t know if it can hadle it.

From what I have now - it will. The second and next scans, also almost any filewalker would work faster.

> [@snorkel](#):
>
> After system restart, the USB stick is recognised again. Syno told me that it was disconected and wasn’t present in the system. I’m wondering what happened?

Power peak, overheat, OS error, whatever. Not all USB controllers are the same…

> [@snorkel](#):
>
> Or the stick is just dieing.

It could be possible. But I have no idea, how to check. They works until not. And then, in the best case they are read-only, or just a nice piece of plastic and silicon.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [October 3, 2024, 12:23pm UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/38 "2024-10-03T12:23:18Z")

</div>

After all the recent impruvements on storagenode behavior, is it still needed to move databases on separate drive?  
Or they work very well on the storagenode drive also?  
My expirience so far on ext4 with 2 nodes sharing 8GB RAM, both with 4TB data, is that they work. No database locks so far. My solution was to use an USB stick, but that proved to be unreliable.  
I don’t know how it will behave on 10+TB nodes, though. Anyone running them on big nodes, on the same data drive?

---

<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:** [October 4, 2024, 7:37am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/39 "2024-10-04T07:37:10Z")

</div>

I have never moved databases off the data drive, except for one time when I tried to move to Linux (yes, NTFS disk under Linux 🤦‍♂️) but had to go back to Windows due to hardware issues.  
So, probably not. But if you see errors like `database is locked`, then, well - you have no choice.

---

<div class="post-metadata">

**Author:** ![snorkel](https://storj.bcdn.literatehosting.com/letter_avatar/snorkel/32/5_5575768a8748004e209b776fc1b2916d.png) [@snorkel](https://forum.storj.io/u/snorkel)\
**Post date:** [October 4, 2024, 11:02am UTC](https://forum.storj.io/t/moving-databases-on-ssd/20045/40 "2024-10-04T11:02:15Z")

</div>

I believe those issues appear only on USB connections and maybe on very big nodes. I will try on my biggest node, to see what happens.  
For anyone who moved or plan to move the dbs on separate drive, this can lead to db cache files not flashed to main dbs on node stop. More testing is needed and it could be unrelated, but you should keep an eye on leftovers after stopping a node. I mean the .wal files and the others besides db files.

[Previous page](https://forum.storj.io/t/moving-databases-on-ssd/20045.md?page=1)
