I read here that SD cards can be worn, so I am looking for an alternative that I can use 7/24 for a web server. Is a simple usb stick good for this purpose? Can I boot from that?
You should use hight quality SD cards so it will not worn out too fast.
But if you are still worried, you could add a USB disk and only use the USB card to boot the machine and use the disk for all other things.
- Use the external USB disk as root partitions and other and only use SD card as a boot device, but store all data on USB disk.
- Use the external USB disk as data disk, but keep the root partition on SD card. So use USB disk with partitions for
/srv(created for servers storage) and others.
Basicly you can do those steps in this way:
- I you want root file system on the hard disc, change the file
cmdline.txtin the SD card to boot from a root (
/) partition on the USB hard disk. Change the
boot=part in the line with
- Create the partitions you need on the USB disk, like partitions for file systems for
/srvetc. If you changed
cmdline.txtyou need to create a new
/partition and then copy all files from the SD card root file system. I reccomend the use of
rsyncto do that.
- In the
/etc/fstabin the root file system (on SD card or the USB disk) configure so the file systems on the USB disk is mounted. You should probably use partitions
UUID=instead of device names because the device names can change between boot.
Try to reboot with the machines. Doing this from top of my head, so look at this like a out line of the procedure.
you should not worry about SD card replacement when using it in a web server, it should last a few years, if your usage patterns are not too extreme.
You can use the branded SanDisc Pro/Ultra cards or Samsung "waterproof" SD cards. USB can be used as a storage but. I don't know can you boot from USB.