# Cannot increase swap file size

**URL:** <https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463>\
**Category:** Issues & Assistance\
**Created:** [January 15, 2025, 1:25pm UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463 "2025-01-15T13:25:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [January 15, 2025, 1:25pm UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463/1 "2025-01-15T13:25:22Z")

</div>

I just installed a fresh copy of Reborn and have everything setup to my liking, all my software in and it’s looking good. I chose to install on BTRFS with swap file. I just went to in crease the swap file from 512 megs to 8 gigs and it fails. Any thoughts? Thanks

```auto
a  ✔  05:14:34 AM 
[sudo] password for cccp: 
~  sudo dd if=/dev/zero of=/swapfile bs=1G count=8  ✔  9s  05:14:54 AM 
8+0 records in
8+0 records out
8589934592 bytes (8.6 GB, 8.0 GiB) copied, 2.29259 s, 3.7 GB/s
~  sudo mkswap /swapfile  ✔  05:15:12 AM 
mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600 /swapfile
Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
no label, UUID=58d6a0d5-bf1b-4805-a0a7-4164eb5c5460
~  sudo swapon /swapfile  ✔  05:15:32 AM 
swapon: /swapfile: insecure permissions 0644, 0600 suggested.
swapon: /swapfile: swapon failed: Invalid argument
~  grep SwapTotal /proc/meminfo  255 ✘  05:15:47 AM 
SwapTotal: 0 kB
~  fastfetch  ✔  05:15:59 AM 
        .======================. cccp@CCCP
       .## *********%%********* #%: ---------
      :%# **********%%********** #%- OS: RebornOS Linux x86_64
     -% ************%%************ %= Host: X670 AORUS ELITE AX
    +% ******%%#####%%#####%%****** %+ Kernel: Linux 6.12.9-zen1-1-zen
   *%%# ****%#+=====%%=====+#%**** #%%* Uptime: 1 hour, 57 mins
  *%*##%%#%#====+++%%+++====#%#%%##*##. Packages: 1668 (pacman)
.## *****#%%%#*++%######%*+*#%%%#***** #%. Shell: zsh 5.8
:%# *****#%*=+*#%%*++++++*%%#*+=*%#***** #%: Display (DELL S3221QS): 3840x2160 @ 60 Hz (as 2560x1440) in 31" [Externa]
-%# *****#%+====*%*++++++++*%#====+%#****** %- DE: KDE Plasma 6.2.5
-%# *****#%+====*%*++++++++*%#====+%#****** %= WM: KWin (Wayland)
:%# *****#%*=+*#%%*++++++*%%#*+=*%#***** #%- WM Theme: Darkly
.## *****#%%%#*+*%######%*+*#%%%#***** #%: Theme: Darkly (Sweet) [Qt], Breeze-Dark [GTK2], Breeze [GTK3/4]
 .##**#%%#%#====+++%%+++====#%#%%##*##. Icons: BeautySolar [Qt], BeautySolar [GTK2/3/4]
   *%%# ****%#+=====%%=====+#%**** #%%* Font: Noto Sans (10pt) [Qt], Noto Sans (10pt) [GTK2/3/4]
    +% ******%%#####%%#####%%****** %* Cursor: material_dark (48px)
     -% ************%%************ %= Terminal: konsole 24.12.1
      :%# **********%%********** #%- Terminal Font: Hack (10pt, Bold)
       :%# *********%%********* #%: CPU: AMD Ryzen 7 7700X (16) @ 5.57 GHz
        .======================. GPU 1: NVIDIA GeForce RTX 3060 Lite Hash Rate [Discrete]
                                              GPU 2: AMD Raphael [Integrated]
                                              Swap: Disabled
                                              Disk (/): 22.74 GiB / 620.91 GiB (4%) - btrfs
                                              Disk (/run/media/cccp/My Backups): 10.22 TiB / 14.44 TiB (71%) - ext4
                                              Disk (/run/media/cccp/My Files I): 3.11 TiB / 7.22 TiB (43%) - ext4
                                              Disk (/run/media/cccp/My Files II): 6.90 TiB / 10.83 TiB (64%) - ext4
                                              Locale: en_US.UTF-8

~  sudo mkswap /swapfile  ✔  05:16:27 AM 
mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600 /swapfile
mkswap: /swapfile: warning: wiping old swap signature.
Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
no label, UUID=cf5b1991-1f9d-4ec1-b6a4-ecdebb1392b2
~  chmod 0600 /swapfile  ✔  05:16:47 AM 
chmod: changing permissions of '/swapfile': Operation not permitted
~  sudo chmod 0600 /swapfile  1 ✘  05:17:09 AM 
~  sudo swapon /swapfile  ✔  05:17:21 AM 
swapon: /swapfile: 

```

[https://arcolinux.com/how-to-increase-the-size-of-your-swapfile/](https://arcolinux.com/how-to-increase-the-size-of-your-swapfile/)

> **[HW probe of Gigabyte X670 AORUS ELITE AX Desktop Computer #804b488d48](https://linux-hardware.org/?probe=804b488d48)**
>
> A database of all the hardware that works under linux

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [January 15, 2025, 1:28pm UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463/2 "2025-01-15T13:28:38Z")

</div>

What is the output of

```sh
swapon --show # Check the swap status

du -sch /swapfile # Check the swap file size

df -h # Check the space availability in your drives

```

?

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [January 15, 2025, 2:47pm UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463/4 "2025-01-15T14:47:09Z")

</div>

```auto
 /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=CCB3-8A0E /boot/efi vfat defaults,umask=0077 0 2
UUID=d3c9effc-0da7-4a1e-97a3-3f545e8553ac / btrfs subvol=/@,defaults,noatime,compress=zstd:1,autodefrag 0 0
UUID=d3c9effc-0da7-4a1e-97a3-3f545e8553ac /home btrfs subvol=/@home,defaults,noatime,compress=zstd:1,autodefrag 0 0
UUID=d3c9effc-0da7-4a1e-97a3-3f545e8553ac /var/cache btrfs subvol=/@cache,defaults,noatime,compress=zstd:1,autodefrag 0 0
UUID=d3c9effc-0da7-4a1e-97a3-3f545e8553ac /var/log btrfs subvol=/@log,defaults,noatime,compress=zstd:1,autodefrag 0 0
UUID=d3c9effc-0da7-4a1e-97a3-3f545e8553ac /swap btrfs subvol=/@swap,defaults,noatime 0 0
/swap/swapfile swap swap defaults 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

```

```auto
 ~  swapon --show  ✔  06:45:30 AM 
 ~  du -sch /swapfile  ✔  06:45:34 AM 
8.0G /swapfile
8.0G total
 ~  df -h  ✔  06:45:57 AM 
Filesystem Size Used Avail Use% Mounted on
dev 31G 0 31G 0% /dev
run 31G 19M 31G 1% /run
efivarfs 128K 23K 101K 19% /sys/firmware/efi/efivars
/dev/nvme0n1p2 621G 23G 598G 4% /
tmpfs 31G 210M 31G 1% /dev/shm
tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-journald.service
/dev/nvme0n1p2 621G 23G 598G 4% /swap
/dev/nvme0n1p2 621G 23G 598G 4% /var/log
/dev/nvme0n1p2 621G 23G 598G 4% /var/cache
/dev/nvme0n1p2 621G 23G 598G 4% /home
/dev/nvme0n1p1 300M 584K 299M 1% /boot/efi
tmpfs 31G 41M 31G 1% /tmp
tmpfs 1.0M 0 1.0M 0% /run/credentials/systemd-resolved.service
tmpfs 6.2G 192K 6.2G 1% /run/user/1000
/dev/sda1 15T 11T 3.5T 75% /run/media/cccp/My Backups
/dev/sdb1 7.3T 3.2T 3.8T 46% /run/media/cccp/My Files I
/dev/sdc1 11T 7.0T 3.4T 68% /run/media/cccp/My Files II
 ~ 

```

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [January 15, 2025, 9:51pm UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463/5 "2025-01-15T21:51:43Z")

</div>

The swap is apparently not active, based on what I see in your output. It seems like the swapfile you made earlier is different from the one in fstab. Follow these instructions for swapfile creation: [Swap - ArchWiki](https://wiki.archlinux.org/title/Swap#Swap_file)

---

<div class="post-metadata">

**Author:** ![IAmHugh](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/iamhugh/32/1053_2.png) [@IAmHugh](https://rebornos.discourse.group/u/IAmHugh)\
**Post date:** [January 15, 2025, 10:53pm UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463/6 "2025-01-15T22:53:34Z")

</div>

OK from what you’re seeing is there anything I should remove before doing that? Like that fstab entry maybe, or the file that was created?

---

<div class="post-metadata">

**Author:** ![shivanandvp](https://yyz2.discourse-cdn.com/free1/user_avatar/rebornos.discourse.group/shivanandvp/32/10_2.png) [@shivanandvp](https://rebornos.discourse.group/u/shivanandvp)\
**Post date:** [January 16, 2025, 6:19am UTC](https://rebornos.discourse.group/t/cannot-increase-swap-file-size/1463/7 "2025-01-16T06:19:23Z")

</div>

If you have sufficient RAM available, you can turn off swap and remove both, and then create it anew
