1

I have a (remote) Ubuntu 14.04 (XFCE desktop) system which is configured with RAID1 (2 identical disks):

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid1] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sda1[0] sdb1[1]
      1953382208 blocks super 1.2 [2/2] [UU]

Inside /dev/md0 is a boot partition (partition 0: 244M), and an LVM VG/PV (partition 5) which contains two volumes: the root system (1.8T) and a swap (12G).

I want to mess with the system (upgrade to 16.04 and then make other changes) and I would prefer to keep the 2nd disk of the raid configuration as a backup so if all goes pear-shaped I can go back to that and recover the original configuration and data.

I read that I can remove the existing RAID configuration with:

mdadm /dev/md1 --fail /dev/sdb1 --remove /dev/sdb1

I'm not sure if I have to do anything to else to stop sdb1 being re-added to the array when the system reboots? For instance

wipefs -a /dev/sdb1
mdadm --grow /dev/md0 --raid-devices=1

I need to be sure that after my work is complete I can either add back /dev/sdb1 to the raid array so that it can be conformed to the (now updated) data in /dev/sda1 or, alternatively, that I can boot from /dev/sdb as the 'old' system and use it to rebuild /dev/sda (if it is in a bad state after a botched upgrade). I realise that booting from /dev/sdb may require local access, but will it be bootable at all when it used to be part of a raid1 device?

Any guidance gratefully received.

  • Do not have the expertise to give an exact answer but here is a scenario you could do: fail and remove /dev/sdb1 as you mention, this is your backup drive. Update your Ubuntu on /dev/sda. If something goes wrong, abandon your raid array entirely and use instructions like these to build a brand new raid config using your /dev/sdb1 – alisianoi Apr 9 '17 at 18:49
  • The idea here is that you are not "trying to tell your old RAID that it should use the /dev/sdb to rebuild" but rather "forget the old RAID and use /dev/sdb from that old RAID to build a new RAID without needing a third disk" – alisianoi Apr 9 '17 at 18:51
  • in the end I managed to upgrade to Ubuntu 16.04 without altering RAID. But I have been testing (in a similar test environment, but now with Ubuntu 16.04): I can fail and remove /dev/sdb1 but if I bring it back as a new single-drive raid device (while system is running from the old now-single-drive RAID device on /dev/sda1) a disaster unfolds because LVM automatically and (it seems) inescapably recognises the PV on /dev/sdb1 as being the same as the one on /dev/sda1 (although they are now in different RAID arrays) and locks down any attempt to work with it independently. – scoobydoo Apr 10 '17 at 20:48

Your Answer

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

Browse other questions tagged or ask your own question.