• Welcome to the new Mac-Forums. See News and Community Announcements for more details.

Trying to writing .img file to a Compact Flash

Joined
Dec 24, 2004
Messages
75
Reaction score
0
Points
6
Location
Albuquerque
Your Mac's Specs
Macbook Pro 17" Quad i7, MacMini Quad i7 , 16gb ram on both. IPad 4th Gen. IPhone 4S
Hi All,

Using a Powerbook and OS X.3.8.

Trying to write the monowall (firewall) image to a Compact Flash card. The example given on their web site is for Freebsd, shown below.

=================================
http://m0n0.ch/wall/installation_generic.php

gzcat generic-pc-xxx.img | dd of=/dev/rad[n] bs=16k

where n = the ad device number of your CF card (check dmesg)
=================================

The Compact Flash card mounts under OS X as
/dev/disk1s1 122M 18K 122M 0% /Volumes/NO NAME

Do you write when the drive is mounted; If so, I always get drive busy error?

gzcat net48xx-1.11.img |dd of=/dev/disk1s1 bs=16k


Any ideas on what I'm doing wrong!

Thanks,

Joe
 
Joined
Dec 24, 2004
Messages
75
Reaction score
0
Points
6
Location
Albuquerque
Your Mac's Specs
Macbook Pro 17" Quad i7, MacMini Quad i7 , 16gb ram on both. IPad 4th Gen. IPhone 4S
Disreguard this post, dd did not work as that is a gz compress image.


Ok maybe I just don't understand the gzcat command.

I just did dd if=net48xx-1.11.img of=/dev/disk1s1 bs=16 and it seemed to work. What is the differance in using the gzcat command or doing the dd command I used above?

Thanks,

joe
 
Joined
Dec 24, 2004
Messages
75
Reaction score
0
Points
6
Location
Albuquerque
Your Mac's Specs
Macbook Pro 17" Quad i7, MacMini Quad i7 , 16gb ram on both. IPad 4th Gen. IPhone 4S
Ok, I shouldn't try writing while device is mounted, but /dev/disk1s1 device cannot be found when the device is not mounted. So, how do I tell what the raw device path is on OS X?

Any Thoughts?

Thanks,

Joe
 
Joined
Dec 24, 2004
Messages
75
Reaction score
0
Points
6
Location
Albuquerque
Your Mac's Specs
Macbook Pro 17" Quad i7, MacMini Quad i7 , 16gb ram on both. IPad 4th Gen. IPhone 4S
Hi All,

Ok, figured this out. Since so many have viewed this, I'll post the solution.

If you go to /dev directory and do a 'ls' you will see a list of all your devices. The devices I was interested in are the 'raw' devices. While no extra devices are plugged in to my laptop, the only raw devices I see are the ones associated with my hard drive, which is mounted under /dev/disk0s5. RAW disk listed below:
rdisk0
rdisk0s1
rdisk0s2
rdisk0s3
rdisk0s4
rdisk0s5

Now if I plug in some other external drive, such as a Compact Flash card and after the drive mounts under /dev/disk2s1 , re-run that 'ls' command I should see some new "raw" devices.

rdisk2
rdisk2s1

Then while drive is mounted I'll write the image to raw disk, rdisk2s1, (not the mounted disk /dev/disk2s1) as in the example below. Some Unix versions require the drive to be unmounted, but not here.

gzcat net48xx-1.11.img |dd of=/dev/rdisk2s1 bs=16k

Output looks like:
gzcat: net48xx-1.11.img: decompression OK, trailing garbage ignored
0+768 records in
0+768 records out
6291456 bytes transferred in 12.971943 secs (485005 bytes/sec)

I'm surprised one of you Darwin guru's couldn't help with that, I had to ask a Sun Microsystems guru for help; THE SHAME, THE SHAME :(

Later All,

Joe


gunnerjoe said:
Ok, I shouldn't try writing while device is mounted, but /dev/disk1s1 device cannot be found when the device is not mounted. So, how do I tell what the raw device path is on OS X?

Any Thoughts?

Thanks,

Joe
 
Top