Hi all,
I was getting a little annoyed with seeing my WindowsXP partition in the Finder and on the desktop all the time, so I looked around for a way to easily mount and unmount it. This bash script comes from a hint on Macosxhints.com, I didn't write it, just modified it a little bit! I've added it as a startup item, and whenever I need my WindowsXP volume mounted (it's a FAT32 formatted partition) I just run the script again and the volume will get mounted. This script sort of toggles the mounting status of my partition.
What you need to do is to find out a) your volumes name and b) your volumes partition (you can do this by showing info on the partition in Disk Utility. Put this in the script, save the script in for example /usr/local/bin and make it execute (chmod 777) and off you go.
If you want to make this more gui friendly, you can wrap it in an Applescript app (with the line do shell script "/usr/local/bin/WindowsXPmount" for example), add the Windows XP logo and wowee you got a little app that toggles the visibility for your Win partition.
Now if I only could find out a way to make the Volume name lowercase, eg WindowsXP instead of WINDOWSXP, I would be really happy. Somehow FAT32 formatting makes it impossible to get rid of these screamin CAPS in drive names...
/S
I was getting a little annoyed with seeing my WindowsXP partition in the Finder and on the desktop all the time, so I looked around for a way to easily mount and unmount it. This bash script comes from a hint on Macosxhints.com, I didn't write it, just modified it a little bit! I've added it as a startup item, and whenever I need my WindowsXP volume mounted (it's a FAT32 formatted partition) I just run the script again and the volume will get mounted. This script sort of toggles the mounting status of my partition.
What you need to do is to find out a) your volumes name and b) your volumes partition (you can do this by showing info on the partition in Disk Utility. Put this in the script, save the script in for example /usr/local/bin and make it execute (chmod 777) and off you go.
Code:
#!/bin/bash
NAME=WINDOWSXP
PART=disk0s3
if [ -z `ls -1 /Volumes/ | grep $NAME` ] ; then
# check that PART appears to be a disk partition
echo Checking $NAME $PART
if [ `file /dev/$PART | awk '{print $2}'` = "block" ] ; then
echo Mounting $NAME $PART
diskutil mount /dev/$PART
else
echo /dev/$PART does not appear to be a disk partition - exiting
exit 1
fi
else
echo unmounting $NAME
diskutil unmount /Volumes/$NAME
fi
If you want to make this more gui friendly, you can wrap it in an Applescript app (with the line do shell script "/usr/local/bin/WindowsXPmount" for example), add the Windows XP logo and wowee you got a little app that toggles the visibility for your Win partition.
Now if I only could find out a way to make the Volume name lowercase, eg WindowsXP instead of WINDOWSXP, I would be really happy. Somehow FAT32 formatting makes it impossible to get rid of these screamin CAPS in drive names...
/S