# Install/move DietPi on RAID

**URL:** https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735
**Category:** General Discussion
**Created:** [25 October 2022 14:46 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735 "2022-10-25T14:46:07Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [25 October 2022 14:46 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/1 "2022-10-25T14:46:07Z")

</div>

Hi all!  
I want to use my old laptop for DietPi. Laptop has two 500Gb HDD, and i want to use them in RAID. I tried to install pure Debian 11, and it works! The md partitions is /boot and / in RAID1 and /home RAID0. Can i use the same(or similar) partition structure for DietPi? I am asking because it seems that DietPi installing not like Debian, looks like it “extracting” image to disk with whole formatting. There is an article “Moving a running DietPi system to a USB stick/disk or an onboard eMMC” in blog, can i install DietPi on USB and then just dd in to my RAID?

Thanks

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [25 October 2022 14:49 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/2 "2022-10-25T14:49:21Z")

</div>

> [@kar1kam11](#):
>
> I am asking because it seems that DietPi installing not like Debian, looks like it “extracting” image to disk with whole formatting.

Yes, that’s a typical behaviour if you flash an entire image to disc. This will overwrite existing partitions.

If you already have a plain Debian system running, you could try our install script as described on our online docs [Supported hardware - DietPi.com Docs](https://dietpi.com/docs/hardware/#make-your-own-distribution) Usually this should preserve your partition setup. Just give it a try.

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [25 October 2022 16:26 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/3 "2022-10-25T16:26:48Z")

</div>

> [@Joulinar](#):
>
> If you already have a plain Debian system running, you could try our install script as described on our online docs [Supported hardware - DietPi.com Docs](https://dietpi.com/docs/hardware/#make-your-own-distribution) Usually this should preserve your partition setup. Just give it a try.

Ooops, seems i’m to hurry to switch to testing branch 🙂  
Should i begin from the start and follow script recommendations?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [25 October 2022 16:39 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/4 "2022-10-25T16:39:22Z")

</div>

> [@kar1kam11](#):
>
> Should i begin from the start and follow script recommendations?

yes would be best as starting point.

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [26 October 2022 18:05 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/5 "2022-10-26T18:05:11Z")

</div>

after i select “Native PC” installer failed: “unable to flash bootloader: The boot drive does not contain a partition table. Aborting…”  
maybe installer does not see md partitions?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 October 2022 20:39 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/6 "2022-10-26T20:39:55Z")

</div>

Ahh I guess our installer is going to remove the `mdadm` package that is needed to use the md0 raid drive. 🤔

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [27 October 2022 06:09 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/7 "2022-10-27T06:09:42Z")

</div>

So, that mean i could`nt use md raid with DietPi at all? Or there is a plan B?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 October 2022 15:54 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/8 "2022-10-27T15:54:21Z")

</div>

@MichaIng  
can you check what options we have to preserve a `mdadm` raid during install.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [27 October 2022 16:03 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/9 "2022-10-27T16:03:28Z")

</div>

Not a trivial one I think, also AFAIK drive manager does not handle it correctly, but @StephanStS will know best.

In the installer we can check whether the root filesystem is on md partition to leave the package installed at least, but AFAIK /etc/fstab is still created wrong and requires a rework as well for RAID partitions. I’m just not sure whether the effort is worth it or whether we should instead follow a long term plan to not recreate /etc/fstab completely but only entries for those drives which are added/changed.

---

<div class="post-metadata">

### Author: ![StephanStS](https://dietpi.com/forum/user_avatar/dietpi.com/stephansts/32/2522_2.png) [@StephanStS](https://dietpi.com/forum/u/StephanStS)
#### Post date: [27 October 2022 18:25 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/10 "2022-10-27T18:25:42Z")

</div>

> [@kar1kam11](#):
>
> The md partitions is /boot and / in RAID1 and /home RAID0

Hi @kar1kam11, can you explain, what this means? Does this mean that you have two HDDs, the first is called RAID1 and contains /boot and /, the second is called RAID0 and contains /home?  
In this case you would not have a real RAID system.  
Or do you want to put both HDDs together into one RAID (/dev/md0) and merge your /, /boot and /home together on the resulting RAID system?

BTW: I often read “Never boot from a RAID disk”. The reason for that is, if your RAID fails you cannot boot anymore.

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [27 October 2022 19:04 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/11 "2022-10-27T19:04:58Z")

</div>

> [@StephanStS](#):
>
> Hi @kar1kam11, can you explain, what this means?

two 500Gb HDD’s  
on both 3 partitions (1Gb + 100Gb + 350Gb)  
/boot(1Gb) and /root(100Gb) – mirror (for redundancy) md0  
/home(350Gb + 350Gb = 700Gb) – stripe(for more space) md1  
this is just for example, size of partitions may vary, and stripe not necessarily for /home  
as tutorials in google say’s – grub should not be installed directly in md0, but on /dev/sda AND /dev/sdb instead

> [@MichaIng](#):
>
> I’m just not sure whether the effort is worth it or whether we should instead follow a long term plan to not recreate /etc/fstab completely but only entries for those drives which are added/changed.

So, does this mean that there is no “Plan B”? And cloning DietPi from USB to Raid won’t work? I mean that i tried to google and doesn’t found any solution, seems no one use Raid in DietPi.  
Don’t get me wrong, but if it takes much time to implement raid support in DietPi, and only me would use it, maybe it’s better for me to switch to another distro? Like Ubuntu server + cockpit + porteiner, etc.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 October 2022 19:08 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/12 "2022-10-27T19:08:09Z")

</div>

Yeah, far easier would be to run the OS from a normal disc and just have data moved to the raid 🙄

BTW: is this a software raid or managed by the laptop/hardware?

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [27 October 2022 19:16 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/13 "2022-10-27T19:16:44Z")

</div>

> [@Joulinar](#):
>
> Yeah, far easier would be to run the OS from a normal disc and just have data moved to the raid 🙄

You mean install DietPi to USB, then boot from another live USB, create partitions and raid on HDD’s, and then ‘dd’ partitions from DietPi USB to raid on HDD’s ?

> [@Joulinar](#):
>
> BTW: is this a software raid or managed by the laptop/hardware?

software raid  
laptop has option like “Intel matrix raid”, but this is “fake” raid

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 October 2022 19:28 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/14 "2022-10-27T19:28:56Z")

</div>

currently we are discussing your setup on a phone conference 😉

We are wondering, what you planning to use `/home` for? Because on DietPi we don’t use it. We try to have data stored on `/mnt/dietpi_userdata/` as much as possible. And this one could be moved to a fresh raid after system has finished initial setup completely.

As well what should be the benefit of having `/boot` and `/root` split into different partitions? At the end, they are located on same physical disk as well as on same `md0` raid drive?

🤔

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [27 October 2022 19:41 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/15 "2022-10-27T19:41:05Z")

</div>

> [@Joulinar](#):
>
> We are wondering, what you planning to use `/home` for?

Ok ok, `/home` is for example, let it be ‘/data’ or whatever. The main idea is one partition(350+350=700) for storing some unnecessarily files. Yes, i know, i can use LVM, but i decide to use stripe raid, because why not 🙂

> [@Joulinar](#):
>
> As well what should be the benefit of having `/boot` and `/root` split into different partitions? At the end, they are located on same physical disk as well as on same `md0` raid drive?

If i understand correct, grub can’t be installed on raid partition, the OS won’t boot. So, as tutorial say, on the last step debian installation, i should install grub on /boot partitions on BOTH physical disks, not on md raid.

> **[Debian Installation with LVM RAID 1 and Hot Spare – TuxFixer.com](https://tuxfixer.com/debian-installation-with-lvm-raid-1-and-hot-spare/)**
>
> How to install Debian 11 (Bullseye) with LVM and software RAID 1 (Mirroring) and additional Hot Spare Drive.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 October 2022 19:45 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/16 "2022-10-27T19:45:57Z")

</div>

ahh `/boot` is not part of the raid, while `/root` is `md0` and rest should go to `md1` (data)

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [27 October 2022 20:00 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/17 "2022-10-27T20:00:53Z")

</div>

yep, something like this  
/boot partition, but not a part of raid (I misspoke earlier, sorry.)  
/root partition - part of the mirror raid  
/another\_partition - part of the stripe raid, for storing some data (for SMB share, etc)  
This work’s with Debian installation, and not with DietPi. I want to find easy solution to fix this, but i can’t figure how ☹

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [27 October 2022 20:07 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/18 "2022-10-27T20:07:36Z")

</div>

yeah, the `dietpi-installer` is simply going to remove the `mdadm` package. Actually, our developer is working on an update for the installer to actively check for disk type `raid` and if detected to keep `mdadm` package installed

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [27 October 2022 20:05 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/19 "2022-10-27T20:05:54Z")

</div>

Could be tested with installer from `dev` branch: [v8.11 · MichaIng/DietPi@6184eeb · GitHub](https://github.com/MichaIng/DietPi/commit/6184eeb)  
`dietpi-drive_manager` should not break the `/etc/fstab` as I thought first.

---

<div class="post-metadata">

### Author: ![kar1kam11](https://dietpi.com/forum/user_avatar/dietpi.com/kar1kam11/32/2844_2.png) [@kar1kam11](https://dietpi.com/forum/u/kar1kam11)
#### Post date: [27 October 2022 20:24 UTC](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735/20 "2022-10-27T20:24:25Z")

</div>

That’s great! I will wait for an update, hope it will be useful to someone else except me.

[Next page](https://dietpi.com/forum/t/install-move-dietpi-on-raid/14735.md?page=2)
