Juniper: Using or replacing Compact Flash

Notes on using and / or replacing compact flash in a Juniper router. This was cut from some email somwhere.

dd if=/dev/zero of=/dev/rad3 bs=64k
disklabel -w -r ad3 auto
newfs /dev/rad3c
mount /dev/ad3c /mnt
(then copy files over)
root@R3% dd if=/dev/zero of=/dev/rad3 bs=64k
dd: /dev/rad3: end of device
1961+0 records in
1960+0 records out
128450560 bytes transferred in 127.336640 secs
(1008748 bytes/sec)
root@R3% disklabel -w -r ad3 auto
root@R3% newfs /dev/rad3c
Warning: 3072 sector(s) in last cylinder unallocated
/dev/rad3c: 250880 sectors in 62 cylinders of 1tracks, 4096 sectors
122.5MB in 4 cyl groups (16 c/g, 32.00MB/g, 7616 i/g)
super-block backups (for fsck -b #) at:
32, 65568, 131104, 196640
root@R3% mount /dev/ad3c /mnt
root@R3% cli show sys stora
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 77M 35M 36M 49% /
devfs 16K 16K 0B 100% /dev/
/dev/vn0 13M 13M 0B 100% /packages/mnt/jbase
/dev/vn1 41M 41M 0B 100% /packages/mnt/jkernel-7.0R2.7
/dev/vn2 7.4M 7.4M 0B 100% /packages/mnt/jpfe-M10-7.0R2.7
/dev/vn3 2.1M 2.1M 0B 100% /packages/mnt/jdocs-7.0R2.7
/dev/vn4 15M 15M 0B 100% /packages/mnt/jroute-7.0R2.7
/dev/vn5 4.8M 4.8M 0B 100% /packages/mnt/jcrypto-7.0R2.7
mfs:172 1.5G 6.0K 1.3G 0% /tmp
/dev/ad0s1e 12M 5.0K 11M 0% /config
procfs 4.0K 4.0K 0B 100% /proc
/dev/ad1s1f 9.4G 1.8G 6.8G 21% /var
/dev/ad3c 119M 1.0K 109M 0% /mnt

Here you can see that the pcmcia is labled as /dev/ad3c. To actually view the contents you would need to look at the mount point or ls-l /mnt.