How to use existing meta-disk in 18.04 desktop install

Asked by Wesley Michael

I am currently running 18.04 desktop on my computer. My /home directory is on a meta-disk that I've set up as a mirrored drive.

I am going to have to replace my boot drive since it is failing. I wanted to find out if there was any way I could perform the installation on 18.04 (using the new boot drive) and set up /home with the existing /dev/md0 setup? Or, if it isn't possible to set it up during the installation, how could I set up /dev/md0 after the installation is complete, without loosing anything that is currently on the drive?

The boot drive is another disk, and is not part of any raid device. I mount /home separately, and /home is the only raid device on the system.

My /home partition is about 590 Gb and while I can back it up to an external drive and restore, I would really rather not spend all that time if I can avoid it.

The md0 device (/home) is set up as a mirrored device (raid 1). When I used to work with these on Solaris I could set up the meta-device with one side of the mirror without modifying anything and then attach the second half and let it sync. Didn't know if that was still possible or not.

This is the configuration of my md0 device:

/dev/md0:
        Version : 1.2
  Creation Time : Sat May 19 11:45:53 2018
     Raid Level : raid1
     Array Size : 976629760 (931.39 GiB 1000.07 GB)
  Used Dev Size : 976629760 (931.39 GiB 1000.07 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Jun 7 15:18:45 2018
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : matrix:0 (local to host matrix)
           UUID : ecc00570:0e24a011:f368b4db:c3a15375
         Events : 1732

    Number Major Minor RaidDevice State
       0 8 1 0 active sync /dev/sda1
       1 8 49 1 active sync /dev/sdd1

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu mdadm Edit question
Assignee:
No assignee Edit question
Solved by:
Wesley Michael
Solved:
Last query:
Last reply:
Revision history for this message
Wesley Michael (wam-zoominternet) said :
#1

I did some more digging around and found that I could install the mdadm package when I was running of the CDROM.

I booted the machine to with the new boot drive installed using the installation DVD. Then I opened a terminal and ran these commands:

sudo apt-get install mdadm
sudo mdadm --assemble --scan

This created the /dev/md0 drive and I was ale to perform the install, specifying that drive as /home.

After the install was complete, I rebooted, but since the mdadm package was not installed as part of 18.04, it dropped into single-user, emergency mode.

I ran the "apt-get install mdadm" command it the system automatically mounted /dev/md0 as /home.

To be safe, I ran "update-initramfs -u" and then rebooted. System came up with /home mounted from /dev/md0.