# Hotswap hard drive to work with Syncthing

**URL:** https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424
**Category:** General Discussion
**Tags:** external-server
**Created:** [30 December 2022 08:39 UTC](https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424 "2022-12-30T08:39:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [30 December 2022 08:39 UTC](https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424/1 "2022-12-30T08:39:36Z")

</div>

Is there a way to make a hard drive “hot swappable?”

I have a hard drive I use on the road to back up videos. At night I want to plug it into my dietpi, have the pi recognize it, and Syncthing to start Syncing with my home hard drive. In the morning, unplug the hard drive and take it with me.

Preferable no intervention other than plug and unplug.

Possible?

---

<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: [30 December 2022 11:12 UTC](https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424/2 "2022-12-30T11:12:54Z")

</div>

Theoretical this might be possible, but you will need to setup own udev rules to trigger specific actions if the HDD gets connected.

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [30 December 2022 11:44 UTC](https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424/3 "2022-12-30T11:44:45Z")

</div>

That is good news! Do these steps look appropriate?

[https://andreafortuna.org/2019/06/26/automount-usb-devices-on-linux-using-udev-and-systemd/](https://andreafortuna.org/2019/06/26/automount-usb-devices-on-linux-using-udev-and-systemd/)

---

<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: [30 December 2022 12:45 UTC](https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424/4 "2022-12-30T12:45:08Z")

</div>

That might be a good starting point. But you need to take it with care. Some parts like desktop notification might not be needed. As well mount point would need to be adjusted on your needs. And finally the clean up during unmount would need to be reviewed.

---

<div class="post-metadata">

### Author: ![jonyskids](https://dietpi.com/forum/user_avatar/dietpi.com/jonyskids/32/2056_2.png) [@jonyskids](https://dietpi.com/forum/u/jonyskids)
#### Post date: [30 December 2022 13:17 UTC](https://dietpi.com/forum/t/hotswap-hard-drive-to-work-with-syncthing/15424/5 "2022-12-30T13:17:20Z")

</div>

Thanks so much for the input! Happy Holidays.
