l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2008 Mar 03 10:34

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] backing up the master boot record
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] backing up the master boot record

On Tue, 19 Jun 2001, Peter Jay Salzman wrote:

> begin: Mister Resistor <xxxxxx@uiuc.edu> quote
> > 
> > On Tue, 19 Jun 2001, Peter Jay Salzman wrote:
> > 
> > > > > what is a block?
> > > >
> > > > Probably the equivalent of a sector.  Read the man pages. :-)
> > >
> > > i'd be glad to if you could tell me which man page to read...  :)
> > 
> > Hmm.  I guess the man page assumes people know the terminology.
> > 
> > Well, in this case - rtfsc - read the f'in source code. ;)
> read the source code for a program that reads raw data from an arbitrary
> block device on a level BELOW the filesystem abstraction?

This response is a little odd, Pete.


man read
man write

dd does not care about filesystems... Unix presents all files (extracted
from filesystems) and devices as streams of bytes.  The only difference
between applying dd to a device or to a file is the amount of complication
in the code between your code and the device, and that is purposely hidden
from you by device drivers stacked on device drivers, such that
_everything_ looks like a stream of bytes.

Ignoring permissions, the code that supports device 3 will give you access
to any byte on the hard disk if given a minor number of zero (/dev/hda),
but will automatically interpret the partition table to give you access to
one contiguous subset of the hard disk data if given a 1
(/dev/hda1).  This driver deals with the mapping from tracks, sectors, and
all the rest.

The virtual filesystem does yet another transformation of the coordinates
for accessing bytes on the device, in which a fairly complicated data
structure is maintained on the hard disk that allows chunks of data to be
allocated all around the disk but be viewed, again, as nothing more than a
contiguous stream of bytes.

In all cases, the "read" and "write" kernel calls allow you to read and
write a certain number of bytes in what looks like a file.  Depending on
how the driver is written, it could fail if you don't specify an amount of
data it can handle... but I think most drivers written these days avoid
such arbitrary restrictions.

Conceptually, dd is a very simple program.  It just gives you command line
control of read and write calls in a data transfer.  While there are
probably complexities in it that I don't know about, the task dd tackles
is pretty simple.


Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.