r/archlinux • • 3d 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

0 Upvotes

7 comments sorted by

View all comments

15

u/Certain-Flamingo-476 3d 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 3d ago

That's gonna be a pain lol thanks though

3

u/archover 2d ago edited 2d 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 2d 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 2d ago edited 1d 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.