0

I initially installed Ubuntu Studio 20.04 onto a 120GB SSD. I'm wondering if it is possible to migrate this to RAID1 (software) with (2) 1TB SSD drives.

What's confusing me is how Ubuntu Studio 20.04 installed:

sdc         8:32   0 111.8G  0 disk  
├─sdc1      8:33   0   512M  0 part  /boot/efi
└─sdc2      8:34   0 111.3G  0 part  /

I didn't specifically designate a /boot/efi partition during the installation sequence.

I created (2) RAIDs:

- 2GB fat32
- 929GB ext4

I wanted to make the fat32 partition larger than it would ever require to avoid re-partitioning the drive in the future.

To copy the files onto the RAID partitions I used:

rsync -avP --numeric-ids --delete-during {120GB partition} {equivalent RAID1 partition}

Additionally I edited /etc/fstab

# / was on /dev/sda2 during installation
UUID=a461ff1b-8d74-4e24-84e7-fe17e2097f23 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=06A9-23FB  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

However this won't boot. I am not sure if it can be salvaged. Was there a different way I was suppose to copy the boot partition?

This is the results of lsblk

NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda         8:0    0 931.5G  0 disk  
├─sda1      8:1    0     2G  0 part  
│ └─md127   9:127  0     2G  0 raid1 
└─sda2      8:2    0 929.5G  0 part  
  └─md126   9:126  0 929.4G  0 raid1 
sdb         8:16   0 931.5G  0 disk  
├─sdb1      8:17   0     2G  0 part  
│ └─md127   9:127  0     2G  0 raid1 
└─sdb2      8:18   0 929.5G  0 part  
  └─md126   9:126  0 929.4G  0 raid1 
sdc         8:32   0 111.8G  0 disk  
├─sdc1      8:33   0   512M  0 part  /boot/efi
└─sdc2      8:34   0 111.3G  0 part  /

I want to set this up so Ubuntu Studio 20.04 will boot from both partitions --- so if 1 SSD dies I can still boot the computer and then replace the SSD.

0

After much research and help from the folks on the Freenode #Ubuntu IRC channel I have an answer. I ended up re-installing due to all the research and failed attempts. I've shared my process below. For those who will use this to migrate to RAID use rsync -avP --numeric-ids --delete-during /path/from/ /path/to/ for cloning your installed operating system and data (documents, videos, photos, etc.)

I've treated this as many single board computers requiring a microsd card to boot. I setup the /boot/efi partition on a mSATA with a USB adapter I'll Velcro to my computer case.

To make this work I booted the live media and accessed terminal ( CTRL ALT T ) used cfdisk to create the Linux RAID partitions on each SSD drives for the RAID

sudo cfdisk /dev/sdLETTER

"Select Tabel Type": gpt

[New]

Partition size: ###G

[Type] Find Linux RAID

[Write] "Are you sure you want to write the partition table to disk?" yes

[Quit]

Then eject, unmount or otherwise power off each SSD and reconnect them. Note what /dev/sdLETTER were assigned using lsblk

Next sudo apt install mdadm and create the RAID1

mdadm --create /dev/md/rootfs /dev/sdLETTER1 /dev/sdLETTER1 --level=1 --raid-devices=2

To monitor the creation of the RAID use: cat /proc/mdstat

When complete format the RAID using mkfs.ext4 -m0 /dev/md/rootfs

While the RAID is being created create create the /boot/efi partition:

Mount the device you will use the /boot/efi partition. I used a mSATA with USB adapter.

Use lsblk to identify the assigned /dev/sdLETTER.

Create the partition using cfdisk steps above.

As the live media for installing Ubuntu 20.04 don't allow formatting using terminal do so with mkfs.vfat

Once the RAID has been created use the Ubuntu 20.04 live media installation command to install selecting /dev/md127 (or the equivalent /dev/ mount assigned). Select the /boot/efi partition. Proceed with the installation.

The final step of the installation where grub boot is created will fail. I created this manually using:

sudo mount /dev/md127 /mnt
for i in /dev /proc /sys /run; do sudo mount -R $i /mnt$i; done
sudo chroot /mnt
mdadm --examine /dev/sda1
grub-install
update-grub

My grub-install syntax was more complex:

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi && sudo update-grub
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.