Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 21941  / 1 Year ago, tue, january 10, 2023, 12:53:39

I am 100% new to Linux as of yesterday and I seem to have done something wrong. I had the system up and running last night with no obvious issues but today when I try to boot up I get an error and the whole thing fails.


Some background: My computer has a 500 GB SSD which is what Ubuntu (version 20.04.1) was installed onto and a 2TB HDD which I formatted for use last night. I suspect that my issue is related to that fact, because I was able to restart the system multiple times without issue before I formatted it. Unfortunately I do not know enough about Ubuntu to even know where to start, and I could not seem to find any help for my specific situation online.


On startup I'm presented with 3 options



  • Ubuntu

  • Advanced options for ubuntu

  • UEFI Firmware Settings


Here's the specific output I'm getting after selecting Ubuntu:


    [Failed] Failed to activate swap /swapfile
[Depend] Dependency failed for Swap

Let me know if there's any other information that's relevant to the issue or if there's anything I should try. All advice is appreciated.


Here is the output from running the recommended commands in the root access:


    grep -i swap /etc/fstab
/swapfile none swap sw 0 0

ls -al /swapfile
-rw------- 1 root root 2147483648 Sep 24 03:41 /swapfile

More From » boot

 Answers
4

That all looks normal, but let's recreate the /swapfile.


Boot to Recovery Mode like you just did, and do this...


Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.


In the terminal (or root # prompt)...


sudo swapoff -a           # turn off swap
sudo rm -i /swapfile # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile # set proper file protections
sudo mkswap /swapfile # init /swapfile
sudo swapon /swapfile # turn on swap
free -h # confirm nnG RAM and 4G swap

Confirm this /swapfile line at the end of /etc/fstab... and confirm no other “swap” lines...


To edit, use sudo -H gedit /etc/fstab or sudo pico /etc/fstab


/swapfile    none    swap    sw      0   0



reboot                    # reboot and verify operation

Update #1:


/etc/fstab was messed up and causing the file system to be read-only. Only had 1 hour on freshly installed Ubuntu, so I recommended to reinstall Ubuntu again.


UUID="fae3ba3a-abaf-4eca-8139-40d5328d017c" /srv ext4 errors=remount-ro 0

[#2646] Wednesday, January 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tatoethin

Total Points: 377
Total Questions: 110
Total Answers: 98

Location: Saudi Arabia
Member since Sat, Aug 20, 2022
2 Years ago
;