In which files can the UUID be found?

Solved
Pieridas Posted messages 22 Status Membre -  
Pieridas Posted messages 22 Status Membre -

Hello everyone,

Since I love living dangerously, I formatted the partition containing Kubuntu in dual boot, thinking that restoring a TimeShift snapshot would be a formality (like a system restore under Windows after a partition format).

The Timeshift restoration went well, but upon rebooting, I get a "UUID not found" message.

I noted the old UUID, but my problem is identifying all the boot files where it is located. I have already corrected it in /etc/fstab, but the error message persists.

Thank you in advance for your insights.


4 réponses

mamiemando Posted messages 33541 Registration date   Status Modérateur Last intervention   7 935
 

Hello,

UUIDs were created to abstract the device associated with a partition, particularly in the /etc/fstab file. In the distant past, partitions were directly designated by their block device (for example, /dev/sda1). UUIDs were introduced in order to free us from the naming conventions of these devices. That said, one could perfectly replace the shaky UUIDs with the corresponding block device temporarily while fixing the issue.

Specifically, these are symbolic links defined in /dev/disks/by-uuid:

ls -l /dev/disk/by-uuid/

Example: for your reference (these UUIDs are specific to my machine and you will need to adapt what follows with your own UUIDs)

total 0 lrwxrwxrwx 1 root root 15 15 April 12:10 77822326-b1ac-47e5-9b4f-492da91bc47e -> ../../nvme0n1p6 lrwxrwxrwx 1 root root 15 15 April 12:10 866C654E6C6539D7 -> ../../nvme0n1p1 lrwxrwxrwx 1 root root 15 15 April 12:10 BC3866373865F136 -> ../../nvme0n1p4 lrwxrwxrwx 1 root root 15 15 April 12:10 C8CEA8F8CEA8DFC4 -> ../../nvme0n1p5 lrwxrwxrwx 1 root root 15 15 April 12:10 DA65-6F4B -> ../../nvme0n1p2 lrwxrwxrwx 1 root root 15 15 April 12:10 e6774e10-887a-4439-925b-0edae73e601f -> ../../nvme0n1p7 lrwxrwxrwx 1 root root 15 15 April 12:10 f7443d48-33a2-4b88-ac58-f6d4444fce26 -> ../../nvme0n1p8

You can also find them using the blkid command:

sudo blkid
/dev/nvme0n1p7: UUID="e6774e10-887a-4439-925b-0edae73e601f" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="root" PARTUUID="77747554-a5f6-4c12-ad1e-81b3c176d7e4" /dev/nvme0n1p5: BLOCK_SIZE="512" UUID="C8CEA8F8CEA8DFC4" TYPE="ntfs" PARTUUID="7ce0fd8a-dd63-43c0-ad2e-bb34d1ff97ae" /dev/nvme0n1p3: PARTLABEL="Microsoft reserved partition" PARTUUID="87bee9fc-6dd9-42bf-baf3-d8019b3a55d0" /dev/nvme0n1p1: LABEL="Recovery" BLOCK_SIZE="512" UUID="866C654E6C6539D7" TYPE="ntfs" PARTUUID="a0d420eb-7f79-45ca-b92c-696baf402159" /dev/nvme0n1p8: UUID="f7443d48-33a2-4b88-ac58-f6d4444fce26" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="aacde068-9697-43e3-8c0c-c98872cf3983" /dev/nvme0n1p6: UUID="77822326-b1ac-47e5-9b4f-492da91bc47e" TYPE="swap" PARTUUID="020eacdb-5682-44c4-8318-3ecc020fcc72" /dev/nvme0n1p4: LABEL="OS" BLOCK_SIZE="512" UUID="BC3866373865F136" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="23271983-722b-4698-a4ad-3c48236d05ed" /dev/nvme0n1p2: LABEL_FATBOOT="SYSTEM" LABEL="SYSTEM" UUID="DA65-6F4B" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="e861270a-e094-41c1-a69a-fe61f2a2cf76"

Then you need to correct your /etc/fstab file according to these UUIDs (or simply use the corresponding device directly). You will likely have to do this through a live USB (any USB stick capable of installing Linux will do).

Assuming you have booted from your Live USB:

1) Retrieve the UUIDs of your partitions

sudo blkid

2) Identify the partition that contains /etc/fstab (most likely the partition corresponding to /).

sudo fdisk -l
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors Model: SAMSUNG MZVLW512HMJP-00000 Units: sectors of 1 × 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt Disk identifier: CCA34840-4481-48C5-B59B-5DA342615950 Device Start End Sectors Size Type /dev/nvme0n1p1 2048 1087487 1085440 530M Windows Recovery Environment /dev/nvme0n1p2 1087488 1619967 532480 260M EFI System /dev/nvme0n1p3 1619968 1882111 262144 128M Microsoft Reserved /dev/nvme0n1p4 1882112 281618431 279736320 133.4G Microsoft Basic Data /dev/nvme0n1p5 998418432 1000212479 1794048 876M Windows Recovery Environment /dev/nvme0n1p6 281618432 289431551 7813120 3.7G Linux Swap Partition /dev/nvme0n1p7 289431552 387088383 97656832 46.6G Linux Filesystem /dev/nvme0n1p8 387088384 998418431 611330048 291.5G Linux Filesystem The partition table entries are not in disk order.

In this example, the filesystem indicates that it is either /dev/nvme0n1p7 or /dev/nvme0n1p8. The size suggests it is more likely /dev/nvme0n1p7.

3) Mount this partition in an arbitrary folder (let's say /mnt/linux).

sudo mkdir /mnt/linux sudo mount /dev/nvme0n1p7 /mnt/linux

4) If it is the correct partition, the file /mnt/linux/etc/fstab should exist (if not, umount /mnt/linux, then return to step 2 with another device) and open it with your editor of choice, for example gedit or nano.

sudo gedit /mnt/linux/etc/fstab &

5) Correct the UUIDs according to the result of sudo blkid. Save and exit this file. In my case, here is what this file contains:

UUID=e6774e10-887a-4439-925b-0edae73e601f / ext4 errors=remount-ro 0 1 UUID=DA65-6F4B /boot/efi vfat umask=0077 0 1 UUID=f7443d48-33a2-4b88-ac58-f6d4444fce26 /home ext4 defaults 0 2 UUID=77822326-b1ac-47e5-9b4f-492da91bc47e none swap sw 0 0

6) Unmount your partition and reboot:

sudo umount /mnt/linux sudo reboot

7) If the UUID of the swap has changed, you may also need to correct it in /etc/initramfs-tools/conf.d/resume and run:

sudo dpkg-reconfigure initramfs-tools

Good luck

2
.eric Posted messages 1386 Registration date   Status Membre Last intervention   87
 

Hello

Subject to all reservations, I find this in Ubuntu if it helps a little:

"partitions are now designated in /etc/fstab and /boot/grub/menu.lst by their UUID"

0
Pieridas Posted messages 22 Status Membre
 

Thank you Eric

I will also need to restore the old UUID of the partition

0
.eric Posted messages 1386 Registration date   Status Membre Last intervention   87
 

Hello

I'm finding operations but I don't understand anything, I've never touched Linux :-(

 https://fr.linux-console.net/?p=10541

https://fr.linux-console.net/?p=22379

https://forum.ubuntu-fr.org/viewtopic.php?id=72352

0
Pieridas Posted messages 22 Status Membre
 

Thank you Mamiemando for your explanations that I will keep as precious. In fact, in the meantime, I reinstalled it because I was technically overwhelmed.

0