Date: Wed, 11 Dec 2019 20:43:55 +0100 From: Polytropon <freebsd@edvax.de> To: CyberLeo Kitsana <cyberleo@cyberleo.net> Cc: freebsd-questions@freebsd.org Subject: Re: Cross-compiling with go for arm on amd64. Possible? Message-ID: <20191211204355.5067531f.freebsd@edvax.de> In-Reply-To: <ef2fafd2-4d44-1884-b7a2-8ff1bd622e17@cyberleo.net> References: <mailman.73.1575979201.5391.freebsd-questions@freebsd.org> <20191210152323.GA47078@thismonkey.com> <ef2fafd2-4d44-1884-b7a2-8ff1bd622e17@cyberleo.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 11 Dec 2019 13:01:06 -0600, CyberLeo Kitsana wrote: > On 12/10/19 9:23 AM, Scott Aitken wrote: > <snip>> rather than the dd I did: > > # truncate -s 512M /var/swapfile > > # ls -als /var/swapfile > > 96 -rw-r--r-- 1 root wheel 536870912 Dec 11 02:08 /var/swapfile > > > > The fstab info was very helpful, thanks. I've now got a 512M swapfile. > > Don't use truncate(1) to create swapfiles. On filesystems that support > sparse files, it will not allocate any space on the underlying > filesystem. This can lead to a deadlock if the kernel attempts to swap > and the filesystem runs out of space to allocate. It can also lead to > extreme fragmentation, but that's not much of an issue on flash storage. How about this? /etc/rc.local: -------------- SWAP="/ssdswap" /bin/rm -f $SWAP /bin/dd if=/dev/zero of=$SWAP bs=16m seek=500 count=0 /sbin/mdconfig -a -t vnode -u 0 -f $SWAP || /bin/sh /bin/chflags nodump $SWAP /bin/rm $SWAP /sbin/swapctl -a /dev/md0 echo -n " swap" /etc/rc.shutdown.local: ----------------------- /sbin/swapctl -d /dev/md0 > /dev/null 2>&1 /sbin/mdconfig -d -u 0 echo -n " swap" This is an untypical and strange method of creating "swap file on demand" on early SSDs (historically grown), but it works. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191211204355.5067531f.freebsd>