Configured USB Swap and Booting Error

Hi,

I have an unused USB key that I don’t care about multiple writes to, and thought I’d use as swap space rather than a file on the USB stick on which I run nextcloudpi on an rpi 3B+.

I partitioned the USB into 4 equal swap spaces, then tried running them temporarily. Once all were working fine, I added the following lines to /etc/fstab to give each higher priority than /var/swap:

/dev/sdc1 swap swap defaults,pri=5 0 0
/dev/sdc2 swap swap defaults,pri=4 0 0
/dev/sdc3 swap swap defaults,pri=3 0 0
/dev/sdc4 swap swap defaults,pri=2 0 0

All seemed fine, but on reboot, my system wouldn’t load. I tried unplugging this USB drive, and lo and behold, it booted without problem. While it is now running fine, swapon -s shows /dev/zram0, /dev/zram1, /dev/zram2, and /dev/zram3 (which didn’t exist before) getting priority over /var/swap

  1. What have I done wrong/what can I do to recognize this extra swap on boot?
  2. If I use UUID info instead of /dev/sdc# in fstab, will this resolve the latter problem (or both problems)? Barring no other input on any crucial missing steps, this would be my next attempt.

Thanks in advance!

Do not use USB thumb drives. They wear out.
Also, 3b+ is a terrible platform for Nextcloud. So many caveats. Check the docs for why:

https://pant.github.io/nextcloudpi-test-docs/en_Why-is-my-Pi-so-slow.html

Thanks. I don’t mind if it wears out though. I have several 4gb thumb drives and don’t mind at all if they wear out as they are doing nothing else for me at the moment. Might as well add to swap and boost performance.

Any thoughts on how to fix this and let it boot with this swap, even if likely to wear out my swap-usb-stick, only to need periodic replacement?

More usb will add no notable performance, just as stated in the documentation linked that the maximum bus speed is 25mb total. It will be the same terrible performance with or without swap. It is the minimum spec to run Nextcloud at all, just to have it even log in for one person.

Good luck with it.