[CentOS] Hard disk, format, filesystem SOLVED

Guy Boisvert boisvert.guy at videotron.ca
Sat Aug 16 14:11:05 UTC 2008


Jussi Hirvi wrote:
> Les Mikesell <lesmikesell at gmail.com> escribio (15.8.2008 20:01)
>> I would have just used fdisk instead of partd.  If you are adding this
>> to a raid, you don't need a filesystem, just a partition of the right
>> size.  The contents are going to be wiped by the raid sync anyway.
> 
> Thanks for comment. Fdisk was recommended me by another experienced user
> too, so there is probably a good reason. Though I don't know, what's wrong
> with using parted. 
> 
> BTW, this problem partition was not the raid1 partition, but a copy of the
> boot partition on the startup disk. In case the boot disk ever fails, I hope
> I can make the 2nd disk bootable by just installing grub.
> 
> - Jussi 
> 

I had this same boot problem you had and i found the following script 
made by Alex Tkachenko (Thanks Alex!):


====================== CUT HERE ====================================
#!/bin/sh
#
# Update MBR on both mirror drives
# (grub/swraid has problems updating the slave, # as of RHEL3)
# Should be run after grub rpm updates as well
#
# By Alex Tkachenko <alex at ingrian.com>

ADMINDIR=/root/admin



if [ ! -d $ADMINDIR ]
then
         echo $ADMINDIR does not exists.
         echo Creating $ADMINDIR for storing boot sector backups...
         mkdir -p $ADMINDIR
else
         echo $ADMINDIR exists.
fi


BOOT_ARRAY=`df /boot | awk '/dev/{print $1}'`

# Select only active disks (skip spares)
DISKS=`mdadm --query --detail /dev/md0 | awk '/active sync/{print $7}'| 
sed '
s@/dev/@@g
s/,/ /g
s/[0-9]//g
'`

for d in $DISKS
do

         cat <<EOF | /sbin/grub --batch --no-floppy
device (hd0) /dev/$d
root (hd0,0)
setup (hd0)
quit
EOF

         # Save updated mbr
         dd if=/dev/$d of=$ADMINDIR/mbr.$d count=1
done
====================== CUT HERE ====================================



Guy Boisvert, ing.
IngTegration inc.



More information about the CentOS mailing list