GPT disks and parted / gdisk
Just notes.
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk ├─sda1 8:1 0 1M 0 part └─sda2 8:2 0 60G 0 part └─md0 9:0 0 60G 0 raid1 / sdb 8:16 0 931.5G 0 disk └─sdb1 8:17 0 60G 0 part └─md0 9:0 0 60G 0 raid1 /
# blkid /dev/sda /dev/sda: PTUUID="e068d9e9-f2c3-4cfd-8927-17971d94bcae" PTTYPE="gpt" # blkid /dev/sdb /dev/sdb: PTUUID="7d3e7e2c-6b19-4d5c-a75b-8afec60cb1ec" PTTYPE="gpt"
# parted -a optimal /dev/sda set 3 swap on Information: You may need to update /etc/fstab. # parted -a optimal /dev/sda set 4 raid on Information: You may need to update /etc/fstab. # parted -a optimal /dev/sda print Model: ATA CT1000BX500SSD1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 2097kB 1049kB bios_grub 2 2097kB 64.4GB 64.4GB 3 64.4GB 75.2GB 10.7GB Linux filesystem swap 4 75.2GB 1000GB 925GB Linux filesystem raid
Create RAID 1
# mdadm --examine /dev/sda2 /dev/sda2: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : fe810c00:7f2f7925:faeaef92:d18128b5 Name : ubuntu-server:0 Creation Time : Thu Jan 13 00:09:33 2022 Raid Level : raid1 Raid Devices : 2 Avail Dev Size : 125761536 (59.97 GiB 64.39 GB) Array Size : 62880768 (59.97 GiB 64.39 GB) Data Offset : 67584 sectors Super Offset : 8 sectors Unused Space : before=67432 sectors, after=0 sectors State : clean Device UUID : 1deddf30:0d781840:e6ee3fdc:021fc5c9 # mdadm --create /dev/md1 --level=mirror --raid-devices=2 /dev/sda4 /dev/sdb4 mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 Continue creating array? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md1 started. # cat /proc/mdstat Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md1 : active raid1 sdb4[1] sda4[0] 903228096 blocks super 1.2 [2/2] [UU] [>....................] resync = 0.2% (2007296/903228096) finish=74.8min speed=200729K/sec bitmap: 7/7 pages [28KB], 65536KB chunk md0 : active raid1 sdb1[1] sda2[0] 62880768 blocks super 1.2 [2/2] [UU] unused devices: <none> #
# watch mdadm --detail /dev/md1 Every 2.0s: mdadm --detail /dev/md1 /dev/md1: Version : 1.2 Creation Time : Thu Jan 13 10:59:46 2022 Raid Level : raid1 Array Size : 903228096 (861.39 GiB 924.91 GB) Used Dev Size : 903228096 (861.39 GiB 924.91 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Thu Jan 13 11:59:57 2022 State : clean, resyncing Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Consistency Policy : bitmap Resync Status : 39% complete Name : vm1:1 (local to host vm1) UUID : 5c82e79f:7afd7a4a:37f01db3:1c245334 Events : 731 Number Major Minor RaidDevice State 0 8 4 0 active sync /dev/sda4 1 8 20 1 active sync /dev/sdb4