Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My external USB drive failed. I made a .dmg image file of the drive using disk utility. Later I was not able to mount the .dmg image. I used terminal

hdiutil attach -noverify -nomount name.dmg
diskutil list
diskutil mountDisk /dev/disk4

then received the following message:

Volume(s) mounted successfully

However, I cant see the drive or access its contents through Finder. Disk Utility shows the drive as ghost but I still cant mount it using diskutility. Terminal tells me that the drive is mounted and constantly shows it in the diskutil list.

pwd is not the mounted .dmg image. I don't know how to enter into the mounted image drive to see its contents. So in case what I said sounds like I see the files in the mounted image no this is not the case. I do not know how to access or even change the pwd within Terminal. I was hoping to see the mounted drive through Finder but I do not see that.

So I need help as to how to find a way to access the mounted image drive if it was really mounted.

Terminal says that it was and it shows it under diskutil list as a /dev/disk4.

Can someone please help me access the files on this drive?

share|improve this question
    
What can you see in Terminal if you do a simple ls -la? –  user3463 Sep 16 '12 at 17:42
    
If it's showing as mounted, it'll be under /Volumes. –  user3463 Sep 16 '12 at 18:39
    
what is the command line to change pwd to /Volumes? how do I look it up? Can I browse through it and see files and copy them (if I see them) into another directory within Terminal? Thank you. –  A. O. Sep 16 '12 at 19:32
    
Use cd to change the directory. Use ls to list the content of a directory. Use cp to copy files. –  Ansgar Wiechers Sep 16 '12 at 19:36

4 Answers 4

Thanks to @slhck, I was able to see that actually my disk image was not mounted. His assistance helped me confirm that.

Initially I carried out these commands to overcome a no mountable files error:

hdiutil attach -noverify -nomount name.dmg
diskutil list
diskutil mountDisk /dev/disk4

then received the following message:

Volume(s) mounted successfully

This apparently did not work. So there were no files for me to browse through. Here is what I did to solve my main and 1st problem.

I see that in other posts in this site some suggested that we should convert name.dmg to writable file to overcome a no mountable files error in a name.dmg file.

I used the command from Terminal to convert but was not successful. Instead, I used Disk Utility, attached the Volume (yes I got the same message again, "no mountable system files") however, Disk Utility nevertheless attached the image, which I was able to do before anyways.

This time, I selected it and then clicked New image, and then selected Image Format » Read/Write, not the compressed option.

I created a new image. This time this image was writable however, it still would not mount using -noverify -nomount. However, this time I was able to scan it with Disk Drill with exact file locations and folder hierarchy as I had. Recovering all from thereon was a breeze.

Just remember: when you create new image of an attached volume and don't choose Compressed but Read/Write, you need to have a disk with exact amount of space that totals the total space allocated within that name.dmg file – not the amount of space the data takes.

Mine was huge, and luckily I had an external disk with enough space to do that and it took about 5 hours for about 400 GB of disk allocation. I have all my files now. Thank you all.

share|improve this answer

Open DiskUtility and go to the Images menu and select Convert…

Choose the unmountable DMG image and convert it to a read/write image or a DVD/CD master.

After ends you can mount it.

share|improve this answer

If the partition table or the file system is corrupt, you will not be able to mount the paritition(s). You will need data recovery software to read the contents.

If you're able to attach the image, you should see new devices show up under /dev. Since you used -nomount, they will not be automatically mounted.

share|improve this answer

First of all, if you use the -nomount option, like the name says, your image simply will not mount automatically. A disk in /dev is nothing you can browse or show in Finder. Thus, use:

hdiutil attach -noverify name.dmg

Now, your disk image is attached as a drive to /dev and this drive is mounted under /Volumes/, which you can access either through Finder and pressing C – or by opening a Terminal and then entering the following:

cd /Volumes/name
ls -l

Otherwise, if your disk isn't called name, you can enter the path and press Tab twice.

cd /Volumes/TabTab

This will show you a list of possible names. Just enter the correct one after /Volumes/.

share|improve this answer
    
Thank you. These are great suggestions and were very helpful. I figured out that although Terminal told me it was mounted, it just was not. 1st problem I had was no mountable files error. I thought I fixed that but then I did not see it as I looked within the Volumes as you suggested. I had a different solution which I posted under my edit to my question. Thank you very much again. Your answer was very helpful and made me realize first fix I did was not helping me. –  A. O. Sep 20 '12 at 17:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.