Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  -1] [ 0]  / answers: 1 / hits: 13879  / 1 Year ago, thu, december 22, 2022, 3:21:01

I have a 320GB hard drive with an LVM2 volume group that was created as part of the default installation. If I put a second 320GB hard drive into the computer, can I make the second drive mirror the first using Linux software RAID1 or something similar? I tried adding a new RAID array in the Gnome Disk Utility, but it only gave me the option of creating an array with two empty partitions.


More From » 11.04

 Answers
4

I achieved this by backing up all of my data onto an external drive, reinstalling Ubuntu onto a raid array, and then restoring my backup in the new file system. In particular, I followed these steps:




  1. Backup data using instructions at this forum thread using command



    sudo tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=backup.tgz --exclude=/mnt --exclude=/sys --exclude=/dev --exclude=/etc/fstab --exclude=/etc/mtab --exclude=/boot --exclude=/media /


    replacing backup.tgz in both cases with the location of the backup


  2. Turn computer off and install two hard drives with the smaller one being at least the size of the raid array (possibly including the original hard drive)


  3. Boot into install disk and run the installer.


  4. Using manual partitioning, make a partition in each hard drive for each partition in the final file system. For example, if you want your /home partition to be 100 GB, make a 100GB partition in each hard drive. Set all partitions that will be part of a RAID array to RAID autodetect (0xfd).


  5. Choose to make raid arrays, and put each partition into a raid array with the corresponding partition on the other disk.


  6. Finish the installation as normal and reboot into the fresh Ubuntu installation.


  7. Mount the external drive if it is not already mounted and restore the backup as described in the forum thread above using the command



    sudo tar xvpfz backup.tgz -C /

  8. Run sudo update-grub and then reboot. The new operating system should now be exactly like the original.




I prefer this method for a few reasons:




  • Making file system level copies instead of disk level copies seems preferable in general


  • It does not depend on keeping the partition structure the same


  • Once I figured out how to do it, the entire process took less time than the disk level copy took


  • It allows the installer to create the correct entries for boot devices and mounted devices, which need to change because raid partitions are referred to differently than regular partitions are.



[#43970] Friday, December 23, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tocklftime

Total Points: 110
Total Questions: 109
Total Answers: 100

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
;