[Pc_Support] RE: mount -o loop question -- linear v. random access
write
Bryan J. Smith
b.j.smith at ieee.org
Sat Apr 9 17:15:58 EDT 2005
Filesystems are generally written in two ways:
- Linear
- Random Access
Linear media include tape, CD/DVD-ROM, CD/DVD-R (WORM) and others. They
are physically a "single linear track" -- tape being round over one or
two spindles, CD/DVD ROM or WORM being a "single groove" kinda like a
record (only from the inside to the out, opposite of analog). Such
media use filesystems that are streamed from a pre-allocated format, one
that is only as big as the size of the data plus meta-data. In fact,
you can even think of the ISO9660 filesystem as sort of an "archive"
itself.
Random Access media include magnetic disc, magneto-optical (MO -- CD-RW,
DVD-RW/+RW/-RAM and, to a point, even DVD+R which is not WORM/single-
groove). They have a "pie-slice-sector" type arrangement which allows
random writing. They use more traditional filesystems like DOS/NT
(FAT/NTFS), Linux (Ext2/3), etc... There is also a superset of ISO9660
for such re-write medium called Universal Device/Disc Format (UDF). The
sectors are pre-allocated -- i.e., there are "free blocks" available.
- Imaging Size and Modification
If you "image" a linear write media, which is sort of a form of archive,
it will only be the size of the actual data. This is nice because it
doesn't take up much room on the disk as the original, maximum capacity
of the media. I.e., if you make an ISO image from a CD or DVD, it won't
be the full 650-700MB or 4.7GB, respectively, but only the size of the
data.
The disadvantage is that the linear written media is very difficult to
modify. As you'll note, most "archives" can only be "added" to --
possibly with a change of a file simply being the new version added at
the end, so the first version is ignored when read. Same deal with
ISO9660, you typically add a new track or session, or possibly use some
very slow tools that "re-grow" the ISO9660 filesystem.
If you "image" a random access write media, it will image the entire
size will come over. That means all the free blocks as well as used.
If you have a 40GB media, it will be 40GB as an image, without
compression. And depending on the filesystem format, compression
doesn't always compress the free space ideally or as minimally as
possible. Now there are some tools that may only image the "used"
portions of the filesystem, which is what things like Ghost and
DriveImage do, as well as some free equivalents.
The advantage of a random access write filesystem that you can easily
modify such media. The free blocks are pre-allocated, so it is easy to
merely put data in the place of nothing. That's the advantage of pre-
allocated space.
- Universal Device/Disc Format (UDF)
UDF is designed to be the replacement for ISO9660. It was designed for
MO, but it can be used for ROM/WORM too. It supports being both a pre-
allocated/random-access-write (and even some discs, e.g., DVD-RAM, come
pre-formatted UDF), as well as pre-mastered/linear-write. That way it's
much easier to make an image like it was random-access write while
taking up less room, modify it directly, and then write it linearly like
it was pre-mastered.
Unfortunately UDF support varies in every OS. There is UDF write
support in cdrecord, but it's not perfect. And many versions of Windows
come with no UDF read support (pre-98/XP -- although there was an update
for 2000 I believe?), and virtually no version of Windows comes with UDF
write/re-write support. So it's up to your recording program, and many
lack it as well.
--
Bryan J. Smith b.j.smith at ieee.org
----------------------------------------------------------------
Community software is all about choice, choice of technology.
Unfortunately, too many Linux advocates port over the so-called
"choice" from the commercial software world, brand name marketing.
The result is false assumptions, failure to focus on the real
technical similarities, but loyalty to blind vendor alignments.
More information about the Pc_support
mailing list