16. Install GRUB on both new drives, update grub configuration and update initramfs
Code
root@omv:/# grub-install --recheck /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.
root@omv:/#
root@omv:/# grub-install --recheck /dev/sdc
Installing for i386-pc platform.
Installation finished. No error reported.
root@omv:/#
root@omv:/# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.0.0-0.deb11.6-amd64
Found initrd image: /boot/initrd.img-6.0.0-0.deb11.6-amd64
Found linux image: /boot/vmlinuz-5.16.0-0.bpo.4-amd64
Found initrd image: /boot/initrd.img-5.16.0-0.bpo.4-amd64
done
root@omv:/#
root@omv:/# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.0.0-0.deb11.6-amd64
Alles anzeigen
17. Exit `chroot` and shutdown the system. Remove the original disk and boot on new OMV on RAID !!
18. Create filesystem on `/dev/md2` (data)
Code
root@omv:~# mkfs.ext4 -m 1 -L DATA /dev/md2
mke2fs 1.46.6 (1-Feb-2023)
/dev/md2 contains a ext4 file system
created on Fri Mar 24 14:54:41 2023
Proceed anyway? (y,N) y
Creating filesystem with 24424176 4k blocks and 6111232 inodes
Filesystem UUID: 8d38aa5e-04ca-44ad-928f-8d76c1eb2dbb
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks):
done
Writing superblocks and filesystem accounting information: done
Alles anzeigen
** At the end of this installation and setup procedure it should be like this :
Code
root@omv:~# parted /dev/sda u s p
Model: ATA ST3160813AS (scsi)
Disk /dev/sda: 312581808s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 22527s 20480s grub bios_grub
2 22528s 62500863s 62478336s linux-swap(v1) swap swap
3 62500864s 117186559s 54685696s ext4 root boot, esp
4 117186560s 312580095s 195393536s ext4 data
root@omv:~# parted /dev/sdb u s p
Model: ATA ST3160815AS (scsi)
Disk /dev/sdb: 312581808s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 22527s 20480s grub bios_grub
2 22528s 62500863s 62478336s linux-swap(v1) swap swap
3 62500864s 117186559s 54685696s ext4 root boot, esp
4 117186560s 312580095s 195393536s ext4 data
root@omv:~# lsblk --fs
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1
├─sda2 linux_raid_member 0.90.0 d535f129-b1cb-7949-3da0-12a4b1a46ad8
│ └─md0 swap 1 d2691e45-c941-4c2a-b0fe-c5de59128ed6 [SWAP]
├─sda3 linux_raid_member 0.90.0 1f6178a1-153d-ba8d-3da0-12a4b1a46ad8
│ └─md1 ext4 1.0 dc51ecf5-9a91-476c-8202-7b322e115a4a 21.3G 11% /
└─sda4 linux_raid_member 0.90.0 f8f938b3-bf39-a006-3da0-12a4b1a46ad8
└─md2 ext4 1.0 DATA 8d38aa5e-04ca-44ad-928f-8d76c1eb2dbb
sdb
├─sdb1
├─sdb2 linux_raid_member 0.90.0 d535f129-b1cb-7949-3da0-12a4b1a46ad8
│ └─md0 swap 1 d2691e45-c941-4c2a-b0fe-c5de59128ed6 [SWAP]
├─sdb3 linux_raid_member 0.90.0 1f6178a1-153d-ba8d-3da0-12a4b1a46ad8
│ └─md1 ext4 1.0 dc51ecf5-9a91-476c-8202-7b322e115a4a 21.3G 11% /
└─sdb4 linux_raid_member 0.90.0 f8f938b3-bf39-a006-3da0-12a4b1a46ad8
└─md2 ext4 1.0 DATA 8d38aa5e-04ca-44ad-928f-8d76c1eb2dbb
root@omv:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
#UUID=8685026f-f521-43e1-abfd-94a643a3b7c8 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
#UUID=246ea99a-552f-431e-9c96-5459e88a6bdf none swap sw 0 0
# / is on /dev/md1 after RAID creation
UUID=dc51ecf5-9a91-476c-8202-7b322e115a4a / ext4 errors=remount-ro 0 1
# swap is on /dev/md0 after RAID creation
UUID=d2691e45-c941-4c2a-b0fe-c5de59128ed6 none swap sw 0 0
root@omv:~# cat /etc/mdadm/mdadm.conf
ARRAY /dev/md0 metadata=0.90 UUID=d535f129:b1cb7949:3da012a4:b1a46ad8
ARRAY /dev/md1 metadata=0.90 UUID=1f6178a1:153dba8d:3da012a4:b1a46ad8
ARRAY /dev/md2 metadata=0.90 UUID=f8f938b3:bf39a006:3da012a4:b1a46ad8
root@omv:~# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sdb4[1] sda4[0]
97696704 blocks [2/2] [UU]
md0 : active (auto-read-only) raid1 sdb2[1] sda2[0]
31239104 blocks [2/2] [UU]
md1 : active raid1 sdb3[1] sda3[0]
27342784 blocks [2/2] [UU]
unused devices: <none>
Alles anzeigen
And finally the system is ready !