Mount a disk image
Watch / mount
Filmed on the Apple IIe 80-column display. The same session on the Videx UltraTerm: same keys, same text.
The Videx UltraTerm was an 80-column video card for the Apple IIe, with its own video memory and character generator, real hardware scrolling and more screen modes than the IIe's own 80 columns. This demo runs on either display; the UltraTerm film shows the original Videx UltraTerm, emulated.
A disk image is just a file. mount attaches it as a block device and its volume appears under /mnt, where it can be listed, read and copied from like any disk. umount lets it go and the volume is gone again.
What it types
Everything it types, in order. A line starting with $ is a command at the shell, RET included; keys lines are single keystrokes to a program (RET, ESC and the control keys are named).
$ cd /tmp $ mount $ mount /mnt/MAUX/DISKS/GAME.PO $ mount $ ls /mnt/GAME $ cat /mnt/GAME/README $ cp /mnt/GAME/NOTES here $ umount /mnt/GAME $ mount $ cat here
Between steps it presses ^L to clear the screen.
What the captions say
- A disk image is just a file. What is mounted now?
- mount GAME.PO attaches it as a block device.
- Its volume is just another directory. List it, read it.
- Copy a file out to the boot disk, then let the image go.
- Two volumes, no second drive, and nobody swapping disks.
The gate that proves it
This film is made by site/demos/mount.py. Run as assertions, the
same file is make check-demo-mount, and it runs with the rest of the tests. It requires that only the boot disk is mounted at first, that the image then appears as a second device mounted at its volume name, that ls shows exactly the files the image was built with, that a copy made from it survives umount, and that afterwards the boot disk is alone again. The checks themselves were tested: with mount replaced by a copy of true the demo fails at "only the boot disk is mounted"; with umount replaced by true it fails at "back to the boot disk alone"; with cp replaced by cat it fails at "cp prints nothing".
Transcript
The screen at every checkpoint the test checks, as the recorder saved it:
== host: the files the demo names are the builder's (t=0.0 s) $ == host: the image file holds a volume named GAME (t=0.0 s) $ == mount before (t=7.9 s) $ cd /tmp $ mount /dev/s7d1 on /mnt/MAUX $ == only the boot disk is mounted (t=7.9 s) $ cd /tmp $ mount /dev/s7d1 on /mnt/MAUX $ == mount attaches the image silently (t=18.8 s) $ cd /tmp $ mount /dev/s7d1 on /mnt/MAUX $ mount /mnt/MAUX/DISKS/GAME.PO $ == mount after (t=20.2 s) $ cd /tmp $ mount /dev/s7d1 on /mnt/MAUX $ mount /mnt/MAUX/DISKS/GAME.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/GAME $ == the image is now a second device, mounted as /mnt/GAME (t=20.2 s) $ cd /tmp $ mount /dev/s7d1 on /mnt/MAUX $ mount /mnt/MAUX/DISKS/GAME.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/GAME $ == ls (t=30.1 s) $ ls /mnt/GAME NOTES README $ == ls shows exactly the files the image was built with (t=30.1 s) $ ls /mnt/GAME NOTES README $ == cat reads the file out of the image (t=33.7 s) $ ls /mnt/GAME NOTES README $ cat /mnt/GAME/README GAME is a disk image that lives inside a file. mount attached it as a block device; umount lets it go. $ == cp prints nothing (t=45.1 s) $ cp /mnt/GAME/NOTES here $ == umount detaches silently (t=48.1 s) $ cp /mnt/GAME/NOTES here $ umount /mnt/GAME $ == back to the boot disk alone (t=49.6 s) $ cp /mnt/GAME/NOTES here $ umount /mnt/GAME $ mount /dev/s7d1 on /mnt/MAUX $ == the copy survived the image (t=51.6 s) $ cp /mnt/GAME/NOTES here $ umount /mnt/GAME $ mount /dev/s7d1 on /mnt/MAUX $ cat here one two three $