Google Answers Logo
View Question
 
Q: Mounting a hard drive as a single large file under OSX. ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: Mounting a hard drive as a single large file under OSX.
Category: Computers > Software
Asked by: riegel-ga
List Price: $35.00
Posted: 21 May 2002 16:29 PDT
Expires: 20 Jun 2002 16:29 PDT
Question ID: 17334
I recorded an audio program using system 9.1 on an iMac. I used a
small piece of Freeware called SoundRecorder. It creates a temp file
when recording (presumably AIFF format) If recording is stopped and
then started again the temp file is lost without warning. I lost about
an hour and one half of a live program that was not recorded anywhere
else.

I shut down the computer and have not touched the hard drive since. I
haven't even booted it up again. I am proficient enough to remove the
drive and put it in my G4 and start it up using another drive. What I
would like to do is this.

Using a G4 and OS X, mount the drive and treat it a a single large
audio file, then browse through looking for the lost audio. Once I
find a piece I would then be able to back up to the begining (or the
part that wasn't lost) and save a subset of the drive (file) to a new
audio file on a seperate drive.

The question I have is how do I do this.
1. How do I mount the drive as a single large file under OSX.
2. How do I extract the RAW data that SoundRecorder uses to find the
lost data?
Answer  
Subject: Re: Mounting a hard drive as a single large file under OSX.
Answered By: bookface-ga on 21 May 2002 18:49 PDT
Rated:5 out of 5 stars
 
In OS X, all the system devices are accessed through something called
nodes, pointers to the raw device controls, found in /dev. Since you
just need the raw data, you don't need to mount the filesystem on the
drive; you just can use the special file:
             for
/dev/hda    1st IDE controller, 1st device (master)   [probably system
drive]
/dev/hdb    1st IDE controller, 2nd device (slave)
/dev/hdc    2nd IDE controller, 1st device (master)
/dev/hdd    2nd IDE controller, 2nd device (slave)

If you wish, to verify the letter you need, you can mount the drive
and take a ls to check and make sure you have the right
controller/device.

Once you have determined the device, you can use a program such as
feltip Sound Studio (a 14-day trial is available):
http://felttip.com/products/soundstudio/

Download links are on the right.

You can listen through the file/drive and select bits of it that sound
right.
You should be aware that this might not work too well, if your drive
was heavily fragmented; the pieces may be only a cluster big, which is
not very much at all (512 bytes on older systems - 32K). If you find
something, you can use Sound Studio's mixing and editing tools to
place it into a new file.

Hope this helps, and please request a clarification if necessary.

Clarification of Answer by bookface-ga on 21 May 2002 18:50 PDT
I apologize for not proofreading my answer more carefully before
submitting it; I meant to say, you can use SoundForge to open the file
/dev/hd? directly, if that wasn't clear.

Request for Answer Clarification by riegel-ga on 21 May 2002 21:16 PDT
I appreciate your attempt, however It doesn't answer my question. The
entries in the /dev directory are not hda, hdb, etc as is the case
with Linux. Although this is an IDE device the entries are not the
same in OS X (FeeBSD). How do I identify the drive. To answer this I
would need to know what drive it is. I can identify it if it is
master, or slave, but do not know what /dev entry it is. Also the /dev
directory is hidden from open/save dialog boxes, so I can't just
navigate to the /dev directory, and open the file.

Have you ever used a Mac, and have you ever used OS X? You did not
mention how I would set the type and creator for this file. I have
Sound Studio (a registered copy). It doesn't appear to open a file as
a raw file as Sound Forge apparently does (of course Sound Forge is a
PC program). I am using OS X.

The drive should not be fragmented at all as all I did to it was
initialize the drive, install the OS, download SoundRecorder, and
record the program. I did all of this in the same day.

Also what about Sound Recorder, what file format does it use? Don't I
need to know what format it uses, so that I can match the format in a
program I would try to open the file with?

Clarification of Answer by bookface-ga on 22 May 2002 19:07 PDT
I have used Macs before, fairly extensively though not on my primary
machine at any point, though admittedly my experience with OS X is
somewhat limited.

paulbeard is of course correct, BSD-based OSes use the /dev/disk#s#
system for identifying drives and partitions, though you should
probably use /dev/rdisk#s# which provides raw unbuffered access to the
disks. If you mount the drive using OS X, you can check the numbers by
doing 'mount' or 'df' and looking for the appropriate entry. I’m
sorry, but there is no way to tell without more information about your
setup which #s would be involved, though I suspect the second number
would be 1, and the first number would probably be from 1-3 depending
on where it’s plugged in.

Once you find this entry, you can make a link to the file inside the
/dev directory from any open/save accessible directory, such as the
desktop, with the following command line:
'ln –s /dev/rdisk#s# tempfile.aiff'

As paulbeard stated, you can alternatively make an image of the file
instead if you have the disk space for it; I will provide this
information if desired, though I think it would be a lesser solution.


I am surprised that Sound Studio, an application relying on access to
many forms of data, is still bound in OS X to the traditional
type/creator method, and I expected that Sound Studio would allow
direct access regardless of the Macintosh file type, as some
applications do. You can use a freeware program called CTC to get
around this limitation:
http://www.imagemontage.com/Docs/CTC.html
Download: http://www.imagemontage.com/software/CTC.sit

This will not affect the data on the drive, as the type/creator is
metadata not stored within the file itself but within the descriptor
for the file on HFS filesystems (which is why such information is not
preserved copying to and from other types of filesystems.)


SoundRecorder records the data in the same AIFF format for temp file,
and merely finalizes the file when the recording is complete (unless
you chose a QuickTime export format, but that is processed after the
file is saved).


I tried to emulate 7.5 on my system using Basilisk II and make an
audio recording in it to verify that one could take the image of the
drive as a file and listen to it for bits and pieces of audio, but
unfortunately the audio functions in SoundRecorder are not supported
(at least with the ROM file I’m using.) If the information I've
presented here is not sufficient, please ask again for clarification,
and tomorrow when I can have access to a computer running OS X I can
double check some of this information for you. But it should all
theoretically work.

I should point out that Microsoft Internet Explorer crashed three
times while researching this data (and hasn’t otherwise for several
weeks). Coincidence? I leave you to be the judge. :)

Request for Answer Clarification by riegel-ga on 23 May 2002 14:38 PDT
The information you have given is excellent, but it just isn't putting
me over the top to solve this problem.

Probably what I will have to do is figure out a way to make a disk
image, but This would have to let me make an image of the whole disk
in its raw format, not just what bits it thinks are important like a
disk copy. Fortunately this is only a 6 gig drive. I can dig up a 10
or 20 gig to do this with.

By the way I found Amadeus II and it has a method for opening up any
file as RAW data. I tested this by opening and playing a PDF file.

So now the problem is how to get the RAW device to look like a file. I
tried creating a symbolic link, but Amadeus (or OSX via directory
services provided to Amadeus) thinks this file is an alias to a
folder.
mount returns /dev/disk0s9 on /Volumes/Mac HD (local) as the /dev
entry. So What I did was unmount the drive, then I used ln -s
/dev/disk0s9 .Users/riegel/HD to create the symbolic link. This
created the link, but OS X thinks it is a link to a directory.

Still Stumped.

Clarification of Answer by bookface-ga on 23 May 2002 18:29 PDT
If you do have the space, it is trivial to use the new improved Disk
Copy that comes with OS X to make a complete bit-by-bit image from a
disk; simply select Image, New Image from Device..., select the device
and save location and soon (I'd estimate about 30-50 minutes if I had
to guess, but it is of course highly dependant on the drive speeds)
you have an image file. True image files, in the general sense of the
term, do not ignore bytes not in files; it's a bit-exact copy of
everything on the drive, with no header or footer information, which
is very useful for portability in most cases and low-level access in a
few relevant situations such as yours.

Alternatively, if you want to take a slightly more complex route,
though I see no good reason to do this, you can use 'dd' to copy from
virtually any source to any target.
dd if=/dev/disk0 of=imagefile.dmg
or
dd < /dev/disk0 > imagefile.dmg


The entry you came up with, disk 0 slice 9, seems to me to be
incorrect, though I don’t really know how MacOS prior to X deals with
partitioning and how OS X treats the drive numbering. What you should
probably do is compare df or mount listings with and without the drive
mounted (open two terminal windows for convenience, run one before
mounting and one after). The differing entry should definitively
correspond to the drive you’re seeking.


Secondly, I would like to avoid forcing you to image your disk if
possible; if your numbers were correct but the link shows up as a
directory, you can try linking to the disk# entry (without the
trailing slice number). It really shouldn’t matter whether you access
the specific data partition or the entire drive, and it seems that OS
X is trying to interpret the data it’s finding, even though it really
shouldn’t be dealing with a special entry like that; probably they
blocked off the /dev directory to prevent people from noticing things
like this. Still, I think the chances are slightly better that it
would process the /dev/disk# entry as a file rather than a directory,
and in any case it’s worth a shot; if not, I’m doubtful there is
another way to get raw access from within the buffered environment,
and you should probably try for the disk image.

Hope this solves any remaining problems, but please post again if
necessary. Out of curiosity, do you mind saying what the recording is
of?

Request for Answer Clarification by riegel-ga on 24 May 2002 05:24 PDT
Thanks for the info. I will try the remainder of your suggestions. I
am pretty confident about the /dev entry. I will try the remainder of
your suggestions, and create an image file as a last resort.
By the way the recording was a School Spring Concert. I have done
recordings of small school programs and such for years, and this one I
failed to have a backup recording device.

Clarification of Answer by bookface-ga on 24 May 2002 18:43 PDT
Thank you for your question, it led me to explore a lot more than I
had been with OS X, and reaffirmed my belief that things are tweakable
enough with X that I might really dedicate a purchase of a computer to
it, something I could not consider with the limited modifications
allowed in previous MacOS versions, although they were quite
user-friendly. I'd be about as glad as you to have this work out. :)

Thanks for choosing Google! Answers.
riegel-ga rated this answer:5 out of 5 stars
Great information. Quick clarifications.

Comments  
Subject: Re: Mounting a hard drive as a single large file under OSX.
From: paulbeard-ga on 21 May 2002 23:33 PDT
 
Actually, your drives are listed as devices: here's what one of mine
looks like.
 
Filesystem              1K-blocks     Used    Avail Capacity  Mounted
on
/dev/disk0s7             11642580 11581352    61228    99%    /
devfs                          34       34        0   100%    /dev
fdesc                           1        1        0   100%    /dev
<volfs>                       512      512        0   100%    /.vol
/dev/disk0s6              1048440   445452   602988    42%   
/Volumes/nine
/dev/disk1s6              2112552  1698168   414384    80%   
/Volumes/untitled
automount -fstab [297]          0        0        0   100%   
/Network/Servers
automount -static [297]         0        0        0   100%   
/automount

So your file(s) may be in /dev/disk1s6 as the first user-accessible
slice. You can't mount the whole disk as unless it only has one
partition: Apple reserves some space for their meta-info so you rarely
get a slice numbered lower than 6.

I'm not sure how your data will appear on the disk even if you can
mount it. I would guess somewhere in the System Folder but it could
also be an invisible file in the same folder as the software you used
to create it.

One idea: you can create a mountable read only image of the disk using
the hdiutil tools in OS X, again assuming you can successfully mount
the disk. man hdiutil for the particulars. Then you have the disk's
contents as a file.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy