Which script allocates /var/swap.img on second boot?


I flashed an rcn-ee image into eMMC (bone-debian-8.7-seeed-iot-armhf-2017-01-15-4gb.img.xz). On first boot there’s no swap anywhere.

So . . .

root@beaglebone:~# systemctl status generic-board-startup.service
● generic-board-startup.service - Generic Board Startup
Loaded: loaded (/lib/systemd/system/generic-board-startup.service; disabled; vendor preset: enabled)
Active: inactive (dead)

This service is responsible for starting up the scripts in /opt/scripts/boot. Personally, I disable it because it loads things I don’t want running. I do believe that one of the scripts in /opt/scripts/boot “mentions” swap. So you can start by looking through those.

By the way, if you use USB networking. Don’t disable this service, and don’t move, or delete any of the scripts in /opt/scripts/boot

Me too...

It's definitely not something i added to the default images by default..

Are you sure you didn't enable it yourself?

(doesn't even run swap on my debian x86 development machine)


Is this possibly related to zram ? I noticed that zram is in the kernel I use. While not strictly speaking only for swap disks in memory. Many seem to relate zram to doubling their memory by running a compressed swap disk in RAM.

flashed bone-debian-8.7-seeed-iot-armhf-2017-01-15-4gb.img.xz

after a few reboot's still no random swap file...

root@beaglebone:~# journalctl | grep swap
May 21 22:31:30 beaglebone kernel: zswap: loaded using pool lzo/zbud


other then enabling that module, zram is currently un-used..



It turns out that systemd is configured to maintain a swap file. This is what I did to make it stop:

List systemd-s swap units:
$ sudo systemctl --type swap

Disable a swap unit named “var-swap.img.swap”:
$ sudo systemctl mask var-swap.img.swap

Aaaaand of course swap is set up by one of our ansible configuration scripts which I didn’t grep out initially.

Sorry for the confusion. Robert’s images don’t install swap.