# Re-create a /boot filesystem on microSD for a Pioneer with root file system on HDD

**URL:** <https://discuss.freedombox.org/t/re-create-a-boot-filesystem-on-microsd-for-a-pioneer-with-root-file-system-on-hdd/2781>\
**Category:** Hardware Owners Support\
**Created:** [October 29, 2023, 10:44am UTC](https://discuss.freedombox.org/t/re-create-a-boot-filesystem-on-microsd-for-a-pioneer-with-root-file-system-on-hdd/2781 "2023-10-29T10:44:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avron](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/a/a9adbd/32.png) [@Avron](https://discuss.freedombox.org/u/Avron)\
**Post date:** [October 29, 2023, 10:44am UTC](https://discuss.freedombox.org/t/re-create-a-boot-filesystem-on-microsd-for-a-pioneer-with-root-file-system-on-hdd/2781/1 "2023-10-29T10:44:27Z")

</div>

My Pioneer with HDD went out of control several times, I have to remove the power and put it back.

The root file system was previously moved to the HDD with `btfrs replace`, so only the /boot file system is on the microSD card. SInce it was shutdown brutally, I decided to put the microSD card into a card reader and run fsck.ext2. I tried some repair operations but following that, the Pioneer won’t boot anymore.

What would be the way to recreate a clean /boot file system on the microSD card, in order to reuse the root file system on the HDD?

---

<div class="post-metadata">

**Author:** ![jonny](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/j/47e85d/32.png) [@jonny](https://discuss.freedombox.org/u/jonny)\
**Post date:** [October 30, 2023, 10:20am UTC](https://discuss.freedombox.org/t/re-create-a-boot-filesystem-on-microsd-for-a-pioneer-with-root-file-system-on-hdd/2781/2 "2023-10-30T10:20:50Z")

</div>

Hmm, I guess I’d take a fresh FB image bring it up to date and use its boot partition for your microSD - maybe using `partclone` or `dd`.

---

<div class="post-metadata">

**Author:** ![Avron](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/a/a9adbd/32.png) [@Avron](https://discuss.freedombox.org/u/Avron)\
**Post date:** [December 22, 2023, 8:13pm UTC](https://discuss.freedombox.org/t/re-create-a-boot-filesystem-on-microsd-for-a-pioneer-with-root-file-system-on-hdd/2781/3 "2023-12-22T20:13:53Z")

</div>

I finally did it:

- I have setup a fresh freedombox image, then, as root
- I mounted the ssd: `udisksctl -b mount /dev/sda`
- in `/etc/fstab` (i.e. from the microSD), I replace the UUID of the btfrs file system with the UUID of the btrfs file system found in `/media/root/someUUID/etc/fstab`
- in `/media/root/someUUID/etc/fstab`, I replaced the UUID of the ext2 file system with the UUID of the ext2 file system found in `/etc/fstab`
- I ran `update-initramfs -u`
- I rebooted (via plinth)

I have read in some place that one would also need to also update `/etc/default/flash-kernel` but the rootfs on the HDD had nothing special, so I did nothing. So far, it seems to work.
