|
|
Mounting disk images from command line
|
|
|
|
Forum Regular
Join Date: Nov 2000
Location: The voice inside your head
Status:
Offline
|
|
Yes, I know that's what disk copy does, but I'm wondering how it could be done from the command line, if it's possible at all.
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status:
Offline
|
|
Originally posted by lythari:
<STRONG>Yes, I know that's what disk copy does, but I'm wondering how it could be done from the command line, if it's possible at all.</STRONG>
yup, possible. try hdiutil
edit: yeah, disktool should work too, but since hdiutil is documented, you can actually use it without any dangerous experimentation.
[ 03-31-2002: Message edited by: Mactoid ]
|
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status:
Offline
|
|
Couldn't you also use...
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
[localhost:~] theman% open -a /Applications/Utilities/Disk\ Copy.app/Contents/MacOS/Disk\ Copy /path/to/img
</font>[/code]
And just replace /path/to/img with the actual location of the image... I do this with Stuffit, and I assume it would work with Disk Copy, unless it isn't capable of handling this type of event...
|
"In Nomine Patris, Et Fili, Et Spiritus Sancti"
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Nov 2001
Location: Adelaide, South Australia
Status:
Offline
|
|
Originally posted by [APi]TheMan:
<STRONG>Couldn't you also use...
% open -a /Applications/Utilities/Disk\ Copy.app/Contents/MacOS/Disk\ Copy /path/to/img
</STRONG>
I guess so, if you were feeling like typing or tabbing a lot!
Let "open -a" work its little bit of magic...
% open -a "disk copy" /path/to/img
Cheers,
Paul
[ 04-01-2002: Message edited by: Paul McCann ]
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status:
Offline
|
|
using "Disk Copy" also assumes that you are logged into the Window Manager, so that Disk Copy can launch. Not a good assumption to make considering this is the Unix forum.
|
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Nov 2000
Location: The voice inside your head
Status:
Offline
|
|
Thanks, I'll try hdiutil and disktool out.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Nov 2000
Location: The voice inside your head
Status:
Offline
|
|
Is there anyway to specify the dev-entry and mount point for a disk image? The man page for hdiutil is cryptic (aren't they all ) and doesn't seem to say anything about that.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status:
Offline
|
|
Originally posted by lythari:
Is there anyway to specify the dev-entry and mount point for a disk image? The man page for hdiutil is cryptic (aren't they all ) and doesn't seem to say anything about that.
Sorry to ressurrect a REALLY old thread, but I'd like to know the answer to this, too. Anyone know how to get a disk image to mount someplace other than /Volumes/ ? Thanks!
|
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: May 2002
Status:
Offline
|
|
(This is my guess) I think, I think
you can change it in the /etc/fstab. Since
I have never actually tried editing or
even lookin into the fstab I don't know
if you can do it this way
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by theory:
(This is my guess) I think, I think
you can change it in the /etc/fstab. Since
I have never actually tried editing or
even lookin into the fstab I don't know
if you can do it this way
I read the man pages and there doesn't seem to be a way to tell hdiutil or hdid where to mount the image. Also I had 3 fstab.xx files, all of which had a "This file is obsolete" comment at the top, I assume this info in in NetInfo now or something.
If you're interested though the hdid man page says how to create a RAM disk which I thought was interesting:
Code:
hdid -nomount ram://<sectors>
will attach a ram disk that can be mounted and used after
being formatted with a newfs utility or Disk Utility.app.
A sector is 512 bytes.
A small shell script to create and mount a ram disk:
#!/bin/sh
NUMSECTORS=128000
mydev=`hdid -nomount ram://$NUMSECTORS`
newfs_hfs $mydev
mkdir /tmp/mymount
mount -t hfs $mydev /tmp/mymount
WM
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Apr 2002
Location: Red Bluff, CA
Status:
Offline
|
|
Originally posted by WJMoore:
I read the man pages and there doesn't seem to be a way to tell hdiutil or hdid where to mount the image. Also I had 3 fstab.xx files, all of which had a "This file is obsolete" comment at the top, I assume this info in in NetInfo now or something.
If you're interested though the hdid man page says how to create a RAM disk which I thought was interesting:
Code:
hdid -nomount ram://<sectors>
will attach a ram disk that can be mounted and used after
being formatted with a newfs utility or Disk Utility.app.
A sector is 512 bytes.
A small shell script to create and mount a ram disk:
#!/bin/sh
NUMSECTORS=128000
mydev=`hdid -nomount ram://$NUMSECTORS`
newfs_hfs $mydev
mkdir /tmp/mymount
mount -t hfs $mydev /tmp/mymount
WM
Do you suppose that it would be possible setup osx to create and mount a new ram disk at startup and then place the swapfile on the ramdisk?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2001
Location: Houston, TX
Status:
Offline
|
|
Originally posted by darkcore:
Do you suppose that it would be possible setup osx to create and mount a new ram disk at startup and then place the swapfile on the ramdisk?
That would qualify for most useless but cool idea of the month. I approve
--Josh
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: May 2002
Status:
Offline
|
|
Unless you have 4GB of ram or you don't use
wont run lots of program you will quicly run
into problems. (Remember what used to
happen in OS 9 when you ran out of memory
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|