I was trying to increase the swap size of my Ubuntu. I, naïve, followed the steps of this answer:
Check the swap that is in use:
sudo swapon -sIf swap partition(s) are found:sudo swapoff -asudo nano -Bw /etc/fstabAdd # before the UUID of the swap partition(s):# UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none swap sw 0 0Add a line for the swapfile, if one does not exist:swapfile none swap sw 0 0Create the swapfile:sudo fallocate -l XG /swapfile*where X is swapfile's size in GB:sudo mkswap /swapfilesudo chmod 0600 /swapfilesudo swapon /swapfileReboot:sudo reboot
After that, my computer only starts in recovery mode.
I tried to follow this anwser. But the error unable to resolve host my-laptop-name: Temporary failure in name resolution
appears and make the process to fail.
I tried to fix it following another answer that says that the name of the host in /etc/hostname and /etc/hosts must be the same. It was wrong in /etc/hosts. But the file is read-only and I can't write on it, even with sudo.
I checked /etc/fstab and notice that I, dumb, put # to the UUID to the the boot disk, not only to the swap thing. I tried to erase the #. But that file is read-only too. I want to kill myself right now :).
If it's not clear after all this, I don't know much about Linux.
Edit 1:
My version of Ubuntu is Desktop 22.04.3 LTS
When I do sudo sudo nano /etc/fstab
to erase # from boot line, [ File '/etc/fstab' is unwritable
. The same happens with /etc/hosts.
Edit 2:
I edited the boot option in the GRUB and it worked to edit both /etc/fstab and /hosts.
Now I am struggling because when I try to boot normally the system raises an error about swap. This the error:
[0.219748] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.DGPV],AE_NOT_FOUND (20230331/psargs-330)[0.219765 ACPI Error: Aborting method \SB.PC00.PEG0.PCRP._OFF due to previous error (AE_NOT_FOUND) (20230331/psparse-596)/dev/nvme0n1p2: clean, 848739/15597568 files, 29875721/62383360 blocks[2.251365] systemd[1]: Failed to activate swap /swapfile.[FAILED] Failed to activate swap /swapfile.[DEPEND] Dependency failed for Swaps.[3.057060] iwlwifi <ipv6> BIOS contains WGDS but no WRDS
I tried to recreate swap file like in this answer. These are the commands I run to do so:
swapoff -arm /swapfile dd if=/dev/zero of=/swapfile bs=1M count=4096chmod 600 /swapfilemkswap /swapfile#anwer to this line is:# setting up swapspace version 1, size 4 GiB# no label, UUID=<long UUID>swapon /swapfile
Then I review /etc/fstab. At the end there's the line /swapfile none swap sw 0 0
. There's the line with UUID with the boot partion too. But there's no line with the UUID that mkswap /swapfile
returned. And the error when trying to boot still happens.