You are not logged in.
I'm a beginner on Arch and I was trying to fix a problem where I cannot wake up the system after suspend/hibernate Linux with KDE. So I read that I need at least a swap file or partition. But I ended up corrupting grub for not reviewing the swap created. So now I can't access the system, Linux doesn't load because of grub error and no TTY.
I created a swap file without taking in mind that the system is using BTRFS with subvolumes, so now I don't know if I have a swap file but I think I corrupt grub config.
I follow a guide and I did this:
```
sudo dd if=/dev/nvme0n1 of=/swapfile bs=1G count=18
sudo chmod 600 /swapfile
sudo sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
```
Then change grub configuration in /etc/default/grub in the specific line with `GRUB_CMDLINE_LINUX_DEFAULT= splash resume=/swapfile`
And I created and execute `/usr/sbin/update-grub` to update grub.
```
#!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
```
Then reboot the computer and I get black screen with the cursor and I cannot access even to TTY.
---
So I think I break grub and I tried to fix from live environment. I booted into an Archlinux live environment, but I couldn't reinstall Linux and grub from chroot, because an error with pacman dependencies.
My Arch system (also grub config) is on /dev/nvme0n1p2 in subvolume @
I followed this but I can't reinstall Linux or grub as I mentioned.
```
mount /dev/nvme0n1p2 /mnt
mount -o subvol=@ /dev/nvme1n1p2 /mnt/home
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
mount --bind /run /mnt/run
sudo chroot /mnt /bin/bash
sudo pacman -S grub linux # break dependencies
# grub-mkconfig -o /boot/grub/grub.cfg # update-grub
# sudo grub-install --root-directory=/mnt /dev/sda
Exit, unmount and reboot
```
How can I fix the system? I don't want to reinstall and configure Arch-limux again.
Thanks.
Last edited by rufusreal (2023-03-10 00:01:24)
Offline
By using random "installation guides" (such like the mess above) you wouldn't be running Arch Linux anyway. Please follow the official guide and wiki:
https://wiki.archlinux.org/title/Installation_guide
https://wiki.archlinux.org/title/GRUB
Should you then encounter any issues you at least qualify for support here and are more than welcome to do so...
Offline
By using random "installation guides" (such like the mess above) you wouldn't be running Arch Linux anyway. Please follow the official guide and wiki:
https://wiki.archlinux.org/title/Installation_guide
https://wiki.archlinux.org/title/GRUB
Should you then encounter any issues you at least qualify for support here and are more than welcome to do so...
Well, I had installed Arch I only want to fix the suspend mode ("sleep") on KDE and I tried to create a swap file and change grub config.
Because I think to suspend properly and wake up the system I need a swap file or swap partition.
I was running Arch good after installing with archinstall, the only problem was that I use the system after suspending.
Offline
Creating a swapfile on a Btrfs filesystem requires a Btrfs-specific procedure:
https://wiki.archlinux.org/title/Btrfs#Swap_file
Offline
Creating a swapfile on a Btrfs filesystem requires a Btrfs-specific procedure:
https://wiki.archlinux.org/title/Btrfs#Swap_file
Yes, I notice after changing the grub config. That's why I corrupt the grub config. But I don't how to fix grub from a live environment.
Offline
Offline
I mounted the affected system and did chroot.
But couldnt reinstall Linux and grub for dependencies issues.
Offline
You don't need to reinstall those packages. Inside the chroot run the appropriate 'grub-install' command (see the grub wiki page I posted above) and remove the swapfile entry from your 'etc/fstab' (I'm no expert by any means - there are more knowledgeable users out there...)
Last edited by dogknowsnx (2023-03-06 16:04:35)
Offline
Finally I could restore the system doing chroot from a live environment and reinstalling grub.
I think the problem with don't wake up after suspend is from Arch. Maybe I should try creating a swapfile under btrfs and see if it works. But for now I will wait and see if a new update of Archlinux fix the problem.
Last edited by rufusreal (2023-03-07 14:04:39)
Offline