Я изначально установил Ubuntu Studio 20.04
на твердотельный накопитель емкостью 120 ГБ. Мне интересно, можно ли перенести это на RAID1 (программное обеспечение) с (2) жесткими дисками емкостью 1 ТБ.
Меня смущает то, как Ubuntu Studio 20.04
установлено:
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 /
Я не сделал специально определите раздел / boot / efi
во время последовательности установки.
Я создал (2) RAID:
- 2GB fat32
- 929GB ext4
Я хотел сделать раздел fat32 больше, чем когда-либо, чтобы избежать повторного разбиения диск в будущем.
Чтобы скопировать файлы на разделы RAID, которые я использовал:
rsync -avP --numeric-ids --delete-during {120GB partition} {equivalent RAID1 partition}
Дополнительно я отредактировал / 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
Однако это не загрузится. Я не уверен, что это можно спасти. Был ли другой способ, которым я должен был скопировать загрузочный раздел?
Это результаты 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 /
Я хочу настроить это так, чтобы Ubuntu Studio 20.04 загружался с обоих разделов - так что, если 1 SSD умрет, я все еще может загрузить компьютер и затем заменить SSD.
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