Announcement

Collapse
No announcement yet.

Trying to implement RAID 1 [using mdadm] from an existing hard drive

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

    OK...finished up a big project, backed up all my programs, and I am finally giving this a shot.

    I am about to let the RAID sync run all night, but I wanted to ask some questions about setting up my fstab.

    Once the RAID sync is completed, I see that I create the mdadm config file. At this point, I will still be running off of my live CD, correct? Then, I would assume, I correct my /etc/fstab and then I reboot into my real system?

    My question is getting to that /etc/fstab. I know that to write to it, I will need to mount that partition. How do I do that? I know how to mount a regular partition...

    Once the sync is done, do I just:
    mount /dev/md3 / && mount /dev/md4 /home ?
    Then write the mdadm config file and then correct my fstab?

    Thanks again for your help...sorry to drag this on for so long.

    Comment


      #17
      Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

      So, after syncing, I tried to mount the partition in the way I just described:
      mount /dev/md3 /
      mount /dev/md4 /home

      and it didn't work. DMESG tells me:
      Code:
      EXT4-fs (md4): bad geometry: block count 175343450 exceeds size of device (175343424 blocks)
      I hope that I didn't screw something up...

      Comment


        #18
        Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

        As far as editing the fstab, yes it's the one on the install but you should be able to mount it directly - sudo mount /dev/sda3 /mnt/sda3 - use a different mount, not "/" when running from the liveCD because it's already got a "/". Then edit /mnt/sda3/etc/fstab.

        I'm assuming since you only reported the error on md4 that md3 mounted OK?. To assure yourself that your data is still intact, you can mount the individual device directly like above - sudo mount /dev/sda4 /mnt/sda4 - and look at your data.

        From a terminal (booted to the liveCD) start that array and then do mdadm --detail /dev/md4 and post the output. Some reading I did this morning some people are having issues using ext4 and RAID if the entire disk is used. It seems leaving a bit of space at the end cures this problem - in the order of about 100mb or so.

        You may consider running gparted from your live CD, resizing the two #4 partitions a bit and trying again.

        Did you back up all your data on partition #4? If you did and are sure the data is retrievable, you might consider changing partition 4 to an extended partition and creating partition 5 as a logical partition and putting your data there. Then you can use the space at the end of the drive for /tmp or swap.

        Please Read Me

        Comment


          #19
          Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

          Code:
          $ sudo mount /dev/sda3 /mnt/sda3
          mount: unknown filesystem type 'linux_raid_member'
          This is what I get when I try to mount the thing directly.
          Code:
          ubuntu@ubuntu:~$ sudo mount /dev/md3 /mnt/sda3
          mount: wrong fs type, bad option, bad superblock on /dev/md3,
              missing codepage or helper program, or other error
              In some cases useful info is found in syslog - try
              dmesg | tail or so
          Code:
          $ dmesg
          EXT4-fs (md3): bad geometry: block count 61034951 exceeds size of device (61034928 blocks)
          So it looks like I am getting some similar errors as before. I get similar errors using both /dev/sda4 & /dev/sda3.

          I am not quite sure how to start the array, but when I run mdadm --detail, I get the following:
          Code:
          $ sudo mdadm --detail /dev/md3
          /dev/md3:
              Version : 00.90
           Creation Time : Fri Sep 17 08:53:59 2010
             Raid Level : raid1
             Array Size : 244139712 (232.83 GiB 250.00 GB)
           Used Dev Size : 244139712 (232.83 GiB 250.00 GB)
            Raid Devices : 2
           Total Devices : 2
          Preferred Minor : 3
            Persistence : Superblock is persistent
          
            Update Time : Fri Sep 17 12:21:47 2010
               State : clean
           Active Devices : 2
          Working Devices : 2
           Failed Devices : 0
           Spare Devices : 0
          
                UUID : d646f9a5:1a7aac6f:e368bf24:bd0fce41 (local to host ubuntu)
               Events : 0.21
          
            Number  Major  Minor  RaidDevice State
              0    8    3    0   active sync  /dev/sda3
              1    8    19    1   active sync  /dev/sdb3
          and

          Code:
          $ sudo mdadm --detail /dev/md4
          /dev/md4:
              Version : 00.90
           Creation Time : Fri Sep 17 08:54:19 2010
             Raid Level : raid1
             Array Size : 701373696 (668.88 GiB 718.21 GB)
           Used Dev Size : 701373696 (668.88 GiB 718.21 GB)
            Raid Devices : 2
           Total Devices : 2
          Preferred Minor : 4
            Persistence : Superblock is persistent
          
            Update Time : Fri Sep 17 12:21:41 2010
               State : clean
           Active Devices : 2
          Working Devices : 2
           Failed Devices : 0
           Spare Devices : 0
          
                UUID : 568cea05:57ed899d:e368bf24:bd0fce41 (local to host ubuntu)
               Events : 0.21
          
            Number  Major  Minor  RaidDevice State
              0    8    4    0   active sync  /dev/sda4
              1    8    20    1   active sync  /dev/sdb4
          Since I can't seem to mount anything - can you recommend a way that I can just verify that my data is intact? Thanks again for all of your help, o-lover. I really do appreciate it.



          Comment


            #20
            Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

            Oh, but when I do fire up gparted, It looks like the same amount of data is written to /dev/sda3 and /dev/sdb3 & sda4/sdb4 respectively. So it looks like I haven't really lost anything, I might just need to figure out how to get to it all. Thanks again.

            Comment


              #21
              Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

              Hmm, well to check the status of your raid devices (which seem to be active) type cat /proc/mdstat in a terminal. I am reading a lot of ext4 problems with RAID - IMO ext4 is not ready for regular use. Anyway..

              Try failing one of the devices and see if you can mount it then.

              mdadm /dev/md3 --fail /dev/sdb3

              Please Read Me

              Comment


                #22
                Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

                It also appears I'm incorrect on being able to mount a RAID1 member individually. I had to stop the raid device, then zero the superblock on the desired member, then I could mount it alone. Take heart though that your raid members are equal bytes used. At the very least you have a backup.

                I don't use ext4 so I'm struggling to find you some help. There's several bugs being tracked regarding ext4 and raid members. The only work-around I've found so far is to install the kernel from Jaunty - which seems a drastic measure at this point.

                Please Read Me

                Comment


                  #23
                  Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

                  So at this point, how do I just go back to booting my computer normally. I haven't written anything to my real /etc/fstab, so I ought to be able to just boot right up, right?

                  At this point, all I have done was to create the md3 and md4 RAID 1 arrays, and then I let them sync. I really haven't done anything else. What happens if I just reboot?

                  Comment


                    #24
                    Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

                    duplicate

                    Comment


                      #25
                      Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

                      Rebooting might just solve your issue.

                      If it were me I would update fstab (keeping a backup of the previous one) to include the new raid devices and reboot. It won't leave you worse off than your are now.

                      Assuming the same error persists, reboot to the liveCD, remove the second partition from the raid, stop the RAID devices

                      sudo mdadm /dev/md3 --fail /dev/sdb3
                      sudo mdadm --stop /dev/md3
                      sudo mdadm --zero-superblock /dev/sdb3

                      Then you should be able to mount /dev/sdb3 and see all your data.
                      Repeat the above for each partition and you should be able to mount all 4 of them individually.

                      I'm totally bummed you're having so much trouble. I did almost the exact steps I told you to do just last week testing out RAID transfer rates and had no issues what so ever. I even use "nested" raid - RAID1 on top of RAID0. I'm guessing it's the kernel bug I've been reading about.

                      IF you're not totally disheartened and want to try again:

                      I would start by copying the contents of /dev/sda4 to backup (or into /dev/sda3). Then remove sda4 and sdb4 and recreate them as extended partitions, then create logical partition sda5 and sdb5. Then format them both reiserfs and copy your data back to /dev/sda5 and recreate the RAID1 using the steps I outlined before.

                      Then test this new device and see if you're getting the same error or not.

                      Please Read Me

                      Comment


                        #26
                        Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

                        I gave it a shot. My first reboot gave me some errors about UUID, which I didn't expect.

                        Then I booted liveCD again, stopped the raid devices, rebooted, and I am working again.

                        I think that I will do a little bit more reading about ext4 and then try to sort this out again.

                        Thanks again for all of your help. I think that I will give this a try come Monday or Tuesday.

                        Comment


                          #27
                          Re: Trying to implement RAID 1 [using mdadm] from an existing hard drive

                          Yeah - the raid devices will have different UUID's than the individual devices.

                          mdadm will copy the UUID of the first array member and assign the same UUID to the other members during creation and then create a new UUID for the raid device. The terminal command blkid will list all UUID's

                          Please Read Me

                          Comment

                          Working...
                          X