Detect USB Drive and Execute the Command
am 24.09.2007 10:05:28 von gurdyalHello,
I am trying to write a shell script which will install image residing
on the USB drive onto Hard Drive.
When i boot computer, the hard drive is shown as /dev/sda and usb
drive as /dev/sdb
Below is the script i am trying to execute
mount /dev/sdb1 /usbdrive
echo Creating partitions
sfdisk --force /dev/sda < /usbdrive/img/TM090001.PAR
echo Installing Image
gzip -d -c /usbdrive/img/TM090001 - | dd bs=2M of=/dev/sda1
echo Installing MBR
dd if=/usbdrive/img/TM090001.MBR of=/dev/sda
echo done
The sript above has name InstallOS.sh and resides in USB drive /
commands/InstallOS.sh
But problem is when i have multipule usb drives, i won't know which
drive to mount
I want to have script :
which auto mounts the correct usb drive which has /img/*.MBR as /
usbdrive
copies /usbdrive/commands/InstallOS.sh to /work/
and executes /work/InstallOS.sh
any help will be appriciated
Regards,
Guru