Cloning Rocky Linux 9 and Useful Commands to Use Afterwards
Drive Cloning Commands
DD and DDRESCUE
Changing PG, VG, and LV Names and 'UUIDs'
Naming Info: pvs, vgs, and lvs (those are three separate commands)
Detailed Information: pvdisplay, vgdisplay, lvdisplay (again, thee separate commands)
Scanning: pvscan, vgscan, lvscan (and again, thee separate commands)
Rename Commands: vgrename and lvrename
UUID for FAT: mlabel -i /dev/sdb1 ::abcd-wxyz
UUID for EXT4: tune2fs -U random /dev/sdb2 (...and it will demand this bed one first: e2fsck -f /dev/sdb2)
UUID for PV: pvchange --uuid /dev/sdb3 (...but first: vgchange -an WhatEverOriginalVGName, to view: pvdisplay /dev/sdb3, and to turn it back on: vgchange -ay WhatEverNewName)
Stuff to 'Worry About' (and correct) after changing a VG or LV Name
Mount the ROOT, BOOT, and EFI Directories so editing of these files can be done:
- /etc/default/grub
- /etc/fstab
- /boot/loader/entries/WhatEverEntryFile.conf
- /boot/grub2
- /boot/efi/EFI/WhatEverDirectory/grub.cfg (UUID of GRUB (EXT4) Partition)
Other CleanUP and Changes
"Computer Name": hostname, hostnamectl status, hostnamectl set-hostname WhatEverNewName (/etc/hostname)
/etc/host
EFI Related Stuff
General Info: efibootmgr
Verbose Info: efibootmgr -v
Change Boot Order: sudo efibootmgr -o 0002,0001,0000
Delete and Entry: efibootmgr -b 0003 -B
Add an Entry: efibootmgr -c -d /dev/nvme0n1p1 -p 1 -L "ApacheTrafficH" -l '\EFI\ApacheTrafficH\grubx64.efi'
Changing "Computer Names"
View Host Name: hostnamectl status
Set / Change Host Name: hostnamectl set-hostname NEWNAME
Another place to modify a Host Name: /etc/hosts