Rebuild new disk array

Discussion in 'ISPConfig 3 Priority Support' started by MaxT, Nov 3, 2019.

Tags:
  1. MaxT

    MaxT Member HowtoForge Supporter

    Hi,
    maybe this question can be easy to answer, although I don't have too much experience with replacing array disks.

    The provider replaced one failed disk (of two disk in array). Now the server boots and works only with the second disk. However, the array was not rebuilt after boot as I expected.

    I have read quite tutorials but I'm not sure what to do.
    I'm not sure if I should put attention to the warning on GPT because some relevance in the operation to mirror the disk.

    The new disk is /sda, and the working disk is /sdb :

    Code:
    # lsblk
    
    NAME    MAJ:MIN RM    SIZE RO TYPE  MOUNTPOINT
    sda       8:0    0    1.8T  0 disk
    sdb       8:16   0    1.8T  0 disk
    +-sdb1    8:17   0 1004.5K  0 part
    +-sdb2    8:18   0    255M  0 part
    ¦ +-md2   9:2    0    255M  0 raid1 /boot
    +-sdb3    8:19   0   97.7G  0 part
    ¦ +-md3   9:3    0   97.7G  0 raid1 /
    +-sdb4    8:20   0    1.7T  0 part
    ¦ +-md4   9:4    0    1.7T  0 raid1 /home
    +-sdb5    8:21   0    511M  0 part  [SWAP]
    loop0     7:0    0     10M  0 loop
    
    Code:
    # cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
    md2 : active raid1 sdb2[1]
          261056 blocks [2/1] [_U]
      
    md3 : active raid1 sdb3[1]
          102398912 blocks [2/1] [_U]
      
    md4 : active raid1 sdb4[1]
          1850323904 blocks [2/1] [_U]
          bitmap: 14/14 pages [56KB], 65536KB chunk
    
    unused devices: <none>
    
    Code:
    # fdisk -l
    
    Disk /dev/loop0: 10 MB, 10485760 bytes
    255 heads, 63 sectors/track, 1 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    
    Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1      243202  1953514583+  ee  GPT
    Partition 1 does not start on physical sector boundary.
    
    Disk /dev/md4: 1894.7 GB, 1894731677696 bytes
    2 heads, 4 sectors/track, 462580976 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/md3: 104.9 GB, 104856485888 bytes
    2 heads, 4 sectors/track, 25599728 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/md2: 267 MB, 267321344 bytes
    2 heads, 4 sectors/track, 65264 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    


    After reading some tutorials, I think in this procedure:

    copy the boot sector:
    Code:
    # sfdisk -d /dev/sdb | sfdisk /dev/sda
    
    reassign:
    Code:
    # mdadm /dev/md2 -a /dev/sda2
    # mdadm /dev/md3 -a /dev/sda3
    # mdadm /dev/md4 -a /dev/sda4
    

    make the device map
    Code:
    # grub-mkdevicemap -n
    
    and then wait the resync process
    Code:
    # watch cat /proc/mdstat
    
    and that's all.

    Do you think it will work without error or there is something I miss?

    This is a server in production and without possibility of previous backup. I'm afraid if my sequence can cause a boot failure or even damage the disk. I cannot try or do tests.

    I would be really grateful for any thought.
     
  2. MaxT

    MaxT Member HowtoForge Supporter

    nobody can help?. I know this is no directly related with ISPC although later I plain to install on that
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

  4. MaxT

    MaxT Member HowtoForge Supporter

    thanks till.
    although my doubt was specially with the warning
    "WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted."

    I'm not sure if I should ignore it or not

    thx anyway :)
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    My guide uses sgdisk and not fdisk as sgdisk can deal with GPT tables.
     
  6. MaxT

    MaxT Member HowtoForge Supporter

    oh, good:) Then i will try it

    thx!
     

Share This Page