LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Reply
  Search this Thread
Old 09-03-2023, 07:09 PM   #1
johnywhy
Member
 
Registered: Aug 2011
Posts: 34

Rep: Reputation: Disabled
Restore Swap Petition?


I'm running arch, installed with archinstall[1].

I read that arch uses zram[2] for swapping, not disk. Also read somewhere that zram doesn't use disk for swap, so i don't need a swap partition. (I don't get why archinstall creates a swap partition if it's not needed)

Believing it wasn't needed, i deleted the swap partition (using cfdisk from the Live ISO).

Now arch won't boot. I'm getting a message about waiting 10 seconds for a partition, and then i get dropped into emergency shell.

Code:
Loading keymap.... Done. 
Waiting 10 seconds for device /dev/disk/by-partuuid/ecec0......[long number]
Error: Device /dev/disk/by-partuuid/ecec0......[long number] not found.

I attempted to recreate a swap partition in the same location on disk, using cfdisk, of "Linux Swap" type. Then i did mkswap on the reformatted swap partition.

Code:
# mkswap /dev/sdb2
But still not booting.

Do i need to change a partition ID in a grub config file?

I also attempted to mount the boot partition from the live ISO, and chroot into it, but that fails.

Code:
# mount /dev/sdb1 /mnt
# arch-chroot /mnt
chroot: failed to run command /bin/bash No such file or directory. 
# chroot /mnt
chroot: failed to run command /usr/bin/zsh No such file or directory.
[1]: https://wiki.archlinux.org/title/archinstall
[2]: https://wiki.archlinux.org/title/Zram

Last edited by johnywhy; 09-04-2023 at 12:49 AM.
 
Old 09-03-2023, 08:21 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,342
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Quote:
I'm getting a message about waiting 10 seconds for a partition, but it never works.
Does the message identify what partition it's waiting for?

Have you checked /etc/fstab to make sure it reflects the actual partition structure?
 
1 members found this post helpful.
Old 09-03-2023, 08:26 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,741

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
Since you didn't delete or comment out the line that pertains to swap in the /etc/fstab the system is not booting. Since reformatting creates a new UUID the swap partition is still not active. From the emergency shell try either commenting out or changing the UUID to match.
 
1 members found this post helpful.
Old 09-03-2023, 11:40 PM   #4
johnywhy
Member
 
Registered: Aug 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
Does the message identify what partition it's waiting for?

Have you checked /etc/fstab to make sure it reflects the actual partition structure?
Thx for replies.

I mounted the system partition, and checked /etc/fstab. It doesn't contain incorrect mounting info for the swap directory, because it doesn't contain any mount info for the swap partition (or for any other partition).

Plz see my original question for more details.

Last edited by johnywhy; 09-04-2023 at 12:58 AM.
 
Old 09-04-2023, 10:17 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,741

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
Did you actually mount or change to the correct directory? You need to mount the root partition and then edit the mounted directory's /etc/fstab file. There isn't a need to use chroot. Is the root partition encrypted?
 
1 members found this post helpful.
Old 09-04-2023, 10:38 AM   #6
johnywhy
Member
 
Registered: Aug 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Did you actually mount or change to the correct directory? You need to mount the root partition and then edit the mounted directory's /etc/fstab file.
I believe so.

Code:
# mount /dev/sdb1 /mnt
# cd /mnt/etc
# nano fstab
Quote:
Is the root partition encrypted?
No.

Last edited by johnywhy; 09-04-2023 at 10:48 AM.
 
Old 09-04-2023, 11:14 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,741

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
And the file is empty?
While I have installed Arch in a VM in the past I have not played with it in awhile.

Last edited by michaelk; 09-04-2023 at 11:19 AM.
 
Old 09-04-2023, 11:52 AM   #8
johnywhy
Member
 
Registered: Aug 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
And the file is empty?
It contains generic comments, like this:
Quote:
# Static information about the filesystems.
# See fstab(5) for details.
I was advised, instead of changing something in a config file, like fstab or grub, to match the new UUID of the new partition, to instead change the UUID of the new swap partition to match the old number. I'm going to try that now.

Last edited by johnywhy; 09-04-2023 at 11:53 AM.
 
Old 09-04-2023, 12:54 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,741

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
I would guess or assume that Arch uses systemd to mount the filesystems instead of /etc/fstab. Yes, you can change the current swap UUID to match the old.
 
Old 09-04-2023, 01:19 PM   #10
johnywhy
Member
 
Registered: Aug 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I would guess or assume that Arch uses systemd to mount the filesystems instead of /etc/fstab. Yes, you can change the current swap UUID to match the old.
I used gdisk to change the GUID on the swap part. Now on boot i'm getting

Quote:
starting systemd
...hook...
...keymap...
performing fsk on [restored ID]
mounting [restored ID] on real root
VFS: Can't find ext4 filesystem
mount: /new_root: wrong fs type, bad option, or [etc]
failed to mount

Last edited by johnywhy; 09-04-2023 at 01:21 PM.
 
Old 09-04-2023, 02:16 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,741

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
Did you change the correct filesystem?
 
1 members found this post helpful.
Old 09-04-2023, 02:20 PM   #12
johnywhy
Member
 
Registered: Aug 2011
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Did you change the correct filesystem?
Filesystem?
If you mean, correct partition, then yes, i believe so.
I think the boot wouldn't have gotten as far as it did if i had altered the system partition.

Last edited by johnywhy; 09-04-2023 at 02:23 PM.
 
Old 09-04-2023, 04:46 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,741

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
Depends on how you configured your install but for me with an efi default setup, archinstall created 2 partitions. /dev/sda1 for /boot and /dev/sda2 for the / partition. The boot partition was defined in /etc/fstab but / is a kernel command line parameter as well as zswap. Do you have a /boot/loader/entries directory? Check the conf files to see if the UUIDs match your /(root) filesystem.
 
1 members found this post helpful.
  


Reply

Tags
arch, swap



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore MySQL Dump File But I want it to restore with different names? helptonewbie Linux - Newbie 5 07-08-2009 05:09 AM
mksysb restore - Wrong OS level for restore pobman AIX 0 12-10-2008 09:32 PM
How to restore files using the restore command ? SKYNAT Linux - Newbie 2 12-28-2007 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 09:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration