-1

I trying move swap file to USB flash from SD card it work fine but after rebooting swap file falls off, command free -m show swap is 0

I move swap file to USB flash

  1. dphys-swapfile swapoff
  2. dphys-swapfile uninstall
  3. edit file /etc/dphys-swapfile set variable CONF_SWAPFILE=/media/usb/swap.file
  4. dphys-swapfile setup
  5. dphys-swapfile swapon

in fstab mount USB flash UUID=uuid /media/usb ext4 nofail defaults, 0 0

but after reboot swap file falls

Besha
  • 1
  • 1

1 Answers1

0

It could be when your SD card is reaching the end of its life that it is internally switching to readonly mode and that your changes on it (in the /etc/dphys-swapfile) are lost at reboot. It is a common phenomen with SD cards according to here: https://forums.raspberrypi.com/viewtopic.php?f=28&t=76351