sysnak
01-30-2007, 11:21 AM
Hi there;
I'm trying to use a mac to clone 2 external USB drives to eachother. Ordinarily, I plug in and run dd if=/dev/rdisk1 of=/dev/rdisk2 , etc. .
I need to keep these drives in a virgin state, so the problem I'm running into is that osx writes a .Trash and .Desktop file to any volume mounted as RW, either Fat16/Fat32 (MSDOS) or any other Read/Write volume that is mounted.
I'm trying to either
a) temporarily prevent auto-mounting of external hot-pluggable drives
or
b) make all MSDOS volumes mount as Read Only.
I've tried avenues under both methods, both :
a) did a ps -aux and killed both processes that had the text "automount" in them, no effect
b) edited fstab to try and encompass all MSDOS volumes, however I don't beleive this is working because either UUID or VolumeName must be specified for the entry... names or mount points which can't be known until the device is plugged in!!! (chicken or the egg problem).
perhaps I'm not throwing in the wildcard appropriately? I tried using an asterisk (*), but no effect.
Now today, I found something on the net about relocating a swap drive.
I notice that a variable called "${AUTODISKMOUNT:=-YES-}" ... is this user modifiable anywhere in the system?
Any ideas?
http://www.xlr8yourmac.com/OSX/OS_x_swapfile_notes.html
1) Back-up your /etc/rc file, because that is the file that we will be editing.
2) As root, open /etc/rc in a text editor and find the section that begins with:
##
# Start the virtual memory system.
##
ConsoleMessage "Starting virtual memory"
swapdir=/private/var/vm
3) Because OS X/Darwin normally mounts other disks *after* setting up swap, you must open /System/Library/StartupItems/Disks/Disks in a text editor and copy/paste the following lines to /etc/rc just before the section shown above:
##
# Mount any remaining filesystems
##
if [ ! -f /var/db/volinfo.database ]; then Uninitialized_VSDB=-YES-; fi
if [ "${AUTODISKMOUNT:=-YES-}" != "-NO-" ]; then
ConsoleMessage "Mounting media"
case ${AUTODISKMOUNT} in
-REMOVABLE-)
autodiskmountflags="-a" ;; # Mount removeable media
*)
autodiskmountflags="" ;;
esac
autodiskmount -v ${autodiskmountflags}
fi
if [ "${Uninitialized_VSDB:=-NO-}" = "-YES-" ]; then vsdbutil -i; fi
4) Now change the line 'swapdir=/private/var/vm' to the desired drive location...It should begin with /Volumes/. I've placed mine in /Volumes/harp/DO_NOT_TOUCH/.vm ... harp is the name of the volume. The directory DO_NOT_TOUCH is a visible warning, and the directory that will actually contain the swapfiles is invisible to the Finder because it has a "." in front of it.
I hope that makes sense...And don't get rid of the
/System/Library/StartupItems/Disks/ because other start-up items are dependent on it. Alternatively, you could probably create an OS X style StartupItem for starting up swap, but I'd rather have my swap ready earlier in the boot process.
Eugene Chan "
I'm trying to use a mac to clone 2 external USB drives to eachother. Ordinarily, I plug in and run dd if=/dev/rdisk1 of=/dev/rdisk2 , etc. .
I need to keep these drives in a virgin state, so the problem I'm running into is that osx writes a .Trash and .Desktop file to any volume mounted as RW, either Fat16/Fat32 (MSDOS) or any other Read/Write volume that is mounted.
I'm trying to either
a) temporarily prevent auto-mounting of external hot-pluggable drives
or
b) make all MSDOS volumes mount as Read Only.
I've tried avenues under both methods, both :
a) did a ps -aux and killed both processes that had the text "automount" in them, no effect
b) edited fstab to try and encompass all MSDOS volumes, however I don't beleive this is working because either UUID or VolumeName must be specified for the entry... names or mount points which can't be known until the device is plugged in!!! (chicken or the egg problem).
perhaps I'm not throwing in the wildcard appropriately? I tried using an asterisk (*), but no effect.
Now today, I found something on the net about relocating a swap drive.
I notice that a variable called "${AUTODISKMOUNT:=-YES-}" ... is this user modifiable anywhere in the system?
Any ideas?
http://www.xlr8yourmac.com/OSX/OS_x_swapfile_notes.html
1) Back-up your /etc/rc file, because that is the file that we will be editing.
2) As root, open /etc/rc in a text editor and find the section that begins with:
##
# Start the virtual memory system.
##
ConsoleMessage "Starting virtual memory"
swapdir=/private/var/vm
3) Because OS X/Darwin normally mounts other disks *after* setting up swap, you must open /System/Library/StartupItems/Disks/Disks in a text editor and copy/paste the following lines to /etc/rc just before the section shown above:
##
# Mount any remaining filesystems
##
if [ ! -f /var/db/volinfo.database ]; then Uninitialized_VSDB=-YES-; fi
if [ "${AUTODISKMOUNT:=-YES-}" != "-NO-" ]; then
ConsoleMessage "Mounting media"
case ${AUTODISKMOUNT} in
-REMOVABLE-)
autodiskmountflags="-a" ;; # Mount removeable media
*)
autodiskmountflags="" ;;
esac
autodiskmount -v ${autodiskmountflags}
fi
if [ "${Uninitialized_VSDB:=-NO-}" = "-YES-" ]; then vsdbutil -i; fi
4) Now change the line 'swapdir=/private/var/vm' to the desired drive location...It should begin with /Volumes/. I've placed mine in /Volumes/harp/DO_NOT_TOUCH/.vm ... harp is the name of the volume. The directory DO_NOT_TOUCH is a visible warning, and the directory that will actually contain the swapfiles is invisible to the Finder because it has a "." in front of it.
I hope that makes sense...And don't get rid of the
/System/Library/StartupItems/Disks/ because other start-up items are dependent on it. Alternatively, you could probably create an OS X style StartupItem for starting up swap, but I'd rather have my swap ready earlier in the boot process.
Eugene Chan "