Ankündigung

Einklappen
Keine Ankündigung bisher.

Replace dead hard drive, now no raid, how to rebuild raid?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • IB-NAS4220-B Replace dead hard drive, now no raid, how to rebuild raid?

    I replaced a dead hard drive in my 4220 and now I get this when I
    fdisk -l
    Code:
     
    
    Disk /dev/hda: 200.0 GB, 200049647616 bytes
    255 heads, 63 sectors/track, 24321 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/hda1               1          13      104422   fd  Linux raid autodetect
    /dev/hda2              14       24289   194996970   fd  Linux raid autodetect
    /dev/hda3           24290       24321      257040   82  Linux swap
    
    
    Disk /dev/hdb: 200.0 GB, 200049647616 bytes
    255 heads, 63 sectors/track, 24321 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    
    Disk /dev/hdb doesn't contain a valid partition table
    So how to continue from here?
    I did try to use the web interface, but he only give me this option:
    Code:
    RAID system cannot be activated. If need to set up raid system, must remove system data on the hard disk.
    And I dont like this, I may lose all this way.

    I think I have to make a valid partition table, but how to do this right, and next how to rebuild the raid?

    Regards

  • #2
    Zitat von k2teknik Beitrag anzeigen
    I think I have to make a valid partition table, but how to do this right, and next how to rebuild the raid?
    Yes, and you need to setup the RAID

    I assume you have RAID1 ...

    The check this, please post the output from
    Code:
    cat /proc/mdstat

    And you *WIN* a price, some thank you ...

    *YOU* are the first one, who posts with CODE-tags in the first place.
    Other user only do copy&paste. Which is hard to read, if you lose the formatting.
    Some random kernel coder
    Lots of stuff attached to serial console

    Kommentar


    • #3
      Thanks for you reply.
      cat /proc/mdstat shows:
      Code:
      Personalities : [linear] [raid0] [raid1] [raid5] [multipath] [raid10]unused devices: <none>

      I did recreate some partition on the new disc like this:
      Code:
      > fdisk /dev/hdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
      Building a new DOS disklabel. Changes will remain in memory only,
      until you decide to write them. After that, of course, the previous
      content won't be recoverable.
      
      
      
      
      The number of cylinders for this disk is set to 24321.
      There is nothing wrong with that, but this is larger than 1024,
      and could in certain setups cause problems with:
      1) software that runs at boot time (e.g., old versions of LILO)
      2) booting and partitioning software from other OSs
         (e.g., DOS FDISK, OS/2 FDISK)
      Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
      
      
      Command (m for help): n
      Command action
         e   extended
         p   primary partition (1-4)
      p
      Partition number (1-4): 1
      First cylinder (1-24321, default 1):
      Using default value 1
      Last cylinder or +size or +sizeM or +sizeK (1-24321, default 24321): 13
      
      
      Command (m for help): n
      Command action
         e   extended
         p   primary partition (1-4)
      p
      Partition number (1-4): 2
      First cylinder (14-24321, default 14):
      Using default value 14
      Last cylinder or +size or +sizeM or +sizeK (14-24321, default 24321): 24289
      
      
      Command (m for help): n
      Command action
         e   extended
         p   primary partition (1-4)
      p
      Partition number (1-4): 3
      First cylinder (24290-24321, default 24290):
      Using default value 24290
      Last cylinder or +size or +sizeM or +sizeK (24290-24321, default 24321):
      Using default value 24321
      Then I change the partition types to match the other disc:
      Code:
      Command (m for help): t
      Partition number (1-4): 1
      Hex code (type L to list codes): fd
      Changed system type of partition 1 to fd (Linux raid autodetect)
      
      
      Command (m for help): t
      Partition number (1-4): 2
      Hex code (type L to list codes): fd
      Changed system type of partition 2 to fd (Linux raid autodetect)
      
      
      Command (m for help): t
      Partition number (1-4): 3
      Hex code (type L to list codes): 82
      Changed system type of partition 3 to 82 (Linux swap)
      
      
      Command (m for help): w
      The partition table has been altered!
      
      
      Calling ioctl() to re-read partition table.
      Syncing disks.
      Now I wounder what the last message "Syncing disks" covers, it do not look like it is starting to rebuild the raid.

      Kommentar


      • #4
        Zitat von k2teknik Beitrag anzeigen
        Thanks for you reply.
        cat /proc/mdstat shows:
        Code:
        Personalities : [linear] [raid0] [raid1] [raid5] [multipath] [raid10]unused devices: <none>
        So if you have RAID1 this is not running in "degraded" mode

        I currently have no RAID1 config for the IB4220 in mind, please post me the output from
        Code:
        mdadm --examine /dev/hda1
        and
        Code:
        mdadm --examine /dev/hda2
        Zitat von k2teknik Beitrag anzeigen
        Now I wounder what the last message "Syncing disks" covers, it do not look like it is starting to rebuild the raid.
        This "syncing" tell the kernel to load the new craeted partition table.
        Zuletzt geändert von ElektromAn; 30.04.2014, 17:33. Grund: type in mdadm
        Some random kernel coder
        Lots of stuff attached to serial console

        Kommentar


        • #5
          Zitat von ElektromAn Beitrag anzeigen
          So if you have RAID1 this is not running in "degraded" mode
          I should have RAID1 and it looks like I am running without RAID, just one single disc, so is there any way to "upgrade" to RAID1 without losing my other config and settings?

          I currently have no RAID1 config for the IB4220 in mind, please post me the output from
          Code:
          mdmadm --examine /dev/hda1
          My 4220 do not like the command "mdmadm --examine /dev/hda1", so I change it to "mdadm --examine /dev/hda1" and get:
          Code:
          /dev/hda1:          Magic : a92b4efc
                  Version : 00.90.00
                     UUID : ee0d2e4d:d27d20e5:ac3e0a5f:7c208b33
            Creation Time : Mon Jan  1 07:11:35 2007
               Raid Level : raid1
              Device Size : 104320 (101.89 MiB 106.82 MB)
             Raid Devices : 2
            Total Devices : 2
          Preferred Minor : 0
          
          
              Update Time : Wed Apr 23 12:01:37 2014
                    State : clean
           Active Devices : 1
          Working Devices : 2
           Failed Devices : 1
            Spare Devices : 1
                 Checksum : 2b1409d6 - correct
                   Events : 0.467000
          
          
          
          
                Number   Major   Minor   RaidDevice State
          this     2       3        1        2      spare   /dev/hda1
          
          
             0     0       3       65        0      active sync   /dev/hdb1
             1     1       0        0        1      faulty removed
             2     2       3        1        2      spare   /dev/hda1
          And on "mdadm --examine /dev/hda2" I get nothing in return.

          Kommentar


          • #6
            mdmadm is a typo ...
            But you used the right command.

            rebuilding RAID1 on the /system partition is easy.
            Because this is allready RAID1
            Zitat von k2teknik Beitrag anzeigen
            Code:
            /dev/hda1:          Magic : a92b4efc
                    Version : 00.90.00
                       UUID : ee0d2e4d:d27d20e5:ac3e0a5f:7c208b33
              Creation Time : Mon Jan  1 07:11:35 2007
                 Raid Level : raid1
                Device Size : 104320 (101.89 MiB 106.82 MB)
               Raid Devices : 2
              Total Devices : 2
            Preferred Minor : 0
            
            
                Update Time : Wed Apr 23 12:01:37 2014
                      State : clean
             Active Devices : 1
            Working Devices : 2
             Failed Devices : 1
              Spare Devices : 1
                   Checksum : 2b1409d6 - correct
                     Events : 0.467000
            
            
            
            
                  Number   Major   Minor   RaidDevice State
            this     2       3        1        2      spare   /dev/hda1
            
            
               0     0       3       65        0      active sync   /dev/hdb1
               1     1       0        0        1      faulty removed
               2     2       3        1        2      spare   /dev/hda1
            First restart /dev/hda1 as md0 -> Preferred Minor : 0

            Code:
            mdadm --assemble /dev/md0 /dev/hda1
            If this not work use the "hard" way.
            Create (--create) a "new" RAID1 with intact data on the device (--assume-clean) and one missing device

            Code:
            mdadm --create /dev/md0 /dev/hda1 missing --assume-clean
            With
            Code:
            cat /proc/mdstat
            you see some output, i.e.

            Code:
            md0: hda1(0) [U_]
            Important is here "md0" and "hda1" and the "U", The Last character means "up".

            OK.
            If you are here without error, add the "new" empty partition.
            But before this check the partition sizes on /dev/hdb

            This must be the same as on /dev/hda.
            I've taken this form you post and change the device node.
            Code:
             
            
            Disk /dev/hdb: 200.0 GB, 200049647616 bytes
            255 heads, 63 sectors/track, 24321 cylinders
            Units = cylinders of 16065 * 512 = 8225280 bytes
            
            
               Device Boot    Start       End    Blocks   Id  System
            /dev/hdb1               1          13      104422   fd  Linux raid autodetect
            /dev/hdb2              14       24289   194996970   fd  Linux raid autodetect
            /dev/hdb3           24290       24321      257040   82  Linux swap
            
            
            Disk /dev/hdb: 200.0 GB, 200049647616 bytes
            255 heads, 63 sectors/track, 24321 cylinders
            Units = cylinders of 16065 * 512 = 8225280 bytes
            The number of block (forth column) must be equal or greater !

            Now add the new partition
            Code:
            mdadm --add /dev/md0 /dev/hdb1
            With
            Code:
            cat /proc/mdstat
            you will see the build process and with [UU] the RAID1 is working.

            With the Datapartition on /dev/hda2 you will see the config either on the Webinterface on in the "Systemdatabase"
            Some random kernel coder
            Lots of stuff attached to serial console

            Kommentar


            • #7
              Zitat von ElektromAn Beitrag anzeigen
              Code:
              mdadm --assemble /dev/md0 /dev/hda1
              If this not work use the "hard" way.
              Create (--create) a "new" RAID1 with intact data on the device (--assume-clean) and one missing device

              Code:
              mdadm --create /dev/md0 /dev/hda1 missing --assume-clean
              I had tried both, no success.
              But I was testing to make a total reinstall (I have more than one 4220) and it turns out that a reinstall can be up and running within 15 minutes + transfer of data, so that was the answer this time (there is a value in having a backup of config and the application folder of the 4220).

              But anyhow thanks for you help, I will dig into mdadm later I have now a failure that I can to try to recover.

              Kommentar


              • #8
                Zitat von k2teknik Beitrag anzeigen
                I had tried both, no success.
                But I was testing to make a total reinstall (I have more than one 4220) and it turns out that a reinstall can be up and running within 15 minutes + transfer of data, so that was the answer this time (there is a value in having a backup of config and the application folder of the 4220).

                But anyhow thanks for you help, I will dig into mdadm later I have now a failure that I can to try to recover.
                What kind of error do you have ??
                Some random kernel coder
                Lots of stuff attached to serial console

                Kommentar

                Lädt...
                X