Migrating from Linux Mint 17.2 mdadm RAID array to a new one (because I upgraded to larger drives).

1.) Replicate the number of partitions in your new drives.
gdisk /dev/sda
gdisk /dev/sdb

I created 3 partitions of the same same size.
partition #1: +1G (/boot)
partition #2: +60G (swap)
partition #3: rest of it (/)

#note if you are using GPT/gdisk you need to create separate a partition at least 1MB in size (in my case I would a 4th partition and mark it type ef02).

Note again do not make my mistake.  You cannot just mark your grub /boot partition as ef02, it will not boot (despite grub2 not complaining during install).

gdisk /dev/sdc
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): t
Partition number (1-3): 1
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): ef02
Changed type of partition to 'BIOS boot partition'

Command (? for help): wq

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

2.) Create 3 new mdadm arrays that are suitable:

Note the first mdadm array is my boot so I use RAID 1 and metadata=0.90 (or it will not be able to read/boot)

mdadm --create /dev/md51 --metadata=0.90 --level 1 --raid-devices 2 /dev/sdb1 /dev/sdc1
mdadm --create /dev/md52 --level 10 --layout f2 --raid-devices 2 /dev/sdb2 /dev/sdc2
mdadm --create /dev/md53 --level 10 --layout f2 --raid-devices 2 /dev/sdb3 /dev/sdc3

Note md51=/boot
3.) Create appropraite filesystems:

mkfs.ext4 /dev/md51
mkswap /dev/md52
mkfs.ext4 /dev/md53

Note md51=/boot

4.) Mount them and prepare to migrate

I am going to use /mnt/newinstall as the staging ground.

#make staging dir
mkdir -p /mnt/newinstall
#make boot and / inside stage:

#mount them
mount /dev/md53 /mnt/newinstall/
mkdir -p /mnt/newinstall/boot
mount /dev/md51 /mnt/newinstall/boot

5.) Migrate with rsync

I am going to omit /media/* and /mnt/* to avoid copying other mounted devices

*If you have ecryptfs you will want to exclude /home/user if mounted so you don't copy both encrypted and decrypted files (doubling your storage usage and also exposing an unencrypted copy of your data).

rsync -Pha --exclude=/proc/* --exclude=/sys/* --exclude=/home/user/* --exclude=/media/* --exclude=/mnt/* / /mnt/newinstall/
#rsync the .ecryptfs info to your user or you will lose access be unable to auto-mount it

rsync -Phaz /home/user/.ecryptfs /mnt/newinstall/home/user

rsync -Phaz /home/user/.Private /mnt/newinstall/home/user

6.) chroot and prepare environment.
for bind in dev sys proc; do
mount -o bind /$bind /$mount/$bind

chroot /mnt/newinstall
grub-install /dev/sda
grub-install /dev/sdb

#update mdadm
cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf-`date +%Y-%m-%d-%s`
mdadm --detail --brief --scan > /etc/mdadm/mdadm.conf

#update /etc/fstab /boot, /, and swap, with the right blkid
vi /etc/fstab

UUID=1119d26-da8e-4317-a5cb-834402b90501 /               ext4    errors=remount-ro 0       1
UUID=22296bff-79c5-4d19-b343-e21d10c5fe9b TYPE=ext4 /boot           ext4    defaults        0       2
UUID=44423ded-5e6b-4f16-9ca9-b8ef69ce00ed none            swap    sw              0       0

blkid /dev/md51
blkid /dev/md52
blkid /dev/md53

Note md51=/boot

#update initramfs

update-initramfs -u


migrating, linux, mint, mdadm, raid, array, upgraded, larger, replicate, partitions, gdisk, dev, sda, sdb, partition, swap, gpt, mb, ef, grub, install, sdc, fdisk, scan, mbr, bsd, apm, valid, filesystem, hex, guid, codes, bios, wq, overwrite, existing, arrays, suitable, metadata, md, devices, layout, appropraite, filesystems, mkfs, ext, mkswap, mount, migrate, mnt, newinstall, staging, dir, mkdir, rsync, omit, copying, mounted, ecryptfs, exclude, user, encrypted, decrypted, doubling, usage, exposing, unencrypted, pha, proc, sys, info, unable, auto, phaz, chroot, bind, update, cp, etc, conf, fstab, blkid, vi, uuid, cb, errors, remount, ro, bff, fe, defaults, ded, ca, ce, sw, initramfs,

Latest Articles

  • ssh Too many authentication failures not prompting for password
  • LightDM Mint Ubuntu Debian won't start errors Nvidia Graphics
  • WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files. Check that you have pkg-config and the libglvnd development libraries installed, or specify a path with --glvnd-egl-config-path. Linux Ubuntu Mint Debian E
  • How To Upgrade Linux Mint 18.2 to 18.3 to 19.x and 20.x
  • MP3s Won't Play / ID3 Version 2.4 Issues in Cars and Other MP3 Players/CDs/DVDs Solution
  • LXC Containers LXD How to Install and Configure Tutorial Ubuntu Debian Mint
  • GlusterFS HowTo Tutorial For Distributed Storage in Docker, Kubernetes, LXC, KVM, Proxmox
  • Ubuntu Mint audio output not working pulseaudio "pulseaudio[13710]: [pulseaudio] sink-input.c: Failed to create sink input: too many inputs per sink."
  • How To Shrink Dynamically Allocated VM QEMU KVM VMware Disk Image File
  • How To Enable Linux Swapfile Instead of Partition Ubuntu Mint Debian Centos
  • 404 Not Found [IP: 80] apt update Debian 11 Bullseye Solution The repository 'http://security.debian.org bullseye/updates Release' does not have a Release file.
  • WARNING: Can't download daily.cvd from db.local.clamav.net freshclam clamav error solution
  • (firefox:9562): LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory) Solution
  • Debian Mint Ubuntu Which Package Provides missing top, ps and w Solution
  • Vbox Virtualbox DNS NAT Network Mode NOT working
  • Docker Tutorial HowTo Install Docker, Use and Create Docker Container Images Clustering Swarm Mode Monitoring Service Hosting Provider
  • Zoom Password Error 'That passcode was incorrect' - Solution Wrong Passcode Wrong Meeting Name
  • How To Startup and Open Remote/Local Folder/Directory in Ubuntu Linux Mint automatically upon login
  • How To Reset Windows Server Password 2019, 2022, 7, 8, 10, 11 Recovery and Removal Guide Using Linux Ubuntu Mint Debian
  • How To Create OpenVPN Server for Secure Remote Corporate Access in Linux Debian/Mint/Ubuntu with client public key authentication