/[smeserver]/cdrom.image/updates/raidconvert
ViewVC logotype

Diff of /cdrom.image/updates/raidconvert

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.5 by slords, Fri Dec 22 23:52:44 2006 UTC Revision 1.6 by slords, Sat Dec 23 18:31:05 2006 UTC
# Line 23  then Line 23  then
23          fi          fi
24    
25          mdadm -C $md -l 1 -n 2 -R $part missing          mdadm -C $md -l 1 -n 2 -R $part missing
         echo "DEVICE $part" >> /tmp/mdadm.conf  
26    
27          if grep -q "^$part .*Id=83" /tmp/oldparts          if grep -q "^$part .*Id=83" /tmp/oldparts
28          then          then
# Line 31  then Line 30  then
30              resize2fs -fp $md              resize2fs -fp $md
31    
32              mount $md /mnt/tmp              mount $md /mnt/tmp
33              [ -r /mnt/tmp/etc/fstab ] && root=$md              [ -r /mnt/tmp/etc/fstab ] && sed -i "s|/dev/$device\([0-9]\+\)|/dev/md\1|" /mnt/tmp/etc/fstab
34              umount /mnt/tmp              umount /mnt/tmp
35    
36    
# Line 40  then Line 39  then
39              mkswap $md              mkswap $md
40          fi          fi
41      done      done
   
     echo >> /tmp/mdadm.conf  
     mdadm -Es -c /tmp/mdadm.conf >> /tmp/mdadm.conf  
   
     if [ -n "$root" ]  
     then  
         mount $root /mnt/tmp  
         sed -i "s|/dev/$device\([0-9]\+\)|/dev/md\1|" /mnt/tmp/etc/fstab  
         cp /tmp/mdadm.conf /mnt/tmp/etc/mdadm.conf  
         umount /mnt/tmp  
     fi  
42      rmdir /mnt/tmp      rmdir /mnt/tmp
43    
44      mdadm --stop --scan      mdadm --stop --scan
   
45      sfdisk --force /dev/$device < /tmp/newparts      sfdisk --force /dev/$device < /tmp/newparts
46  fi  fi


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed