What Command Line needed to create "Default partition schema" on a disk?


What Command Line is needed to create “Default partition schema” on a disk, the same as the clr-installer would create?

I connected a secondary fresh new SSD to a SATA port 2 (same model/size)

I boot my clear-30800-live-server installed on SATA Port 1, is only a command line, no GUI.

I 'd like to create the “Default partition schema” on the new SATA disk.
Same as what the installer would create:

Destructive Automatic

Default partition schema

Then use perhaps Rsync to copy the / root partition to the new SSD on port 2 /dev/sdb3.

dd command not working well as it clones the Disk Identifier and all the UUID’s, PARTUUID’s.

Later Rsync or alternative, can keep root /sdb3 updated incrementally as a backup allowing later easy switch to this Port 2 SSD and boot if /dev/sda fails.

Try clonezilla. At least it should be able to clone your root partition very efficiently. The swap partition can be manually created and then enable it. For the boot partition, I don’t know.

Hi Clonezilla also clones UUID and it created the same issues as dd.

Okay, I recall that I had once change UUID in Gparted, you can try that.

So even if a volume cannot be mounted because of UUID name conflicts, Gparted still detects it and I think the entry to generate a UUID is in the right-click menu.

doct0rHu > No, GParted cannot change the UUID on the EFI partition

Only the root partition can GParted change the UUID. Systems obviously do not boot from the root partition, so, same issues apply as above mentioned in first post.

UEFI cannot differentiate the boot part with any other identifier other than UUID, the result is that there’s two devices using the same UUID for the EFI boot part making it impossible to boot from the sdb disk, even when sdb is set as priority boot device 1.

The only way to get unique fresh new UUID (on my systems) was to VPN, IPMI remotely boot virtual iso usb of Clear Linux installer and select destructive install then install Clear Linux to destination storage device. Then later reboot machine to virtual iso usb GParted, delete sdb3 (root), copy sda3 (root), paste to sdb3 (root) then change the UUID on sdb3.

The point is we need a command line tool to destroy a storage device and partition it with a clean default partition schema with fresh new UUID’s without being forced to install. This tool should be in the storage utilities bundle in all iso images and default installs. Will allow us to ssh to a machine and prepare a storage device remotely.

This should be simple with 1 command line, macOS diskutil tool does exactly this:

diskutil eraseDisk ext4 clrbk /dev/sd3

boom, done,
Then rsync sda3 to sdb3
Now the system can boot from either sda or sdb (backup), just switch the boot priority in the UEFI.

This would take about 5 minutes, rather than 4 hours described above.

1 Like