Greetings all!
I’m running the current version of EndeavourOS on my System76 OryxPro.
I cloned my entire system to an external drive using Rescuezilla which worked fine and I can boot into that drive with no problems.
What I would prefer to do now, however, is to be able to mount that drive every few days or so while I’m running my main system and sync (with rsync) any updated files to that drive so that I always have an up-to-date system ready to go in case of a main drive failure.
Since the second drive is an exact clone of my main drive, it also has the same UUID which prevents me from mounting it while running the main system. Does anyone know how to change the UUID on the external drive so that it can be mounted? Many thanks!
This is kind of nit picky, but I have never seen a UUID for a storage device itself. The device usually has a device name i.e. /dev/sda but no UUID.
Partitions such as /dev/sda1 do have UUIDs which are assigned during formatting the partition. So you will need to mount more than one partition to update the entire SSD.
Pudge
EDIT:
The storage device does have a name. Do the following to display the device name
Greetings and thanks to all for the suggestions. They were most helpful! One problem I ran in to was luks encryption:
❯ sudo tune2fs /dev/sda2 -U f15ad81b-a169-411a-b428-f78900611728
[sudo] password for someUser:
tune2fs 1.47.0 (5-Feb-2023)
tune2fs: Bad magic number in super-block while trying to open /dev/sda2
/dev/sda2 contains a crypto_LUKS file system
I came across these two articles that dealt specifically with changing the UUID on an encrypted system:
For the sake of clarity, here are the partitions on my main drive (not my real UUIDs!):
and my cloned external drive before changing the UUID
(Realtek at /dev/sda):
Contents: FAT (32-bit version) — Mounted at /efi
Device: /dev/sda1
UUID: C427-BCCA
Partition Type: EFI System
Contents: LUKS Encryption (version 1) — Unlocked
Device: /dev/sda2
UUID: 38e2598f-7849-47b2-9e79-887daef783b8
Partition Type: Linux Filesystem
Contents: Ext4 (version 1.0) — Mounted at Filesystem Root
Device: /dev/mapper/luks-38e2598f-7849-47b2-9e79-887daef783b8
UUID: bd59ec6f-4b62-4596-bc79-3fa79cd08f8e
Partition Type: Linux Filesystem
I booted into my main operating system and connected the external drive attached via a usb port. I ran Disks (Gnome) to verify its location (the encrypted drive was on /dev/sda2) and ran the following command:
WARNING!
========
Do you really want to change UUID of device?
Are you sure? (Type 'yes' in capital letters): YES
This worked. The external drive is now visible from my main system’s file manager (Nemo) and has the UUID entered in the above command. Clicking on it asked for the encryption password which upon verification now gives me access from my main system to all the directories and files on the external drive. I can now use rsync to easily sync new or changed files on my main system with the identical one on the external drive. The external drive is also still bootable in case I screw up my main system (again).
Note that I only changed the UUID for the encrypted drive (/dev/sda2) since that is where all the files are that I wanted to access. I don’t know if it is necessary to change the other UUIDs or not.