Swapfile in root

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
areopagus
Level 1
Level 1
Posts: 1
Joined: Mon Aug 19, 2019 5:06 pm

Swapfile in root

Post by areopagus » Mon Aug 19, 2019 5:26 pm

I have a huge(2.1 GB) file in my root directory called "swapfile". This is just a regular file, not a linux swap partition.

-rw------- 1 root root 2.0G Jan 31 2019 swapfile

Ran a header since it was too big to load in vim:

/ sudo head swapfile
[sudo] password for tim:
��U]�y�H���_��?�SWAPSPACE2419
930
lo
954
931# This file was automatically generated by cupsd(8) from the
# /etc/cups/printers.conf file. All changes to this file
# will be lost.
1000
# This is private data. Do not parse.
WHAT=sleep


I would like to delete it. Is it safe?

User avatar
catweazel
Level 19
Level 19
Posts: 9205
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Swapfile in root

Post by catweazel » Mon Aug 19, 2019 5:45 pm

areopagus wrote:
Mon Aug 19, 2019 5:26 pm
I would like to delete it. Is it safe?
Not if you wish to suspend or hibernate, and not if you don't have, say, 8GB of RAM or more.

It isn't a "regular file", it's the system's swap file, used to swap things in and out of memory to keep your machine running smoother.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
bob466
Level 5
Level 5
Posts: 613
Joined: Mon May 15, 2017 5:23 am
Location: Australia

Re: Swapfile in root

Post by bob466 » Mon Aug 19, 2019 7:41 pm

Leave it be. Image :roll:
Linux For Ever...Windoze Never Image

User avatar
Flemur
Level 17
Level 17
Posts: 7076
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Swapfile in root

Post by Flemur » Mon Aug 19, 2019 8:51 pm

areopagus wrote:
Mon Aug 19, 2019 5:26 pm
I have a huge(2.1 GB) file in my root directory called "swapfile". This is just a regular file, not a linux swap partition.
...
I would like to delete it. Is it safe?
You could shrink it, unless, @catweazel, you want to suspends, etc.
I have a 4GB desktop and a 100MB swap file, AFAIK, never used.
It's there just in case I use up all the memory, in which case the system will slow down a bunch rather than seize up. Hopefully.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 19.1 Xfce/fluxbox
Manjaro openbox/fluxbox

Post Reply

Return to “Newbie Questions”