0

I'v added a flash drive as swap and formated it with code 82 (Swap). Additionally, I've added the uuid (out of blkid) to /etc/fstab. After reboot I see that no swap is being used.

What's wrong?

pi@raspberrypi:/mnt/usbstick $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    1  57.9G  0 disk
└─sda1        8:1    1  57.9G  0 part [SWAP]
sdb           8:16   1 233.3G  0 disk
└─sdb1        8:17   1 233.3G  0 part /mnt/usbstick
mmcblk0     179:0    0  59.5G  0 disk
├─mmcblk0p1 179:1    0   256M  0 part /boot
└─mmcblk0p2 179:2    0    24G  0 part /

Output of swapon

pi@raspberrypi:/mnt/usbstick $ sudo swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda1                               partition       60652540        0       -2

Before changing that, my swap was continuously at 100 / 100 MB. I expected to see at least that amount of used memory.

amw
  • 173
  • 7
  • It appears to me that you have about 60 GB of swap space on your flash drive. What did you expect? I have to say that using a flash drive for swap does not sound like a good idea to me...writes are very slow. – Elliot Alderson Jul 24 '21 at 17:46
  • I had two motivations: Swap was always full (100 MB) while reading that twice the phsical memory is recommended and I wanted to limit the write access to the sd card. This lead me to the idea to use a pen drive as swap. That 60 GB flash drive was simple available and not in use, so I took it, even tough it seems much to large. Speed is not that issue. What I miss is, that the swap is actually being used. – amw Jul 24 '21 at 19:03
  • What does free say about memory use? – Elliot Alderson Jul 24 '21 at 19:44
  • pi@raspberrypi:~ $ free -h total used free shared buff/cache available Mem: 924Mi 286Mi 201Mi 8.0Mi 436Mi 545Mi Swap: 57Gi 199Mi 57Gi Seems that swap is now in use and this question is obsolete. Does that look fine from your perspective? @ElliotAlderson – amw Jul 25 '21 at 07:10
  • 1
    It does look like your swap is working. Good luck! – Elliot Alderson Jul 25 '21 at 11:34

0 Answers0