Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Killing is stupid; useless! -- McCoy, "A Private Little War", stardate 4211.8


computers / alt.os.linux.mint / Re: Disused swap file?

SubjectAuthor
* Disused swap file?Handsome Jack
+- Re: Disused swap file?yossarian
+* Re: Disused swap file?Paul
|`- Re: Disused swap file?Big Al
+- Re: Disused swap file?Killadebug
`* Re: Disused swap file?Monsieur
 `* Re: Disused swap file?Nic
  +* Re: Disused swap file?Handsome Jack
  |`* Re: Disused swap file?Paul
  | +- Re: Disused swap file?Handsome Jack
  | `* Re: Disused swap file?Big Al
  |  `- Re: Disused swap file?Paul
  `* Re: Disused swap file?Monsieur
   `- Re: Disused swap file?Handsome Jack

1
Disused swap file?

<uljs0l$2c6jn$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7285&group=alt.os.linux.mint#7285

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!nntp.comgw.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Jac...@handsome.com (Handsome Jack)
Newsgroups: alt.os.linux.mint
Subject: Disused swap file?
Date: Sat, 16 Dec 2023 09:52:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <uljs0l$2c6jn$1@dont-email.me>
Injection-Date: Sat, 16 Dec 2023 09:52:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7f8b622f26e93b018c9e01a4103ffed3";
logging-data="2497143"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ijVQuH+MqN8OCFcHfCapKsB5Jb80vwWI="
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-87-generic (x86_64))
Cancel-Lock: sha1:bLY21RCkjS8wvqs6rdUg772WXoo=
 by: Handsome Jack - Sat, 16 Dec 2023 09:52 UTC

In my root directory I have a 2Gbyte file called 'swapfile'. According to the file manager it hasn't been updated since September 2021, which is roughly when I first installed Linux.

Am I right in thinking that this file is the residue of a crash or other incident that occurred during the installation, and which I've now forgotten all about or never noticed? Can I safely delete it? Two gigs is a significant bit of disk space, especially as just about everything I install in LM seems to tell me it will need 999 Mbytes of disk. I don't know what the world's coming to ... when I used to write programs you had to fit them in 4k ...

Re: Disused swap file?

<20231216115750.33de1692@white>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7286&group=alt.os.linux.mint#7286

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 11:57:50 +0100
Lines: 16
Message-ID: <20231216115750.33de1692@white>
References: <uljs0l$2c6jn$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: individual.net I1GhQX127sOpN5nOZZfKWQjQGu//PBI0taHBB9cW95BSoZ/TG7
Cancel-Lock: sha1:jKXo15kI2M8KKDc3nksByPR6Vsk= sha256:B3PXURSNvmt+cQfEIA+LXGAu/2REIbyBmAaqp3X5UaY=
X-Newsreader: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu)
 by: yossarian - Sat, 16 Dec 2023 10:57 UTC

On Sat, 16 Dec 2023 09:52:23 -0000 (UTC)
Jack@handsome.com (Handsome Jack) wrote:

> In my root directory I have a 2Gbyte file called 'swapfile'. According to the file manager it hasn't been updated since September 2021, which is roughly when I first installed Linux.
>
> Am I right in thinking that this file is the residue of a crash or other incident that occurred during the installation, and which I've now forgotten all about or never noticed? Can I safely delete it? Two gigs is a significant bit of disk space, especially as just about everything I install in LM seems to tell me it will need 999 Mbytes of disk. I don't know what the world's coming to ... when I used to write programs you had to fit them in 4k ...

If you have enough memory disable swap and delete swap file. On my mint I never have swap file with 16G.
https://forums.linuxmint.com/viewtopic.php?t=339459
If programs you install is big, you probably install flatpaks or snaps. Try to avoid to do that.

--

Mint 21.2 Victoria, kernel 6.2.0-33-generic, Cinnamon 5.8.4
AMD Ryzen 7 5700G with Radeon Vega Graphics, 32GB of DRAM.

Re: Disused swap file?

<ulk138$2ctin$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7287&group=alt.os.linux.mint#7287

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 06:19:03 -0500
Organization: A noiseless patient Spider
Lines: 98
Message-ID: <ulk138$2ctin$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 16 Dec 2023 11:19:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="17f1342fd9391291bac2dba3d79db83c";
logging-data="2520663"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//RPh/nInk3SYvYEZADZe8QVG043YkPXA="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:Uhz1lB6Y/ETbqcz6wZKz1N99OPU=
Content-Language: en-US
In-Reply-To: <uljs0l$2c6jn$1@dont-email.me>
 by: Paul - Sat, 16 Dec 2023 11:19 UTC

On 12/16/2023 4:52 AM, Handsome Jack wrote:
> In my root directory I have a 2Gbyte file called 'swapfile'. According to the file manager it hasn't been updated since September 2021, which is roughly when I first installed Linux.
>
> Am I right in thinking that this file is the residue of a crash or other incident that occurred during the installation, and which I've now forgotten all about or never noticed? Can I safely delete it? Two gigs is a significant bit of disk space, especially as just about everything I install in LM seems to tell me it will need 999 Mbytes of disk. I don't know what the world's coming to ... when I used to write programs you had to fit them in 4k ...
>

When the OS is set up, the /etc/fstab records
how things were set up. The static mounts are in there.
(Humans did this. It was a design decision to put comments
into /etc/fstab, to help the end-user understand the install
choices made on their behalf. There have not always been
comments.)

There can be a swap partition declared in /etc/fstab.
It may be referred to with a BLKID, and sometimes
that BLKID is recorded in "something that runs early
when the OS boots". On Ubuntu, if you notice it scanning
for MDRAID or other obscure things, what it is doing is it
noticed the swap device or file was not available, and
it is scanning scanning scanning, looking for something
to use. At first, I had to Google to figure out what
those weird symptoms meant. And it was a missing swap.
The swap was missing, because the BLKID was wrong.

Whereas the swapfile ( /swap ), is used as an alternative
representation. There is no BLKID, so a swapfile does not
make a nuisance of itself.

As for swapping itself, you can have multiple swap
device solutions loaded and running at the same time.
Something like "swapon -a" loads all known swaps.
But then, the swaps would have to be declared somewhere
for the swapon invocation to find them. Swapon does not
indulge in scanning behavior.

When you have two swap devices, some operating systems
test the swaps at startup, and the fast swap might get
a few more writes than the slow swap.

On the other hand, now that SSD drives are popular,
there is tuning potentially involved, to "avoid swapping".
While a swap device can be declared, maybe it's not actually
seeing any writes, until something "pathologically bad" happens.
A keyword for the tuning, might be "swappiness".

Swapping can start to happen, when 50.1% of system RAM is used.
Or, you can wait until the OS is "almost knackered" and only
50KB of RAM is left, before swapping. The "swappiness" or similar,
may have something to do with which extreme is involved. Note that,
if there is 50KB left, and the OS cannot keep up with the desire for
RAM, the OOM Killer will be invoked, even though the situation is
a transient. This is why, after the era of "easy death" in Linux
distros, somebody actually tuned the bloody thing, so it starts
to swap at 50.1% and then no transient would ever kill it :-)
There was in fact, a time we lived in fear of swap, mainly because
nobody had tuned things properly before deployment. The kernel people
knew how it was supposed to work, but the tree herders seemed to miss
that detail.

*******
Here is my Notes file entry, on the topic of changing over the swap in Ubuntu.

Ubuntu searching for btrfs, mdadm, is caused by swap UUID.

1) Edit /etc/fstab and correct blkid of swap.
2) Initramfs also has a swap check.

open /etc/initramfs-tools/conf.d/resume
replace RESUME=UUID=xxx with RESUME=none (or use the correct blkid!)
issue sudo update-initramfs -u
reboot your system

I did an update-grub just in case

*******

Summary: I would look in /etc/fstab first, and see to what extent
the automated activity has been recorded in there. As to
what choices the OS has been making.

The administrator can certainly get in there and mess around.
When I changed a Ubuntu over from swap partition to swap file,
I may have made an entry in /etc/fstab too, complete with
a comment about what I was doing.

Look at it this way. You can, with a LiveDVD, change the filename
of a swapfile from /swap to /swap.bak , then try booting the real OS,
and see if it still runs. The "top" command has some information
about virtual memory and so on. Another command might be vmstat
from the old days. Or maybe "free" ? As long as you have a LiveDVD,
you can "reach in, and fix it" :-)

Sample manual entry:

https://linux.die.net/man/8/swapon

Paul

Re: Disused swap file?

<ulk9tp$2e52l$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7288&group=alt.os.linux.mint#7288

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: killade...@mouse-potato.com (Killadebug)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 13:49:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ulk9tp$2e52l$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 16 Dec 2023 13:49:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="59c89573a1d12faf46dd0dc4499c43c6";
logging-data="2561109"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9SQv7rmPCk2HIprUgjtROJr8xnt9DAco="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:0/nfR9xdyXbw0Dt4AYM7dqnKMsc=
 by: Killadebug - Sat, 16 Dec 2023 13:49 UTC

On Sat, 16 Dec 2023 09:52:23 -0000 (UTC), Handsome Jack wrote:

> In my root directory I have a 2Gbyte file called 'swapfile'. According
> to the file manager it hasn't been updated since September 2021, which
> is roughly when I first installed Linux.
>
> Am I right in thinking that this file is the residue of a crash or other
> incident that occurred during the installation, and which I've now
> forgotten all about or never noticed? Can I safely delete it? Two gigs
> is a significant bit of disk space, especially as just about everything
> I install in LM seems to tell me it will need 999 Mbytes of disk. I
> don't know what the world's coming to ... when I used to write programs
> you had to fit them in 4k ...

32 Gig memory here, using zram with zstd compression,

--
Pull my finger

Re: Disused swap file?

<ulkgse$2f4e5$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7290&group=alt.os.linux.mint#7290

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bea...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 10:48:29 -0500
Organization: A noiseless patient Spider
Lines: 107
Message-ID: <ulkgse$2f4e5$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulk138$2ctin$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 16 Dec 2023 15:48:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="33d63f74c3a08c3bd3c0931b9246cf59";
logging-data="2593221"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18krfHs0cthvzJhinhWgom3sqNUqgfQqVY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:pDs7hmh4Msi0kPwqMwquNkrG7bU=
Content-Language: en-US
In-Reply-To: <ulk138$2ctin$1@dont-email.me>
 by: Big Al - Sat, 16 Dec 2023 15:48 UTC

On 12/16/23 06:19 AM, this is what Paul wrote:
> On 12/16/2023 4:52 AM, Handsome Jack wrote:
>> In my root directory I have a 2Gbyte file called 'swapfile'. According to the file manager it hasn't been updated since September 2021, which is roughly when I first installed Linux.
>>
>> Am I right in thinking that this file is the residue of a crash or other incident that occurred during the installation, and which I've now forgotten all about or never noticed? Can I safely delete it? Two gigs is a significant bit of disk space, especially as just about everything I install in LM seems to tell me it will need 999 Mbytes of disk. I don't know what the world's coming to ... when I used to write programs you had to fit them in 4k ...
>>
>
> When the OS is set up, the /etc/fstab records
> how things were set up. The static mounts are in there.
> (Humans did this. It was a design decision to put comments
> into /etc/fstab, to help the end-user understand the install
> choices made on their behalf. There have not always been
> comments.)
>
> There can be a swap partition declared in /etc/fstab.
> It may be referred to with a BLKID, and sometimes
> that BLKID is recorded in "something that runs early
> when the OS boots". On Ubuntu, if you notice it scanning
> for MDRAID or other obscure things, what it is doing is it
> noticed the swap device or file was not available, and
> it is scanning scanning scanning, looking for something
> to use. At first, I had to Google to figure out what
> those weird symptoms meant. And it was a missing swap.
> The swap was missing, because the BLKID was wrong.
>
> Whereas the swapfile ( /swap ), is used as an alternative
> representation. There is no BLKID, so a swapfile does not
> make a nuisance of itself.
>
> As for swapping itself, you can have multiple swap
> device solutions loaded and running at the same time.
> Something like "swapon -a" loads all known swaps.
> But then, the swaps would have to be declared somewhere
> for the swapon invocation to find them. Swapon does not
> indulge in scanning behavior.
>
> When you have two swap devices, some operating systems
> test the swaps at startup, and the fast swap might get
> a few more writes than the slow swap.
>
> On the other hand, now that SSD drives are popular,
> there is tuning potentially involved, to "avoid swapping".
> While a swap device can be declared, maybe it's not actually
> seeing any writes, until something "pathologically bad" happens.
> A keyword for the tuning, might be "swappiness".
>
> Swapping can start to happen, when 50.1% of system RAM is used.
> Or, you can wait until the OS is "almost knackered" and only
> 50KB of RAM is left, before swapping. The "swappiness" or similar,
> may have something to do with which extreme is involved. Note that,
> if there is 50KB left, and the OS cannot keep up with the desire for
> RAM, the OOM Killer will be invoked, even though the situation is
> a transient. This is why, after the era of "easy death" in Linux
> distros, somebody actually tuned the bloody thing, so it starts
> to swap at 50.1% and then no transient would ever kill it :-)
> There was in fact, a time we lived in fear of swap, mainly because
> nobody had tuned things properly before deployment. The kernel people
> knew how it was supposed to work, but the tree herders seemed to miss
> that detail.
>
> *******
> Here is my Notes file entry, on the topic of changing over the swap in Ubuntu.
>
> Ubuntu searching for btrfs, mdadm, is caused by swap UUID.
>
> 1) Edit /etc/fstab and correct blkid of swap.
> 2) Initramfs also has a swap check.
>
> open /etc/initramfs-tools/conf.d/resume
> replace RESUME=UUID=xxx with RESUME=none (or use the correct blkid!)
> issue sudo update-initramfs -u
> reboot your system
>
I found that this is an easy way to fix the RESUME in initramfs-tools if your fstab has a defined swap.
A one liner! I'm thinking this will wrap.
printf "RESUME=UUID=$(blkid | awk -F\" '/swap/ {print $2}')\n" | sudo tee /etc/initramfs-tools/conf.d/resume
> I did an update-grub just in case
>
> *******
>
> Summary: I would look in /etc/fstab first, and see to what extent
> the automated activity has been recorded in there. As to
> what choices the OS has been making.
>
> The administrator can certainly get in there and mess around.
> When I changed a Ubuntu over from swap partition to swap file,
> I may have made an entry in /etc/fstab too, complete with
> a comment about what I was doing.
>
> Look at it this way. You can, with a LiveDVD, change the filename
> of a swapfile from /swap to /swap.bak , then try booting the real OS,
> and see if it still runs. The "top" command has some information
> about virtual memory and so on. Another command might be vmstat
> from the old days. Or maybe "free" ? As long as you have a LiveDVD,
> you can "reach in, and fix it" :-)
>
> Sample manual entry:
>
> https://linux.die.net/man/8/swapon
>
> Paul
>

--
Linux Mint 21.2 Cinnamon
Al

Re: Disused swap file?

<ulkhab$hhm$1@solani.org>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7291&group=alt.os.linux.mint#7291

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!usenet.network!news.neodome.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Monsi...@notreal.invalid (Monsieur)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 16:55:55 +0100
Message-ID: <ulkhab$hhm$1@solani.org>
References: <uljs0l$2c6jn$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 16 Dec 2023 15:55:56 -0000 (UTC)
Injection-Info: solani.org;
logging-data="17974"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18
Cancel-Lock: sha1:4HHBVYJRSXQrwLBWWIk6jlZqwmI=
In-Reply-To: <uljs0l$2c6jn$1@dont-email.me>
X-User-ID: eJwFwQcBwEAIBDBLZRxDDvDgX0ITiJGNq8EUh7vCIytOSPnGZr4NQY5L7MTMXTezfi10cPoBKcURdA==
 by: Monsieur - Sat, 16 Dec 2023 15:55 UTC

Handsome Jack wrote:
> In my root directory I have a 2Gbyte file called 'swapfile'. According to the file manager it hasn't been updated since September 2021, which is roughly when I first installed Linux.
>
> Am I right in thinking that this file is the residue of a crash or other incident that occurred during the installation, and which I've now forgotten all about or never noticed? Can I safely delete it? Two gigs is a significant bit of disk space, especially as just about everything I install in LM seems to tell me it will need 999 Mbytes of disk. I don't know what the world's coming to ... when I used to write programs you had to fit them in 4k ...
>

To check if your swap is active or not, type: swapon --show

If there is no output, then your swap is disabled and you can safely
delete the file.

Re: Disused swap file?

<3pkfN.32568$q3F7.30283@fx45.iad>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7293&group=alt.os.linux.mint#7293

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx45.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Reply-To: Nic@none.net
Subject: Re: Disused swap file?
Newsgroups: alt.os.linux.mint
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org>
Content-Language: en-US
From: Nic...@none.net (Nic)
Organization: Arm Chair Observer
In-Reply-To: <ulkhab$hhm$1@solani.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 24
Message-ID: <3pkfN.32568$q3F7.30283@fx45.iad>
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Sat, 16 Dec 2023 16:39:27 UTC
Date: Sat, 16 Dec 2023 11:39:26 -0500
X-Received-Bytes: 1757
 by: Nic - Sat, 16 Dec 2023 16:39 UTC

On 12/16/23 10:55 AM, Monsieur wrote:
> Handsome Jack wrote:
>> In my root directory I have a 2Gbyte file called 'swapfile'.
>> According to the file manager it hasn't been updated since September
>> 2021, which is roughly when I first installed Linux.
>>
>> Am I right in thinking that this file is the residue of a crash or
>> other incident that occurred during the installation, and which I've
>> now forgotten all about or never noticed? Can I safely delete it? Two
>> gigs is a significant bit of disk space, especially as just about
>> everything I install in LM seems to tell me it will need 999 Mbytes
>> of disk. I don't know what the world's coming to ... when I used to
>> write programs you had to fit them in 4k ...
>>
>
> To check if your swap is active or not, type: swapon --show
>
> If there is no output, then your swap is disabled and you can safely
> delete the file.
>
Thanks, that was helpful.
NAME      TYPE SIZE USED PRIO
/swapfile   file   2G   0B      -2

Re: Disused swap file?

<ulkk5o$2fpi5$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7295&group=alt.os.linux.mint#7295

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Jac...@handsome.com (Handsome Jack)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 16:44:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <ulkk5o$2fpi5$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org> <3pkfN.32568$q3F7.30283@fx45.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 16 Dec 2023 16:44:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7f8b622f26e93b018c9e01a4103ffed3";
logging-data="2614853"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XWSKAmiv/BsV6I09Jjihf6GJ/MRKAoeQ="
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-87-generic (x86_64))
Cancel-Lock: sha1:lLB/i5vmbHihZ15b4u0Gw41U7e0=
 by: Handsome Jack - Sat, 16 Dec 2023 16:44 UTC

Nic <Nic@none.net> wrote:
> On 12/16/23 10:55 AM, Monsieur wrote:
>> Handsome Jack wrote:
>>> In my root directory I have a 2Gbyte file called 'swapfile'.
>>> According to the file manager it hasn't been updated since September
>>> 2021, which is roughly when I first installed Linux.
>>>
>>> Am I right in thinking that this file is the residue of a crash or
>>> other incident that occurred during the installation, and which I've
>>> now forgotten all about or never noticed? Can I safely delete it? Two
>>> gigs is a significant bit of disk space, especially as just about
>>> everything I install in LM seems to tell me it will need 999 Mbytes
>>> of disk. I don't know what the world's coming to ... when I used to
>>> write programs you had to fit them in 4k ...
>>>
>>
>> To check if your swap is active or not, type: swapon --show
>>
>> If there is no output, then your swap is disabled and you can safely
>> delete the file.
>>
> Thanks, that was helpful.
> NAME      TYPE SIZE USED PRIO
> /swapfile   file   2G   0B      -2
>

I got exactly the same. Does that mean, then, that I have swap enabled and it is not safe to delete the file, even though it hasn't been used for two years?

If so, then presumably I can turn swapping off and then delete it, since the machine doesn't seem to be using it?

Re: Disused swap file?

<ulko02$2rofj$1@solani.org>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7298&group=alt.os.linux.mint#7298

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!news.samoylyk.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Monsi...@notreal.invalid (Monsieur)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sat, 16 Dec 2023 18:49:54 +0100
Message-ID: <ulko02$2rofj$1@solani.org>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org>
<3pkfN.32568$q3F7.30283@fx45.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 16 Dec 2023 17:49:54 -0000 (UTC)
Injection-Info: solani.org;
logging-data="3006963"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18
Cancel-Lock: sha1:Lcgi8ScRfadWCxSdn3nlQn0Stis=
X-User-ID: eJwFwQkBwEAIAzBLvAU7DK7+JSxJh2IrkIhkkuKGozFmTxHePbijlp15zrRE1hupT+Wt/x/QER4=
In-Reply-To: <3pkfN.32568$q3F7.30283@fx45.iad>
 by: Monsieur - Sat, 16 Dec 2023 17:49 UTC

Nic wrote:
> On 12/16/23 10:55 AM, Monsieur wrote:

>> To check if your swap is active or not, type: swapon --show
>>
>> If there is no output, then your swap is disabled and you can safely
>> delete the file.
>>
> Thanks, that was helpful.
> NAME      TYPE SIZE USED PRIO
> /swapfile   file   2G   0B      -2
>

That means you have an active swap file.

If you have enough RAM, you can disable swap altogether.

Type: sudo swapoff -a

Next delete the line in /etc/fstab that points to the swap file. Or just
comment it out with a # - that way you can still reactivate it if necessary.

Finally reboot your system and check with swapon --show again. If there
is no output, you have successfully disabled your swap partition/file.
Using a live session, you can then delete the swap file.

Re: Disused swap file?

<ulm5g6$2qlr6$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7302&group=alt.os.linux.mint#7302

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sun, 17 Dec 2023 01:46:27 -0500
Organization: A noiseless patient Spider
Lines: 126
Message-ID: <ulm5g6$2qlr6$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org>
<3pkfN.32568$q3F7.30283@fx45.iad> <ulkk5o$2fpi5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 06:46:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6be228154b1a7072ee0513ebbdab5c7b";
logging-data="2971494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Cli74s0sJGHrZXBADTtdwh5ltpdpvc9U="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:laiiE7boG04DtJ8WKbF49Lqwc8s=
In-Reply-To: <ulkk5o$2fpi5$1@dont-email.me>
Content-Language: en-US
 by: Paul - Sun, 17 Dec 2023 06:46 UTC

On 12/16/2023 11:44 AM, Handsome Jack wrote:
> Nic <Nic@none.net> wrote:
>> On 12/16/23 10:55 AM, Monsieur wrote:
>>> Handsome Jack wrote:
>>>> In my root directory I have a 2Gbyte file called 'swapfile'.
>>>> According to the file manager it hasn't been updated since September
>>>> 2021, which is roughly when I first installed Linux.
>>>>
>>>> Am I right in thinking that this file is the residue of a crash or
>>>> other incident that occurred during the installation, and which I've
>>>> now forgotten all about or never noticed? Can I safely delete it? Two
>>>> gigs is a significant bit of disk space, especially as just about
>>>> everything I install in LM seems to tell me it will need 999 Mbytes
>>>> of disk. I don't know what the world's coming to ... when I used to
>>>> write programs you had to fit them in 4k ...
>>>>
>>>
>>> To check if your swap is active or not, type: swapon --show
>>>
>>> If there is no output, then your swap is disabled and you can safely
>>> delete the file.
>>>
>> Thanks, that was helpful.
>> NAME      TYPE SIZE USED PRIO
>> /swapfile   file   2G   0B      -2
>>
>
> I got exactly the same. Does that mean, then, that I have swap enabled and it is not safe to delete the file, even though it hasn't been used for two years?
>
> If so, then presumably I can turn swapping off and then delete it, since the machine doesn't seem to be using it?
>

How did you conclude the machine wasn't using it ?

The "top" command shows current usage.
The "top" command also shows the memory consumption of processes (Firefox).

Whether a machine has a swap or not, the issue remains the same.
The OOM Killer will be triggered, if the machine runs out of RAM.

In the old days, we used ulimit (memory quota) mechanism.
This limits how much memory one process can grab. We set the
machines to 50%. If you had a 4GB machine, a single process could
use 2GB. This was considered sufficient for most usage cases,
but without making the machine unstable (back in those days, it
could panic when being out of virtual memory).

https://www.baeldung.com/linux/limit-resource-consumption

Firefox has the ability, if it goes nuts (which it has done in the past),
to kill a session. Both Firefox and Linux have changed since then,
so the landing is unpleasant (DE disappears), but the machine does not
panic.

*******

I did an experiment on Ubuntu 23.10 . This is my testing program.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <unistd.h>

/* gcc -o malloc-linux malloc-linux.c */

int main (int argc, char *argv[])
{ uint64_t tick1, tick2, calib; //unsigned 64 bit quantity
unsigned c,d,e,f;

/* This code takes 0.1 seconds and calibrates the number of ticks in one second */
/* The objective is not to annoy the user with a long calibration delay */

asm volatile("rdtsc" : "=a" (c), "=d" (d)); //assembly code running the instruction rdtsc
usleep(100000); /* tenth of a second, works in Linux, a bit rough in old mingw32 on windows */
asm volatile("rdtsc" : "=a" (e), "=d" (f)); //assembly code running the instruction rdtsc
tick1 = (((uint64_t)c) | (((uint64_t)d) << 32)); // calculating the tick value.
tick2 = (((uint64_t)e) | (((uint64_t)f) << 32)); // calculating the tick value.
calib = (tick2 - tick1) * 10; /* seems to be CPU baseline clock, approximately */
printf("Calib is roughly baseline CPU clock %lu\n", calib);

/* Record T=0 for the test */

asm volatile("rdtsc" : "=a" (c), "=d" (d)); //assembly code running the instruction rdtsc
tick1 = (((uint64_t)c) | (((uint64_t)d) << 32)); // start the malloc run

int i = 0;
void *m;

while ( (m = malloc(1024*1024)) != NULL ) {
memset(m,0,1024*1024); /* Writing to allocated memory, prevents lazy evaluation */
i++;

asm volatile("rdtsc" : "=a" (e), "=d" (f)); //assembly code running the instruction rdtsc
tick2 = (((uint64_t)e) | (((uint64_t)f) << 32)); // accumulated time since start

printf("%05d megabytes t=%010.6f\n", i, (float)(tick2 - tick1)/(float)calib );
}
}

Now, I haven't done one of these tests, in a long time. The results surprised me.

1) Having a swap file, is hardly any protection at all.
The machine tipped over, when 2GB of 8GB swap file was used.
A second test run, even when a slight amount of swap was used,
I was losing control of the machine. This means, you really
have to nail the motherfucker using all the RAM, *before* it
hits swap. The machine is quite unresponsive, once the top of
physical memory is crossed.

2) The OOM killer is organized, and it takes out the desktop.
It still does not identify the runaway process (my ./malloc-linux memory gobbler).

As a result of this test, what I can warn you is, yes, you're right,
that swap file is now "almost useless". I was going to warn you that
"having a swap file gives time to stop a runaway process". In the
test I did, no it didn't provide protection. It was only by learning
from the first calamity, I knew how much rope I had for the second
test run (to take a screenshot). I stopped it in time, for the screenshot.

[Picture]

https://i.postimg.cc/0j8rzvqq/malloc-testing.gif

Paul

Re: Disused swap file?

<ulmbcn$2rfgc$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7303&group=alt.os.linux.mint#7303

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Jac...@handsome.com (Handsome Jack)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sun, 17 Dec 2023 08:27:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <ulmbcn$2rfgc$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org> <3pkfN.32568$q3F7.30283@fx45.iad> <ulkk5o$2fpi5$1@dont-email.me> <ulm5g6$2qlr6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 08:27:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c63570a8119fbcc2a218e2ca9eede695";
logging-data="2997772"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/Oeb/OH4IOnCBdgI8/wS4nULZl0WNh38="
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-87-generic (x86_64))
Cancel-Lock: sha1:eNWFD3uGjnHD3/3DwthSB8mH6HY=
 by: Handsome Jack - Sun, 17 Dec 2023 08:27 UTC

Paul <nospam@needed.invalid> wrote:
> On 12/16/2023 11:44 AM, Handsome Jack wrote:
>> Nic <Nic@none.net> wrote:
>>> On 12/16/23 10:55 AM, Monsieur wrote:
>>>> Handsome Jack wrote:
>>>>> In my root directory I have a 2Gbyte file called 'swapfile'.
>>>>> According to the file manager it hasn't been updated since September
>>>>> 2021, which is roughly when I first installed Linux.
>>>>>
>>>>> Am I right in thinking that this file is the residue of a crash or
>>>>> other incident that occurred during the installation, and which I've
>>>>> now forgotten all about or never noticed? Can I safely delete it? Two
>>>>> gigs is a significant bit of disk space, especially as just about
>>>>> everything I install in LM seems to tell me it will need 999 Mbytes
>>>>> of disk. I don't know what the world's coming to ... when I used to
>>>>> write programs you had to fit them in 4k ...
>>>>>
>>>>
>>>> To check if your swap is active or not, type: swapon --show
>>>>
>>>> If there is no output, then your swap is disabled and you can safely
>>>> delete the file.
>>>>
>>> Thanks, that was helpful.
>>> NAME      TYPE SIZE USED PRIO
>>> /swapfile   file   2G   0B      -2
>>>
>>
>> I got exactly the same. Does that mean, then, that I have swap enabled and it is not safe to delete the file, even though it hasn't been used for two years?
>>
>> If so, then presumably I can turn swapping off and then delete it, since the machine doesn't seem to be using it?
>>
>
> How did you conclude the machine wasn't using it ?

The date-stamp says it was last modified in September 2021.

> The "top" command shows current usage.
> The "top" command also shows the memory consumption of processes (Firefox).

Thanks, I didn't know that. Useful. The relevant line reads
"MiB Swap: 2048.0 total, 2048.0 free, 0.0 used."

So it looks like my machine does have swapping activated, but it's never had call to use it in anger. Not surprising as it has 8G and I only use it in granny mode.

> Whether a machine has a swap or not, the issue remains the same.
> The OOM Killer will be triggered, if the machine runs out of RAM.
>
> In the old days, we used ulimit (memory quota) mechanism.
> This limits how much memory one process can grab. We set the
> machines to 50%. If you had a 4GB machine, a single process could
> use 2GB. This was considered sufficient for most usage cases,
> but without making the machine unstable (back in those days, it
> could panic when being out of virtual memory).
>
> https://www.baeldung.com/linux/limit-resource-consumption
>
> Firefox has the ability, if it goes nuts (which it has done in the past),
> to kill a session. Both Firefox and Linux have changed since then,
> so the landing is unpleasant (DE disappears), but the machine does not
> panic.
>
> *******
>
> I did an experiment on Ubuntu 23.10 . This is my testing program.
>
[snip]

> As a result of this test, what I can warn you is, yes, you're right,
> that swap file is now "almost useless". I was going to warn you that
> "having a swap file gives time to stop a runaway process". In the
> test I did, no it didn't provide protection. It was only by learning
> from the first calamity, I knew how much rope I had for the second
> test run (to take a screenshot). I stopped it in time, for the screenshot.
>

OK. Maybe I'll disable it over the holidays, then, and see what happens. I don't need that 2Gb of disk space yet, but it's nice to know I can have it back.

Re: Disused swap file?

<ulmbip$2rfgc$2@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7304&group=alt.os.linux.mint#7304

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Jac...@handsome.com (Handsome Jack)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sun, 17 Dec 2023 08:30:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <ulmbip$2rfgc$2@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org> <3pkfN.32568$q3F7.30283@fx45.iad> <ulko02$2rofj$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 08:30:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c63570a8119fbcc2a218e2ca9eede695";
logging-data="2997772"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JfMcctWGQBZplP2HgFTL9btUL2bRaQTs="
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-87-generic (x86_64))
Cancel-Lock: sha1:IuaqOpRr8Zyvi8ksFCk37IaRBak=
 by: Handsome Jack - Sun, 17 Dec 2023 08:30 UTC

Monsieur <Monsieur@notreal.invalid> wrote:
> Nic wrote:
>> On 12/16/23 10:55 AM, Monsieur wrote:
>
>>> To check if your swap is active or not, type: swapon --show
>>>
>>> If there is no output, then your swap is disabled and you can safely
>>> delete the file.
>>>
>> Thanks, that was helpful.
>> /swapfile   file   2G   0B      -2
>>
>
> That means you have an active swap file.
>
> If you have enough RAM, you can disable swap altogether.
>
> Type: sudo swapoff -a
>
> Next delete the line in /etc/fstab that points to the swap file. Or just
> comment it out with a # - that way you can still reactivate it if necessary.
>
> Finally reboot your system and check with swapon --show again. If there
> is no output, you have successfully disabled your swap partition/file.
> Using a live session, you can then delete the swap file.

Excellent. Many thanks.

Re: Disused swap file?

<ulmrpp$2ui7v$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7305&group=alt.os.linux.mint#7305

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bea...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sun, 17 Dec 2023 08:07:05 -0500
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <ulmrpp$2ui7v$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org>
<3pkfN.32568$q3F7.30283@fx45.iad> <ulkk5o$2fpi5$1@dont-email.me>
<ulm5g6$2qlr6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 13:07:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0449633bedb8b2274e8c60ab70551615";
logging-data="3098879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18EBk/SVvxuOpoPiqF6CsERwp3+Kpyr4WY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UN0aueY1GdsdV7wNANReyA07Lo4=
Content-Language: en-US
In-Reply-To: <ulm5g6$2qlr6$1@dont-email.me>
 by: Big Al - Sun, 17 Dec 2023 13:07 UTC

On 12/17/23 01:46 AM, this is what Paul wrote:
> [Picture]
>
> https://i.postimg.cc/0j8rzvqq/malloc-testing.gif
>
> Paul
Nice little ramp you made 😀
--
Linux Mint 21.2 Cinnamon
Al

Re: Disused swap file?

<ulmvoo$2vddr$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7306&group=alt.os.linux.mint#7306

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.os.linux.mint
Subject: Re: Disused swap file?
Date: Sun, 17 Dec 2023 09:14:46 -0500
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <ulmvoo$2vddr$1@dont-email.me>
References: <uljs0l$2c6jn$1@dont-email.me> <ulkhab$hhm$1@solani.org>
<3pkfN.32568$q3F7.30283@fx45.iad> <ulkk5o$2fpi5$1@dont-email.me>
<ulm5g6$2qlr6$1@dont-email.me> <ulmrpp$2ui7v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 14:14:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6be228154b1a7072ee0513ebbdab5c7b";
logging-data="3126715"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187bRj6ZWd5SBa1KrPzSQIMc9BD/0hZCEk="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:074sXqwyxFut3dn9BBUve+pY77w=
In-Reply-To: <ulmrpp$2ui7v$1@dont-email.me>
X-Mozilla-News-Host: news://nntp.aioe.org
Content-Language: en-US
 by: Paul - Sun, 17 Dec 2023 14:14 UTC

On 12/17/2023 8:07 AM, Big Al wrote:
> On 12/17/23 01:46 AM, this is what Paul wrote:
>>     [Picture]
>>
>>      https://i.postimg.cc/0j8rzvqq/malloc-testing.gif
>>
>>    Paul
> Nice little ramp you made 😀

As these things go, it is rather impressive.

Windows can't make one that flat.

*******

It's beginning to wheeze a bit at the end,
has to stop and take a breather, before finishing the climb.

But Windows tells it, that it can't have any more
RAM, so it rolls back downhill without incident.

[Picture]

https://i.postimg.cc/65bbCxMt/windows11-malloc-test.gif

Paul

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor