lsblk # see what disks are there.
# connect a new SSD disk
# if it is not detected, scan ports
echo "- - -" >/sys/class/scsi_host/host0/scan # where host[0-7] is the SATA port number to which the drive is connected.
# If you specify a host with another connected drive
# nothing will happen, the system will simply check the port.
# My system disk sda. I need to replace sda on sdb.
fdisk -l /dev/sdb
# Check that the disk is larger than old disk and that it has the same type (GPT/MBR)
#Change mbr to gpt
gdisk /dev/sdb
w
y
#Change gpt to mbr
parted /dev/sdb
(parted) mklabel msdos
y
quit
#copy partitions
sfdisk -d /dev/sda | sfdisk --force /dev/sdb
#Copying data
dd if=/dev/sda1 of=/dev/sdb1
dd if=/dev/sda2 of=/dev/sdb2
dd if=/dev/sda3 of=/dev/sdb3
grub-install /dev/sdb
shutdown now
# Here I disconnected the old disk and selected the new SSD as bootable in the BIOS
Node is work normal.
Disconnecting for 30 seconds to replace the disk is not the same as disconnecting for 1-2 hours to copy partitions with a cloner.
Here are some difficulties:
1. The old disk is 80 Gb, the new one is 480 Gb.
The new disk had no free space and it was impossible to distribute it.
The sfdisk and cfdisk programs did not see any problem with this and did not react in any way, it was simply impossible to change the disk.
It was solved by the parted program:
swapoff /dev/pve/swap
parted
>>print # the program complains about the unused space, offers to fix
>>fix
>>quit
swapon /dev/pve/swap
After fixing the disk layout, cfdisk normally allowed dividing the free space into 6 partitions
for 6 connected large storage disks,
I placed ceph databases for large HDDs on the SSD partitions.
2. Proxmox not only uses GRUB, it has its own bootloader backup subsystem.
Although everything works for me, it would not be superfluous to do:
proxmox-boot-tool status
proxmox-boot-tool init /dev/sdb
grub-install /dev/sdb
That's all now.