Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sailing:storagesetup [2023/11/28 19:59] – willy | sailing:storagesetup [2024/02/06 15:25] (current) – removed willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Storage Setup ===== | ||
- | |||
- | Storage | ||
- | |||
- | As for storage, i don't like low-cost commercial external RAID solutions and i dont want to spend for a high-end commercial RAID option, i prefer to leverage Linux built-in software raid tools which have worked like a charm for me in the last 15/20 years: rock solid, never lost data and quite fast. So i have purchased an external USB-3 hard-drive enclosure that support JBOD mode (just a Bunch Of Disks) to avoid being tied to some random RAID implementation, | ||
- | |||
- | Let's assume we have /dev/sdb and /dev/sdc as your external disks. You need to partition the two disks and create one single Linux RAID partition on each of them, i will not detail here the specific commands as they are outside the scope of this guide. | ||
- | |||
- | Then it's time to create the raid array: | ||
- | |||
- | > mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 | ||
- | |||
- | format it, and mount it as /data: | ||
- | |||
- | > mkfs.ext4 /dev/md0 | ||
- | > mkdir /data | ||
- | > mount /dev/md0 /data | ||
- | |||
- | /data will be the entry point for your media collection. You will also store all the temporary files and executables for the various software stack that we will be using. | ||
- | |||
- | Your raid needs to be automatically mounted at every boot, so you need to add a line like this to /etc/fstab: | ||
- | |||
- | / | ||
- | |||
- | (the noatime option will reduce USB traffic and wear-and-tear. You might want a different filesystem maybe, do your own research) | ||
- | |||
- | You also want to automate linux raid startup: | ||
- | |||
- | > rc-update add mdraid boot | ||
- | |||
- | and, maybe, you need to ensure the md0 device doesnt change name upon reboot (it happened to me sometimes), so put this line into your / | ||
- | |||
- | ARRAY /dev/md0 UUID=1758bcfa: | ||
- | |||
- | where the UUID can be read by the output of the command: | ||
- | |||
- | > mdadm -detail /dev/md0 | ||
- | |||
- | Using the UUID ensures that even if your USB ports get shuffled around (and it happens, specially if you unplug/ | ||
- | |||
- | You need to create the individual collections entry points like: | ||
- | |||
- | > mkdir /data/Films | ||
- | > mkdir /data/Tv | ||
- | > mkdir /data/Music | ||
- | > mkdir /data/Books | ||
- | > mkdir / | ||
- | |||
- | The last one will not contain actual media, but it will be used to store the installation (or the cache folders) for the various softwares described in this page. | ||
- | |||
- | |||
- | ---- | ||
- | Next to: [[sailing: | ||
- | |||
- | Prev to: [[sailing: | ||
- | |||