You are not logged in.
Hello!
After a fresh install of Arch I noticed that the system was loading for a long time (minute or two).
journalctl showed the following error:
Timed out waiting for device /dev/disk/by-uuid/1878cf5f-6b9c-7340-9150-b677f351668b.I looked at fstab:
cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
UUID=a2e1c385-54d0-4faa-8cc1-b97ed3c18685 / ext4 w,relatime 0 1
# /dev/sda3
UUID="1878cf5f-6b9c-7340-9150-b677f351668b" none swap defaults 0 0and blkid
sudo blkid
/dev/sda1: UUID="CEAE-76C6" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="8a49343d-b0a5-cd4a-80d8-5efc55052411"
/dev/sda2: UUID="a2e1c385-54d0-4faa-8cc1-b97ed3c18685" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="6a6371e8-ed43-d540-afe9-3b9460c3d536"
/dev/sda3: PTUUID="03261a9b-b451-504a-946b-98a4d1e08b29" PTTYPE="gpt" PARTUUID="1878cf5f-6b9c-7340-9150-b677f351668b"I thought that probably I got some error with swap:
free -h
total used free shared buff/cache available
Mem: 3.4Gi 426Mi 2.6Gi 2.0Mi 332Mi 2.7Gi
Swap: 0B 0B 0BIt seemed like my swap partition was not active (it is formatted as GPT).
So I did mkswap and swapon on sda3, and the partition appeared after that:
swapon --show
NAME TYPE SIZE USED PRIO
/dev/sda3 partition 7.4G 0B -2And blkid showed sda3 as having an UUID:
sudo blkid
/dev/sda1: UUID="CEAE-76C6" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="8a49343d-b0a5-cd4a-80d8-5efc55052411"
/dev/sda2: UUID="a2e1c385-54d0-4faa-8cc1-b97ed3c18685" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="6a6371e8-ed43-d540-afe9-3b9460c3d536"
/dev/sda3: UUID="b8cb58f2-3cbe-4013-a573-a8803c26d502" TYPE="swap" PTUUID="03261a9b-b451-504a-946b-98a4d1e08b29" PTTYPE="gpt" PARTUUID="1878cf5f-6b9c-7340-9150-b677f351668b"I've put in fstab, but the problem persisted.
fstab manpages said that PARTUUID could be used. I replaced UUID of my swap in fstab with PARTUUID that I took from blkid output. After the next rebbot I got a new message, this time accompanied with a corresponding systemctl --failed error message:
Failed to activate swap /dev/disk/by-partuuid/1878cf5f-6b9c-7340-9150-b677f351668b.* dev-disk-by\x2dpartuuid-1878cf5f\x2d6b9c\x2d7340\x2d9150\x2db677f351668b.swap loaded failed failed /dev/disk/by-partuuid/1878cf5f-6b9c-7340-9150-b677f35166>As an additional bonus, the brightness of the screen went down on boot (can be changed, though). It works normally if UUID is back at fstab.
The last thing that I tried was to comment swap line out in fstab, and it got rid of relevant error messages (brightness thing persisted, though).
I can live that way or even activate swap manually each time I reboot, but that would be kinda nice if I could have my swap partition activated on load. Unfortunately, my knowledge ends at this very point. Could you give me a little help with understanding what I need to do next to fix it?
Thank you in advance!
PS. How could swap partition mess my brightness up??
SOLUTION
The answer that finally made me understand the problem is contained in the V1del's post.
Solution to the problem - dont't partition the partition, as Scimmia stated. Flush /dev/sda[?] with wipefs, then mkswap, swapon, genfstab, don't create a partition in partition with fdisk (in /dev/sda[?]).
Last edited by soangrypanda (2021-05-30 15:01:27)
Offline
There's a typo in your fstab on the line for swap. You wrote "efaults" instead of "defaults" (the "d" is missing). Maybe that's the problem? Is there an error message about this in the system journal somewhere?
Offline
There's a typo in your fstab on the line for swap. You wrote "efaults" instead of "defaults" (the "d" is missing). Maybe that's the problem? Is there an error message about this in the system journal somewhere?
Hey, Ropid! Thank you for noticing the typo, but it seems like I made it during the post editing (gonna fix it now). No journal messages other than mentioned in the post appeared.
Last edited by soangrypanda (2021-05-29 16:00:23)
Offline
Try removing the quotation marks around the UUID in the fstab entry.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Offline
I think you are not doing anything wrong. Your fstab entry should work.
I'll try listing details from here to compare with yours:
Here is what I see for my swap partition in the "blkid" output (I added line-breaks for easier reading):
/dev/nvme0n1p4:
LABEL="arswap"
UUID="d3d0877e-c2b9-4625-88f9-af65d5eaf83a"
TYPE="swap"
PARTLABEL="arswap"
PARTUUID="6911df91-49a5-4607-9bd2-9bf875736d4b"My fstab entry looks like this, I've set PARTLABEL myself in GParted with the "Name Partition" menu entry and use that for mounting:
PARTLABEL=arswap none swap discard 0 0Your blkid entry looks like this:
/dev/sda3:
UUID="b8cb58f2-3cbe-4013-a573-a8803c26d502"
TYPE="swap"
PTUUID="03261a9b-b451-504a-946b-98a4d1e08b29"
PTTYPE="gpt"
PARTUUID="1878cf5f-6b9c-7340-9150-b677f351668b"Maybe those "PTTYPE=gpt" and "PTUUID=..." entries you have are somehow involved with the problem? What are those entries? I can't find explanations I understand online.
Last edited by Ropid (2021-05-29 16:51:46)
Offline
What's the output of
lsblk -f
sudo file -s /dev/sda3Offline
Try removing the quotation marks around the UUID in the fstab entry.
Hey! Tried, gotten the original error.
Offline
PARTUUID and UUID are different things, they're not interchangable.
Hey! the manpages are saying:
It's also possible to use PARTUUID= and PARTLABEL=. These partitions identifiers are supported for example for GUID Partition Table (GPT).Should they be used alongside with UUID?
Offline
Yes, but you can't issue them as UUID and it looks like you did that.
There might be other issues beyond that, though.
Offline
I think you are not doing anything wrong. Your fstab entry should work.
...
Maybe those "PTTYPE=gpt" and "PTUUID=..." entries you have are somehow involved with the problem? What are those entries? I can't find explanations I understand online.
Thanks for an idea! I added label to the swap partition with swaplabel (worked after I mkswap It). But after trying to add it with partx -a I got the following output:
partx: /dev/sda: error adding partition 3In addition, label was gone after reboot.
It seems like the swap partition was not installed properly, right?
As for your questions - to be honest - I have no idea where these lines came from.
Offline
What's the output of
lsblk -f sudo file -s /dev/sda3
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
|-sda1 vfat FAT32 CEAE-76C6
|-sda2 ext4 1.0 a2e1c385-54d0-4faa-8cc1-b97ed3c18685 97G 6% /
`-sda3sudo file -s /dev/sda3
/dev/sda3: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 15525136 sectors, extended partition table (last)It seems like I haven't deleted the table from the last install, have I?
Offline
It looks like there's a partition table inside /dev/sda3? You can run tools like fdisk with a filename as argument and they will then work inside that file as if it is a disk. Maybe you've done that with "/dev/sda3" as argument and now your /dev/sda3 partition has a partition table inside it and the system gets confused somehow about this.
That said, running mkswap should overwrite what's inside /dev/sda3? I don't understand what's going on.
You could try to wipe the contents of /dev/sda3 manually first before running mkswap. If you are using an SSD, you can wipe a partition instantly like this:
blkdiscard /dev/sda3EDIT:
I tried looking in "man mkswap" and found this here:
mkswap, like many others mkfs-like utils, erases the first partition block to make any previous filesystem invisible.
However, mkswap refuses to erase the first block on a device with a disk label (SUN, BSD, ...).
This could be the reason why your partition doesn't turn into a normal swap partition after you run mkswap? Maybe the mkswap tool is seeing the partition table inside sda3 and then refuses to delete it?
Last edited by Ropid (2021-05-30 00:16:58)
Offline
It looks like there's a partition table inside /dev/sda3? Y
Hey!
So, after your suggestion I wiped the table on /dev/sda3 with wipefs --all --force, then created a new GPT table on the disk with fdisk (and created a new linux swap partition).
After that, I rebooted, and then did standard mkswap, swapon, genfstab stuff. Then rebooted. The problem persisted.
The weird thing that I noticed after the above changes was that fdisk -l output was a bit different from the output of p command inside fdisk /dev/sda3:
sudo fdisk -l
Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: KINGSTON RBUSNS8
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AF59AAC9-368E-E942-9315-42E3CC75F19B
Device Start End Sectors Size Type
/dev/sda1 4096 618495 614400 300M EFI System
/dev/sda2 618496 234542652 233924157 111.5G Linux filesystem
/dev/sda3 234542653 250067789 15525137 7.4G Linux filesystem # <-- here, there is /dev/sda3 with Linux filesystem.sudo fdisk /dev/sda3
Welcome to fdisk (util-linux 2.36.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda3: 7.4 GiB, 7948870144 bytes, 15525137 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9A400B61-992A-1843-B312-AA7BD71342F5
Device Start End Sectors Size Type
/dev/sda3p1 2048 15525103 15523056 7.4G Linux swap # <-- here, a new device appeared with the given type.Just in case, I found no sda3p1 in /dev/:
ls /dev/ | grep sda3p1 # <-- gave me an empty output It seems like I am failing to notify the system about changes in disks? fdisk wrote the changes successfully, with notification that changes would came after reboot (what I did, as wrote above).
EDIT
So, the last thing I did was looking into the file type, which stayed the same:
sudo file -s /dev/sda3
/dev/sda3: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 15525136 sectors, extended partition table (last)Last edited by soangrypanda (2021-05-30 13:06:38)
Offline
So, after your suggestion I wiped the table on /dev/sda3 with wipefs --all --force, then created a new GPT table on the disk with fdisk (and created a new linux swap partition).
So you fixed it, then made exactly the same mistake again. STOP PARTITIONING THE PARTITION!
Offline
soangrypanda wrote:So, after your suggestion I wiped the table on /dev/sda3 with wipefs --all --force, then created a new GPT table on the disk with fdisk (and created a new linux swap partition).
So you fixed it, then made exactly the same mistake again. STOP PARTITIONING THE PARTITION!
Hey!
Stop yelling at me
(sounds almost like a meme, though).
But, I thought I need to make a swap partition when there is no one, and mount it only after that? Maybe I got all confused with this part of an installation guide - Installation_guide#Partition_the_disks
Offline
You need to add a partition to /dev/sda and not to /dev/sda3 (note the lack of a 3, this is important) your disk is /dev/sda the numbers after that are the partitions. if /dev/sda3 is intended to be the swap partition then you don't have to do anything with fdisk and just run
mkswap /dev/sda3(... directly after wipefs'ing /dev/sda3)
Last edited by V1del (2021-05-30 13:27:52)
Offline
You need to add a partition to /dev/sda and not to /dev/sda3 (note the lack of a 3, this is important) your disk is /dev/sda the numbers after that are the partitions. if /dev/sda3 is intended to be the swap partition then you don't have to do anything with fdisk and just run
mkswap /dev/sda3(... directly after wipefs'ing /dev/sda3)
Kind Sir, accept my deepest gratitude!
swapon --show
NAME TYPE SIZE USED PRIO
/dev/sda3 partition 7.4G 0B -2It seems that I was fundamentally confused by the difference between a device and a partition. That is indeed a good chance to fill this gap in knowledge.
During these few days I indeed learned a lot of new things about the system due to the help of all of you, gents. Thank you all for dedicating a portion of your time to read this post and comment your suggestions.
I am thrilled to call this problem SOLVED
.
Offline