Query Answered in great details:-
Install Ubuntu Server
.Partition disks
step, select Manual
.Configure the Logical Volume Manager
. Delete logical volume
until all volumes have been deleted.Delete volume group
until all volume groups have been deleted.Configure software RAID
. Delete MD device
until all MD devices have been deleted.Delete the partition
.EFI System Partition
.Physical Volume for RAID
.Configure software RAID
.Create MD device
, type RAID1
, 2 active disks, 0 spare disks, and select the /dev/sda2
and /dev/sdb2
devices.Configure the Logical Volume Manager
.vg
on the /dev/md0
device.swap
at 16Groot
at 35Gtmp
at 10Gvar
at 5Ghome
at 200Gswap
partition, select Use as: swap
.Use as: ext4
with the proper mount points (/
, /tmp
, /var
, /home
, respectively).Finish partitioning and write changes to disk
.If you are re-installing on a drive that earlier had a RAID
configuration, the RAID creation step above might fail and you never get
an md
device. In that case, you may have to create a Ubuntu Live USB stick, boot into that, run gparted
to clear all your partition tables, before you re-start this HOWTO.
/dev/sda1
. mount | grep bootThe EFI bootloaded should have been installed on /dev/sda1
. As that partition is not mirrored via the RAID system, we need to clone it.
sudo dd if=/dev/sda1 of=/dev/sdb1
This step may not be necessary, since if either drive dies, the system should boot from the (identical) EFI partitions. However, it seems prudent to ensure that we can boot from either disk.
efibootmgr -v
and notice the file name for the ubuntu
boot entry. On my install it was \EFI\ubuntu\shimx64.efi
.sudo efibootmgr -c -d /dev/sdb -p 1 -L "ubuntu2" -l \EFI\ubuntu\shimx64.efi
. Depending on your shell, you might have to escape the backslashes.efibootmgr -v
that you have the same file name for the ubuntu
and ubuntu2
boot items and that they are the first two in the boot order.If you want to try to physically remove or disable any drive to test
your installation, you must first wait until the RAID synchronization
has finished! Monitor the progress with cat /proc/mdstat
However, you may perform step 8 below while waiting.
If one drive fails (after the synchronization is complete), the system will still boot. However, the boot sequence will spend a lot of time looking for btrfs file systems. To remove that unnecessary wait, run
sudo apt-get purge btrfs-progs
This should remove btrfs-progs
, btrfs-tools
and ubuntu-server
. The last package is just a meta package, so if no more packages are listed for removal, you should be ok.
Run sudo apt install ubuntu-desktop
to install the
desktop version. After that, the synchronization is probably done and
your system is configured and should survive a disk failure!
When the package grub-efi-amd64
is updated, the files on the EFI partition (mounted at /boot/efi
)
may change. In that case, the update must be cloned manually to the
mirror partition. Luckily, you should get a warning from the update
manager that grub-efi-amd64
is about to be updated, so you don’t have to check after every update.
If you haven’t rebooted after the update, use
mount | grep boot
to find out what EFI partition is mounted. That partition, typically /dev/sdb1
, should be used as the clone source.
Create mount points and mount both partitions:
sudo mkdir /tmp/sda1 /tmp/sdb1
sudo mount /dev/sda1 /tmp/sda1
sudo mount /dev/sdb1 /tmp/sdb1
Find timestamp of newest file in each tree
sudo find /tmp/sda1 -type f -printf '%T+ %p\n' | sort | tail -n 1 > /tmp/newest.sda1
sudo find /tmp/sdb1 -type f -printf '%T+ %p\n' | sort | tail -n 1 > /tmp/newest.sdb1
Compare timestamps
cat /tmp/newest.sd* | sort | tail -n 1 | perl -ne 'm,/tmp/(sd[ab]1)/, && print "/dev/$1 is newest.\n"'
Should print /dev/sdb1 is newest
(most likely) or /dev/sda1 is newest
. That partition should be used as the clone source.
Unmount the partitions before the cloning to avoid cache/partition inconsistency.
sudo umount /tmp/sda1 /tmp/sdb1
If /dev/sdb1
was the clone source:
sudo dd if=/dev/sdb1 of=/dev/sda1
If /dev/sda1
was the clone source:
sudo dd if=/dev/sda1 of=/dev/sdb1
Done!
/*_*\
Success rate upto 90% as per Niclas Börlin’s answer @askubuntu.
This is not an ad-vocation by any means for TP-link branding, however a real life…
First of all we need to hit the kernel version on any Android device. You…
Use resolvectl status instead. It's like something deprecates and suddenly things get broken! In systemd…
Geeky question: This is what people and friends have tried: rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john…
You might encounter this error which appears to be very common on Debian based Distro's…
PS: This article is for only Kali Linux users, that too having a Broadcom Wireless…