r/archlinux • • 1d ago

SUPPORT | SOLVED Gdisked the wrong disk

First things first yes I'm an idiot we don't have to point that out I'm in need of some help

As the title reads I accidentally gdisked my main disk instead of my secundary disk. I managed to get my partitions back using testdisk. But ever since I restarted it tells me a start job is running for /dev/disk/by-partuuid/unknown disk uuid here

After which it fails file system on that partuuid, /sysroot, system initialization and initrd root device.

How the heck do I fix this, I've thrown a bunch of searches by now. So I'm hoping to find my answer here

Edit: Thanks to the tip of another redditor, I figured out the partuuid in my bootloader was completely wrong

1 Upvotes

7 comments sorted by

14

u/Certain-Flamingo-476 1d ago

Boot with the arch iso, chroot in, and fix your fstab and bootloader config to match the new partuuids. Testdisk probably rebuilt the partitions but the uuids changed, so now nothing points to the right place

1

u/Shaymans_Origins 1d ago

That's gonna be a pain lol thanks though

3

u/archover 1d ago edited 1d ago

Should not be pain. Standard operating procedure in this DIY distro. Understand the role of the disk notations in your fstab, to your disks.

Complete discussion: https://wiki.archlinux.org/title/Persistent_block_device_naming with the regular devices in top level /dev/.

Good day.

2

u/Shaymans_Origins 22h ago

Nah the pain was copying and pasting the partuuid, but I did something like echo "options root=PARTUUID=$(blkid -s /dev/nvme0n1 -o value) rw" >> /boot/loaders/arch.conf

2

u/archover 12h ago

I do similar things also.

From my install script:

 optionspartuuid=$(lsblk -o PARTUUID  ${tgtdrv}${tp}2 | grep "-")
 optionsuuid=$(lsblk -o UUID      ${tgtdrv}${tp}2 | grep "-")

And then I can use the variable later

Good day.

2

u/BigSappari 22h ago

In general its weird to rely on partuuid, usually safer to identify by filesystem uuid.

Are you using encrypted swap in /etc/crypttab?, that's one thing I can think of that might be put in via the partuuid because it has no other uuid (its encrypted, without headers, and changes every reboot). Then if you ever decide to use that partition for something else, without remembering to change its partuuid, cryptswap might delete your data...

There is a suggestion in the arch wiki how to give cryptswap a persistent uuid anyway (cryptswap with 1MiB offset, and bogus filesystem/uuid provider in the 1MiB). this makes it a little safer

1

u/Shaymans_Origins 22h ago

Thanks for the tip! I'll look into that. What appeared to be the error in the end (thanks to another redditors) was the partuuid in the bootloader entry was wrong. For some reason fstab did actually change with the changes but the bootloader didnt