#!/bin/sh SAVETO="/etc" # Do ATA drives for DRIVE in `ls -l /dev/hd* 2>/dev/null | grep -v [0-9]$ | grep disk | cut -d"/" -f3` do dd if=/dev/$DRIVE of=$SAVETO/mbr-$DRIVE bs=512 count=1 done # Do SCSI drives for DRIVE in `ls -l /dev/sd* 2>/dev/null | grep -v [0-9]$ | grep disk | cut -d"/" -f3` do dd if=/dev/$DRIVE of=$SAVETO/mbr-$DRIVE bs=512 count=1 done