RE: reaid problem at reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



/dev/sdj1 cant be first, its /dev/sda1.

My friend made a python script. take a look.

cat rebuild.py
#!/usr/bin/env python

#  /dev/sdj1 /dev/sdc1 /dev/sda1 /dev/sdd1 /dev/sdh1 /dev/sdi1

import os;
import time;
from itertools import permutations;

#aLetters = ( 'a', 'c', 'd', 'h', 'i', 'j' );
aLetters = ( 'j', 'c', 'h' );
j = [];
for i in permutations(aLetters):
        if i[0:3] == j[0:3]: continue;
        j = i;
        time.sleep(0.1);
        os.system("vgchange -an vgRAID60 2>/dev/null >/dev/null");
        os.system("mdadm -S /dev/md127 2>/dev/null >/dev/null");
        os.system("mdadm -S /dev/md126 2>/dev/null >/dev/null");
        os.system("mdadm -S /dev/md0 2>/dev/null >/dev/null");
        (hStdin, hStdout) = os.popen4("mdadm --create /dev/md0 --level=6 --raid-devices=6 --assume-clean --chunk=128 /dev/sda1 /dev/sd%s1 /dev/sd%s1 /dev/sd%s1 missing missing" % (i[0:3]));
        hStdin.write("y\n");
        hStdin.close();
        hStdout.close();
        time.sleep(0.5);
        (hStdin, hStdout) = os.popen4("pvck /dev/md0");
        sOutput = hStdout.read();
        hStdin.close();
        hStdout.close();
        print("/dev/sdj1 /dev/sd%s1 /dev/sd%s1 /dev/sd%s1 missing missing" % (i[0:3]));
        fRAID = open("/dev/md0", 'r');
        try:
                fRAID.seek(4608);
                sLVM = fRAID.read(128);
                fRAID.close();
        except:
                fRAID.close();
                continue;
        print(sLVM);
        if sOutput.find("Found label") != -1:
                os.system("/bin/bash");
#               os.system("vgchange -ay vgRAID60 2>/dev/null >/dev/null");
#               os.system("vgmknodes");
#               iExit = os.system("e2fsck -n /dev/vgRAID60/data0");
#               if iExit == 0:
#                       print("/dev/sd%s1 /dev/sd%s1 /dev/sd%s1 /dev/sd%s1 missing missing" % (i));

i can see the data with the combinatin below, but there is a lot of errors, sounds like a rebuild was started(beghining of the disk) then was canceled

we made a snapshot, run a e2fsck on it and im still(not now, gotta sleep) add 1 missing or 2. after the e2fsck i mount the snap, look at the data, check corruption, rince and repeat with another combination of missing and not. i rate the ones with less corruption



the only e2fsck working is with --->>> a,j,c,h,i,d
 		 	   		  --
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux