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

59 views
Skip to first unread message

Tarmo Kuuse

unread,
Jan 19, 2017, 7:14:10 AM1/19/17
to BeagleBoard
Hi!

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.

On second boot something allocates /var/swap.img and installs it as swap in fstab. This seems to happen right after the root filesystem is remounted. dmesg says:

[   31.270174] EXT4-fs (mmcblk1p1): re-mounted. Opts: errors=remount-ro
[   31.717598] Adding 262140k swap on /var/swap.img.  Priority:-1 extents:10 across:745468k SSFS

I'd really like to snip that. Any hints where to look?

--
Kind regards,
Tarmo Kuuse

William Hermans

unread,
Jan 19, 2017, 9:12:24 AM1/19/17
to beagl...@googlegroups.com
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.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/407e8b17-78dc-407e-94cf-106e56098a37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Jan 19, 2017, 9:16:10 AM1/19/17
to beagl...@googlegroups.com
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

Robert Nelson

unread,
Jan 19, 2017, 9:45:36 AM1/19/17
to Beagle Board
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)

Regards,

--
Robert Nelson
https://rcn-ee.com/

William Hermans

unread,
Jan 19, 2017, 10:06:01 AM1/19/17
to beagl...@googlegroups.com


On Thu, Jan 19, 2017 at 7:44 AM, Robert Nelson <robert...@gmail.com> wrote:
>
>
> 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)
>
> Regards,
>
> --
> Robert Nelson
> https://rcn-ee.com/

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.


Robert Nelson

unread,
Jan 19, 2017, 10:54:45 AM1/19/17
to Beagle Board
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

Robert Nelson

unread,
Jan 19, 2017, 10:56:34 AM1/19/17
to Beagle Board
other then enabling that module, zram is currently un-used..

https://wiki.gentoo.org/wiki/Zram

Tarmo Kuuse

unread,
Jan 20, 2017, 3:53:22 AM1/20/17
to BeagleBoard
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

--
Kind regards,
Tarmo Kuuse

Tarmo Kuuse

unread,
Jan 20, 2017, 4:11:45 AM1/20/17
to BeagleBoard
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.

--
Kind regards,
Tarmo Kuuse
Reply all
Reply to author
Forward
0 new messages