• Aucun résultat trouvé

Installing a Unix disk

Dans le document and System Administration (Page 136-139)

Host management

4.5 Installing a Unix disk

Adding a new disk or device to a Unix-like host involves some planning. The first concern is what type of hard-disk. There are several types of disk interface used for communicating with hard-disks.

ATA/IDE disks: ATA devices have suffered from a number of limitations in data capacity and number of disks per controller. However, most of these barriers have been broken with new addressing systems and programming techniques. Both parallel (old ribbon cables) and serial interfaces now exist.

SCSI disks:The SCSI interface can be used for devices other than disks too.

It is better than IDE at multitasking. The original SCSI interface was limited to 7 devices in total per interface. Wide SCSI can deal with 14 disks. See also the notes in chapter 2.

IEEE 1394 disks: Implementations include Sony’s iLink and Apple Com-puter’s FireWire brandnames. These disks use a superior technology (some claim) but have found limited acceptance due to their expense.

In order to connect a new disk to a Unix host, we have to power down the system.

Here is a typical checklist for adding a SCSI disk to a Unix system.

• Power down the computer.

• Connect disk and terminate SCSI chain with proper terminator.

• Set the SCSI id of the disk so that it does not coincide with any other disks.

On Solaris hosts, SCSI id 6 of controller zero is typically reserved for the primary CD-ROM drive.

• On SUN machines one can use the ROM command probe-scsi from the monitor (or probe-scsi-all, if there are several disk interfaces) to probe the system for disks, This shows which disks are found on the bus. It can be useful for trouble-shooting bad connections, or accidentally overlapping disk IDs etc.

• Partition and label the disk. Update the defect list.

• Edit the /etc/fstab filesystem table or equivalent to mount the disk. See also next section.

4.5.1 mount and umount

To make a disk partition appear as part of the file tree it has to be mounted.

We say that a particular filesystem is mounted on a directory or mountpoint. The command mountmounts filesystems defined in the filesystem table file. This is a file which holds data for mount to read.

The filesystem table has different names on different implementations of Unix.

Solaris 1 (SunOS) /etc/fstab Solaris 2 /etc/vfstab

HPUX /etc/checklist or /etc/fstab

AIX /etc/filesystems

IRIX /etc/fstab

ULTRIX /etc/fstab

OSF1 /etc/fstab

GNU/Linux /etc/fstab

These files also have different syntax on different machines, which can be found in the manual pages. The syntax of the command is

mount filesystem directory type (options)

There are two main types of filesystem – a disk filesystem (called ufs, hfs etc.) (which means a physical disk) and the NFS network filesystem. If we mount a 4.2 filesystem it means that it is, by definition, a local disk on our system and is described by some logical device name like/dev/something. If we mount an NFS filesystem, we must specify the name of the filesystem and the name of the host to which the physical disk is attached.

Here are some examples, using the SunOS filesystem list above:

mount -a # mount all in fstab

mount -at nfs # mount all in fstab which are type nfs mount -at 4.2 # mount all in fstab which are type 4.2

mount /var/spool/mail # mount only this fs with options given in fstab (The-toption does not work on all Unix implementations.) Of course, we can type the commands manually too, if there is no entry in the filesystem table. For exam-ple, to mount an nfs filesystem on machine ‘wigner’ called/site/wigner/local so that it appears in our filesystem at/mounted/wigner, we would write

mount wigner:/site/wigner/local /mounted/wigner

The directory /mounted/wigner must exist for this to work. If it contains files, then these files will no longer be visible when the filesystem is mounted on top of it, but they are not destroyed. Indeed, if we then unmount using

umount /mounted/wigner

(the spelling umount is correct) then the files will reappear again. Some imple-mentations of NFS allow filesystems to be merged at the same mount point, so that the user sees a mixture of all the filesystems mounted at the same point.

4.5.2 Disk partition device names

The convention for naming disk devices in BSD and system 5 Unix differs. Let us take SCSI disks as an example. Under BSD, the SCSI disks have names according to the following scheme:

/dev/sd0a First partition of disk 0 of the standard disk controller. This is normally the root file system/.

/dev/sd0b Second partition of disk 0 on the standard disk controller. This is normally used for the swap area.

/dev/sd1c Third partition of disk 1 on the standard disk controller. This partition is usually reserved to span the entire disk, as a reminder of how large the disk is.

System 5 Unix employs a more complex, but also more general naming scheme.

Here is an example from Solaris 2:

/dev/dsk/c0t3d0s0 Disk controller 0, target (disk) 3, device 0, segment (partition) 0 /dev/dsk/c1t1d0s4 Disk controller 1, target (disk) 1,

device 0, segment (partition) 4

Not all systems distinguish between target and device. On many systems you will find onlytordbut not both.

Dans le document and System Administration (Page 136-139)