A start job is running for /dev/disk/by-uuid
As I was booting up my Arch Linux box, systemd informed me of a start job running for /dev/disk/by-uuid. 90 seconds later, the job timed-out and some fashionable colored messages flashed by with the speed of light.
Querying journald by issuing the command
journalctl –boot revealed the following issue:
systemd: dev-disk-by\x2duuid-ab341d47\x2d2173\x2d444d\x2d93aa\x2d058942514b04.device: Job dev-disk-by\x2duuid-ab341d47\x2d2173\x2d444d\x2d93aa\x2d058942514b04.device/start timed out. systemd: Timed out waiting for device /dev/disk/by-uuid/ab341d47-2173-444d-93aa-058942514b04. systemd: Dependency failed for /dev/disk/by-uuid/ab341d47-2173-444d-93aa-058942514b04. systemd: Dependency failed for Swap. systemd: swap.target: Job swap.target/start failed with result 'dependency'. systemd: dev-disk-by\x2duuid-ab341d47\x2d2173\x2d444d\x2d93aa\x2d058942514b04.swap: Job dev-disk-by\x2duuid-ab341d47\x2d2173\x2d444d\x2d93aa\x2d058942514b04.swap/start failed with result 'dependency'. systemd: dev-disk-by\x2duuid-ab341d47\x2d2173\x2d444d\x2d93aa\x2d058942514b04.device: Job dev-disk-by\x2duuid-ab341d47\x2d2173\x2d444d\x2d93aa\x2d058942514b04.device/start failed with result 'timeout'.
Systemd was telling me that the swap partition could not be mounted by using the filesystem’s unique identifier (UUID). At least the system didn’t drop me into emergency mode, which in my experience, is what usually happens when systemd detects dependency failures.
Anyhow, as expected, the system didn’t have a mounted swap partition. Simply issuing
swapon /dev/sdxy worked without issues, so the partition itself was seemingly fine.
It’s not always
Eventually, it dawned on me that I had installed Slackware -current on the same disk a few days earlier. To preserve precious disk space, I had opted to re-use the swap partition when installing Slackware. The Slackware installer would then have run
mkswap /dev/sdxy and wiped the old unique identifier (UUID). Whoops!
Persistent naming schemes
With that in mind, I needed to query the specific block device for its UUID by issuing
lsblk -o UUID /dev/sdxy. With the new UUID in hand, the final step was to modify
/etc/fstab by entering the correct UUID for the swap partition.
And that’s persistent naming schemes for you.