I have LAMP installed on my Raspbian, and I'm worried that logs and database can damage my SDcard too quickly. I have also external hard drives connected with USB and formatted with ext4. I don't want to modify/resize partitions on my hdd, but want to migrate /var/ and maybe /home/ to that external hard drive.
I would prefer to use fstab for this, but I'm not sure what exactly statement should I use. Another option would be to create symbolic link of old location to new location, but in that case if I remove external drive, original /var/ will be completely not accessible there will be only broken symbolic link. While in first solution if mounting will fail, content of original /var/ (from SD card) will be accessible.
Could anyone help me with this, please? Thanks :