# How to setup RAID

**URL:** https://discuss.freedombox.org/t/how-to-setup-raid/1401
**Category:** Hardware Owners Support
**Created:** [February 8, 2021, 2:15pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401 "2021-02-08T14:15:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 8, 2021, 2:15pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/1 "2021-02-08T14:15:41Z")

</div>

- Freedombox is plugged into AVM Fritzbox 7590 Router at home.
- Ordered it on 2021-01-06
- “About”: You are running Debian GNU/Linux 10 (buster) and FreedomBox version 21.1. FreedomBox is up to date.

Hi,  
I have a question regarding RAID and didn’t find any useful information on the web. I’ve successfully attached 2 extern 1TB hard disks and formatted them to ext3:

```
Mounted /dev/sda1 at /media/root/BACKUP2 on behalf of uid 0
Mounted /dev/sdb1 at /media/root/BACKUP1 on behalf of uid 0

```

I had the drives formatted as ext4 before but then had a lot of write access on that drives. However, I seem not to be able to setup RAID, When I click on the PLUS-Button to configure RAID, it says: ‘No disks are available’, no matter how the disks are formatted or being mounted or not.  
How is one supposed to setup a RAID1 on that box? Is there documentation available somewhere? What requirements are needed?  
Regards Oliver

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 8, 2021, 2:41pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/2 "2021-02-08T14:41:30Z")

</div>

What button are you talking about?

If you would like the disks to spin-down when idle and have the data checksummed (and allow for snapshot send/receive backups!), and possibly compress the data on the fly, you could consider formatting a BTRFS raid1 with mulitple devices, and mounting it with `noatime`.

BTRFS guide:

- [Using Btrfs with Multiple Devices - btrfs Wiki](https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices)
- [Gotchas - btrfs Wiki](https://btrfs.wiki.kernel.org/index.php/Gotchas)

Related but not btrfs specific issues:

> **[device bus resets (data loss) with perfecly working disks (bus / scterc...](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2043)**
>
> The default hardware bus timeout is so short (30sec) that it causes bus resets before usual storage devices are done with their error correction, and return with success,...

> **[smartd: no selftests scheduled (#2040) · Issues · FreedomBox / FreedomBox](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2040)**
>
> The default configuration of smartd already works, but does not run any self tests, however only the tests are said to have a chance to successfully warn before...

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 8, 2021, 7:40pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/3 "2021-02-08T19:40:39Z")

</div>

Btrfs would also support to scrub (verify) the raid array.

> **[btrfs: missing btrfsmaintenance configuration (#2038) · Issues · FreedomBox /...](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2038)**
>
> It's not recommended to mount with discard (continuous trim mount option), but instead systems need to run periodic trim and scrub jobs. Debian has the package...

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 8, 2021, 8:06pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/4 "2021-02-08T20:06:09Z")

</div>

Ah, sorry, I was talking about the Cockpit app. On the Storage page there is a + Sign in the upper right corner, right next to the title ‘RAID devices’. When I click on it, a dialog box opens and there it says ‘No disks are available’.  
What do you mean by snapshot send/receive backups?  
Mainly I bought this pioneer in the hope of a replacement of my old NSLU2, which unfortunetaly died a couple of weeks ago after working for about 13 years. I used this box mainly as a backup device for some computers in my home network (My own and family) and for storing photos, videos, music and so on. The NSLU2 worked as an NFS and had 2 hard disks attached and was configured to clone one disk to the other once a week.  
I’m quite a noob when it comes to freedombox but willing to experiment.  
Gonna try the links @NickA provided and see if I can get on.

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 8, 2021, 8:31pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/5 "2021-02-08T20:31:50Z")

</div>

Oh, there it’s hidden, never saw it. That would be md raid without checksuming, though.

Btrfs supports taking snapshots, and also to “send” the snapshots to remote locations or to another local btrfs disk (backup clone). The transfer is extremely efficient and fast.

There are many tools for taking, sending and expiring snapshots, but I have not compared them.  
This example has some further explanations: [Easy sync BTRFS snapshots with btrfs-sync – Own your bits](https://ownyourbits.com/2018/03/09/easy-sync-of-btrfs-snapshots-with-btrfs-sync/)

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 8, 2021, 9:33pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/6 "2021-02-08T21:33:05Z")

</div>

With md, you would mean `mdadm`, right?  
On the command line, I would first create partitions on my hard disks with `parted`, mark them as RAID-partitions, set up RAID with `mdadm` and then create a file system on the RAID.  
How is this supposed to be working within Cockpit?  
Anyway, after having read a bit, I’d like to go the btrfs road and I’m going to come back here if it works (or not)…  
Thank you for listening!

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 8, 2021, 10:26pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/7 "2021-02-08T22:26:44Z")

</div>

Just make sure not to use a sdcard for the freedombox system disk, as freedombox is not designed to conserve them like openwrt, they fail way too quickly.

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 9, 2021, 10:35am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/8 "2021-02-09T10:35:12Z")

</div>

The `mdadm`, yes. but sorry, I don’t know about cockpit.

What I found with btrfs is that depending on snapshot preferences, and whether using a SSD or HD, there are some beneficial config adjustments to do for the default (btrfs) rootfilesystem.

> **[btrfs: excessive disk writes (amplification) (#2034) · Issues · FreedomBox /...](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2034)**
>
> Mount options: Mount with noatime (instead of just relatime), to avoid all writing when reading. The btrfs mount...

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 9, 2021, 11:12am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/9 "2021-02-09T11:12:13Z")

</div>

How did you get cockpit to work, by the way? → [[buster] cockpit: not authorized to perform operation (#2033) · Issues · FreedomBox / FreedomBox · GitLab](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2033)

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 9, 2021, 12:31pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/10 "2021-02-09T12:31:12Z")

</div>

> [@NickA](#):
>
> How did you get cockpit to work, by the way? → [[buster] cockpit: not authorized to perform operation (#2033) · Issues · FreedomBox / FreedomBox · GitLab](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2033)

I stumbled over exactly the same authorization problem and finally logged in as fbx after setting up a password for that user.

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 9, 2021, 12:43pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/11 "2021-02-09T12:43:58Z")

</div>

> [@NickA](#):
>
> Just make sure not to use a sdcard for the freedombox system disk, as freedombox is not designed to conserve them like openwrt, they fail way too quickly.

That makes me feel unsure:

> The kit includes the A20-OlinuXino-LIME2, a custom metal case with a laser-engraved FreedomBox logo, a high-speed 32GB micro SD card with the FreedomBox software pre-installed, a backup battery, a power adapter, and an ethernet cable.

That’s exactly how I bought the [Pioneer-FreedomBox-HSK](https://www.olimex.com/Products/OLinuXino/Home-Server/Pioneer-FreedomBox-HSK/), so I assume the sd card IS definitely the system disk.  
How else would that work?

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 9, 2021, 2:18pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/12 "2021-02-09T14:18:17Z")

</div>

I would expect usual sdcards to sustain [above writes issues](https://salsa.debian.org/freedombox-team/freedombox/-/issues/2034) only for months.

Everyone who wants the system to last longer will currently either have to deal with the workarounds in

> **[install/mv system to SSD with btrfs replace or (fallback) boot single mode +...](https://salsa.debian.org/freedombox-team/freedombox/-/issues/435)**
>
> Idea is to use "btrfs replace" to move the FreedomBox system to another storage device (like SSD). For non-btrfs systems, reboot to a temporary script that...

or

> **[Evaluate providing F2FS images as well (#1905) · Issues · FreedomBox /...](https://salsa.debian.org/freedombox-team/freedombox/-/issues/1905)**
>
> See the benefits for flash memory / SD cards: https://en.wikipedia.org/wiki/F2FS (EDIT qa-nick-guest:) And see the results from:

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 9, 2021, 2:23pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/13 "2021-02-09T14:23:10Z")

</div>

Well, or use the sdcard with [minimized writes](https://discuss.freedombox.org/t/root-filesystem-completely-in-ram-only-data-mounts/904), like the OpenWrt or MX Linux “frugal” base system.

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 9, 2021, 2:37pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/14 "2021-02-09T14:37:20Z")

</div>

Thank you for the hints.

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 9, 2021, 9:48pm UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/15 "2021-02-09T21:48:27Z")

</div>

So, my best bet would be to buy an additional storage add-on with a ssd , connect it to the SATA port and follow the instructions in the freedombox manual to setup the system on this disk. I will consider this.

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 10, 2021, 9:55am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/16 "2021-02-10T09:55:45Z")

</div>

For a NAS setup, the openwrt image should work ok directly from the sdcard and always be able to cleanly reboot into the RAM after power outages. I don’t know if your device can boot from sata or usb. If it can, then you could try writing the freedombox image to that device, otherwise you could start with booting the sdcard and move the running btrfs root filesystem over to another drive (like in the issue posted above), while keeping the boot loader on the sdcard.

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 11, 2021, 9:13am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/17 "2021-02-11T09:13:19Z")

</div>

I own the Pioneer Edition FreedomBox Home Server Kit (A20-OlinuXino-LIME2) from Olimex. They also sell a BAY-SSD-xxxGB metal enclosure. Pioneer-FreedomBox-HSK supports BAY-HDD/SSD and when assembled the external storage is seen as additional disk.  
What’s unclear to me is if this also means the system can boot from that disk.  
I don’t quite understand how openwrt fits in that picture. As I understand it, freedombox is almost plain debian with freedombox packages installed. If I go the openwrt route, freedombox is not possible anymore, so I have to follow the docs [here](https://openwrt.org/docs/guide-user/start) to roll my own services.

---

<div class="post-metadata">

### Author: ![oliverbienert](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/oliverbienert/32/523_2.png) [@oliverbienert](https://discuss.freedombox.org/u/oliverbienert)
#### Post date: [February 11, 2021, 9:28am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/18 "2021-02-11T09:28:52Z")

</div>

Well, I found a promising answer in the olimex forum:

> **[Boot or /root on SATA without SPI](https://www.olimex.com/forum/index.php?topic=7975.msg30009#msg30009)**
>
> Boot or /root on SATA without SPI

So it should be possible to boot from ssd. Now I have to find the time to to do this.

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 11, 2021, 9:29am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/19 "2021-02-11T09:29:24Z")

</div>

Someone who knows your device would have to answer about its boot features.

I mentioned openwrt because it boots local adjustments to its readonly squashfs from F2FS into a RAM overlayfs (minimizing sdcard wear and corruption on power interruption). And you would have to manually fix the mentioned issues in freedombox also, anyway. So for just btrfs+sshserver-sftp-server the effort seems about the same.

---

<div class="post-metadata">

### Author: ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)
#### Post date: [February 11, 2021, 9:45am UTC](https://discuss.freedombox.org/t/how-to-setup-raid/1401/20 "2021-02-11T09:45:29Z")

</div>

That sounds like the freedombox workaround from the “move system to SSD” issue could work for you (leaving only the boot loader on sdcard).

[Next page](https://discuss.freedombox.org/t/how-to-setup-raid/1401.md?page=2)
