On 05-Jan-99 Jayatheerthan Venkatramanan wrote:
> hi,
> i have got a system with win95(hda1) and linux(hda5). i didnt mount the win95
> partition. but i was fiddling with /dev directory as root. at one point of
> time i redirected ls to /dev/hda1. because of that the win95 partition got
> corrupted and was not getting booted.
> 
> my question is:
>     when i havent mounted the win95 partition, how is it that that partition
> is accessible?

The partition is _always_ accessible to the root user. If you did not mount the
partition, the partition will only be accessed as a single large file.

For example, if your win95 partition (/dev/hda1) is a 500 Mb partition,
"/dev/hda1" can be accessed as a single 500 Mb file. You can read from it,
modify it, even open it up in an editor. It is however, difficult and
inconvenient to access the partition is such a manner. As such, we would
normally use a file system to organize the partition.

When a partition is mounted, the system will read the file system information
stored in the partition's header and use it to present the data on the
partition in the form of directories and files.

>     how /dev/file is related to the device when not mounted?

The /dev/files are associated with either hardware devices such as a hard disk
or a serial port, or it's associated with a software device such as a network
interface or the watch dog service. The relationship between the /dev/files and
their respective hardware device is not affected by their mount status.

The following shows the relation between some common device files and the
hardware.

        /dev/hda        Master on IDE controller 1
        /dev/hdb        Slave on IDE controller 1
        /dev/hdc        Master on IDE controller 2
        /dev/hda1       First partition on /dev/hda
        /dev/hda2       Second partition on /dev/hda

When using the /dev/hd? devices, you will access the entire hardware device
(eg. the full 2 Gb of a 2 Gb hard disk). But when accessing the partitions,
you will only access the full size of the partition (eg. a 500 Mb partition in
a 2 Gb hard disk).

Cort
[EMAIL PROTECTED]

Reply via email to