1

I've got a Pi 4b that is booting/running from a ssd and running some home automation software (Home Assistant) that creates backups and places them in /usr/share/hassio/backup. This location for the backups cannot be changed.

I've added a usb drive that I would like to place the backups on, so that if the SSD fails I still have the backups. I removed all the backups from the backup folder and then mounted my usb drive with sudo mount /dev/sdb1 /usr/share/hassio/backup to the backup folder with the aim of having backups now being stored on the usb drive rather than the primary ssd device.

However, when files are added to /usr/share/hassio/backup, I can see via df -h that the files are actually being placed on the SSD and not the usb drive.

Am I approaching this wrong or have I missed an important step?

Any suggestions would be appreciated.

Thanks.

8
  • You may be mistaken about about something; edit in the output of mount (no args) and detail why you believe the df -h output proves what you think it does. That said, I'd guess that the issue is that the software using that directory was already running when you mounted the drive, and is using previously opened handles. Those will be for stuff "underneath" the mount point (the non-mounted directory still exists but is conventionally unreachable while there's something mounted there -- except for already open files). – goldilocks Jan 28 at 22:32
  • @goldilocks The reason I say data is added to the SSD and not usb is because prior to adding the usb mount I removed the contents of the backup folder. Then once I'd mounted the usb drive I added the backup files back to the backup folder. I used df -h during all these and could see that the used space on the ssd increased whereas the values for the usb drive remained the same. – Phill Healey Jan 29 at 12:13
  • @goldilocks mount returns pages of stuff since I have docker running too. Is there specific bit of info that your are needing? – Phill Healey Jan 29 at 12:16
  • @goldilocks Also if I add files to the smb share setup for this folder all goes great. If I then use the cli to view the contents of the folder it shows no files at all. If I then umount the device and again view the contents via the cli I now see all the files that are visible in the share. SO, it would appear that for whatever reason that files are being added to the underlying filesystem of that directory and not in the mounted usb drive that is being mounted on that same folder. Could the fact that this folder/share is attached to a docker container be the issue? – Phill Healey Jan 29 at 14:04
  • 1
    It'd probably be better if you did it yourself as I am not exactly sure which issue it was (presumably not mounted when application started?). – goldilocks Jan 29 at 17:46
1

The solution was to simply set the mount to be active from boot via fstab. Then after rebooting the system all files added to the mount folder were added to the mounted usb drive and not the underlying ssd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.