2

I have inherited a system (Fedora 26) with the following setup: software RAID 1 (md127) between two disks (sda2 and sdb4 for lvm holding fedora-root and fedora-home). Additionally there's a RAID 0 (md126) between the same two disks (sda1,sdb3) as SWAP. Now the disk sdb is starting to show errors and md127 is in 'degraded' state (showing one device as 'removed').

I would like to replace the faulty hard drive and have the following questions:

  1. What do I do with the RAID 0 swap partition? (How can I get rid of it without causing trouble?)
  2. The /boot (/dev/sdb2) and /boot/efi (/dev/sdb1) partitions are also on the failing hard drive. As far as I understand /boot/efi cannot be in RAID, and has to always be duplicated manually. How do I make a bootable copy?

Downtime is not a problem. Thanks in advance!

Here's what I did so far:

  • backed up the partition table from sdb with:

    sgdisk --backup=sdb.partition.table.machine_i.08032018.sgdisk  /dev/sdb
    
  • and restored it on an empty drive with the same capacity with:

    sgdisk --load-backup=sdb.partition.table.machine_i.08032018.sgdisk /dev/sdc
    
  • I also randomized the GUID (not sure that was necessary as I'm going to replace the whole drive):

    sgdisk -G /dev/sdc
    

What I would like to do/achieve:

  • get rid of /dev/md126 somehow

  • add the sdc4 partition to the RAID 1 and let it rebuild:

    mdadm --manage /dev/md127 -a /dev/sdc4
    mdadm --manage --set-faulty /dev/md127 /dev/sdc4
    
  • copy /boot/efi:

    dd if=/dev/sdb1 of=boot_efi_backup
    dd if=boot_efi_backup of=dev/sdc1
    
  • make it bootable from the new drive... I'm not sure about what do with the /boot partition... Also dd it?

  • boot from new drive
  • remove old drive

Maybe that helps explaining:

$ lsblk 
NAME                   MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda                      8:0    0  1.8T  0 disk  
├─sda1                   8:1    0 32.1G  0 part  
│ └─md126                9:126  0 64.1G  0 raid0 
│   └─fedoraswap0-swap 253:0    0   64G  0 lvm   [SWAP]
└─sda2                   8:2    0  1.8T  0 part  
  └─md127                9:127  0  1.8T  0 raid1 
    ├─fedora-root      253:1    0   50G  0 lvm   /
    └─fedora-home      253:2    0  1.8T  0 lvm   /home
sdb                      8:16   0  1.8T  0 disk  
├─sdb1                   8:17   0 1000M  0 part  /boot/efi
├─sdb2                   8:18   0  500M  0 part  /boot
├─sdb3                   8:19   0 32.1G  0 part  
│ └─md126                9:126  0 64.1G  0 raid0 
│   └─fedoraswap0-swap 253:0    0   64G  0 lvm   [SWAP]
└─sdb4                   8:20   0  1.8T  0 part  
sr0                     11:0    1 1024M  0 rom     

This is what my boot entries look like at the moment:

$ efibootmgr -v
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0005,0001,0000,0002
Boot0000  CD/DVD Drive  BBS(CDROM,,0x0)..GO..NO........o.T.S.S.T.c.o.r.p. .C.D.D.V.D.W. .S.H.-.2.2.4.D.B....................A...........................>..Gd-.;.A..MQ..L.9.R.E.3.Y.6.D.A.0.9.6.1.W.6. . . . . . ........BO
Boot0001* UEFI: Built-in EFI Shell  VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot0002  Hard Drive    BBS(HD,,0x0)..GO..NO........o.S.T.2.0.0.0.N.M.0.0.3.3.-.9.Z.M.1.7.5....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .1.Z.3.X.P.6.5.D........BO..NO........o.W.D.C. .W.D.2.0.0.0.F.Y.Y.Z.-.0.1.U.L.1.B.1....................A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.M.W.1.C.0.P.6.2.2.3.4.1........BO
Boot0005* Fedora    HD(1,GPT,d3f62cf5-d95c-45f2-b239-ce5c67b405eb,0x800,0x1f4000)/File(\EFI\fedora\shim.efi)

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.