On 18/11/2020 16.52, Stakanov wrote:
Situation: I have a 2 GB disc mounted as /var/lib/libvirt/images. I have images of installation on it. In order to have higher redundancy in case of HDD failure (had one recently on root but on root there is not so much "unique"). So I took a second one, same size to set up a RAID1
Normally you would need three discs (set up the raid and then transfer from a backup. However I did this one in the past with success (only I forgot how and the opensuse 15.2 killed all my maildata so I cannot find it in the archives (BTW opensuse archives seem to be down too).
So I want to create a RAID called md/1 and use it as RAID setting it up with one "missing". dev/sdd is the one with the data. /dev/sdf is the virgin new.
I began with: dd if=/dev/sdd of=/dev/sdf count=1 fdisk /dev/sdf Command (m for help): t Partition number (1-3): 1 Hex code (type L to list codes): fd Changed system type of partition 1 to fd (Linux raid autodetect)
I'm a bit lost here. /dev/sdd holds the current store in a "normal" disk, non raid, right? What are you doing with that 'dd', cloning the MBR to sdf? I hope the disk is type MBR, not GPT. If it is GPT it will not work. Then you are also cloning the disk identifier, you get two disks with the same ID. I think it would be better not to do the cloning and create the partition from scratch on the second disk. And I typically use YaST for this operation.
so far so good. And it works up to here. And I initialize the RAID:
mdadm -C /dev/md/1 -l 1 -n 2 missing /dev/sdf1
And so far so good, all is smooth.
Now I wish to give it a file system (in my case ext4) and there...the trouble begin. I do not remember obviously how to do this right. I tried: mkfs.ext4 /dev/md/1
Which he does but complains: mke2fs 1.45.6 (20-Mar-2020) /dev/md/1 alignment is offset by 3584 bytes.
This may be an effect of cloning the MBR to a disk with different sector size. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)