[EdCert previous] [EdCert next] [EdCert top]

Adding Disks under IRIX

Once the disk has been physically installed and the machine has been rebooted, the hinv command can be used to check if it is recognized:


# hinv | grep Disk
Disk drive: unit 5 on SCSI controller 0
Disk drive: unit 1 on SCSI controller 0

Under IRIX, device nodes are in the format /dev/[r]dsk/dksSdDsS, where S is the disk controller number, D is the SCSI ID of the disk, and S is the partition number. In our example, we'll be working with the disk on SCSI ID 5, so we will use /dev/[r]dsk/dks0d5s*.

Labeling the Disk

The fx command is used to label and partition the disk. It should be invoked in expert mode, using the -x option:


edcert23 2# fx -x
fx version 5.3, Oct 18, 1994
fx: "device-name" = (dksc) 
fx: ctlr# = (0) 
fx: drive# = (1) 5
...opening dksc(0,5,)
...controller test...OK
Scsi drive type == HP      C3724S          5153
fx: Warning:  no sgilabel on disk
fx: Warning:  can't read sgilabel on disk
 
creating new sgilabel
  
----- please choose one (? for help, .. to quit this menu)-----
[exi]t               [d]ebug/             [l]abel/
[b]adblock/          [exe]rcise/          [r]epartition/
fx>
Since this is a new disk, fx gives a warning that it is not yet labeled with an SGI disk label. The label submenu is used to put a new label on the disk:

----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> label
 
----- please choose one (? for help, .. to quit this menu)-----
[sh]ow/         [sy]nc          [se]t/          [c]reate/
fx/label> create
 
----- please choose one (? for help, .. to quit this menu)-----
[p]artitions   [s]giinfo      [b]ootinfo     [d]irectory    [a]ll
fx/label/create> all
 
...creating default bootinfo
...creating default partitions
...creating default sgiinfo
...creating default volume directory
 
----- please choose one (? for help, .. to quit this menu)-----
[p]artitions   [s]giinfo      [b]ootinfo     [d]irectory    [a]ll
fx/label/create> ..
 
----- please choose one (? for help, .. to quit this menu)-----
[sh]ow/         [sy]nc          [se]t/          [c]reate/
fx/label> ..
 
----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> exit
 
label info has changed for disk dksc(0,5,).  write out changes? (yes) yes

Partitioning the Disk

To partition the disk, the partition submenu is entered:


fx> repartition
  
----- partitions-----
part  type       cyls             blocks          Megabytes   (base+size)
  0: efs        4 + 73         2800 + 51100         1 + 25   
  1: raw       77 + 117       53900 + 81900        26 + 40   
  8: volhdr     0 + 4             0 + 2800          0 + 1    
 10: volume     0 + 3363          0 + 2354100       0 + 1149 
 
capacity is 2354660 blocks
 
----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive           [o]ptiondrive         [e]xpert
[u]srrootdrive        [re]size
fx/repartition>

To create new partitions, enter expert mode. In this case, two similar-sized partitions will be created:


fx/repartition> expert
 
Warning: you will need to re-install all software and restore user data
from backups after changing the partition layout.  Changing partitions
will cause all data on the drive to be lost.  Be sure you have the drive
backed up if it contains any user data.  Continue? yes
Enter .. when done
fx/repartition/expert: change partition = (0) <RETURN>
before:  type efs       base:     4 cyls,    2800 blks,    1 Mb
                         len:    73 cyls,   51100 blks,   25 Mb
fx/repartition/expert: partition type = (efs) <RETURN>
fx/repartition/expert: base cyl = (4) <RETURN>
fx/repartition/expert: number of cyls (max 3359) = (73) 1675
 after:  type efs       base:     4 cyls,    2800 blks,    1 Mb
                         len:  1675 cyls, 1172500 blks,  573 Mb
fx/repartition/expert: change partition = (1) <RETURN>
before:  type raw       base:    77 cyls,   53900 blks,   26 Mb
                         len:   117 cyls,   81900 blks,   40 Mb
fx/repartition/expert: partition type = (raw)efs
fx/repartition/expert: base cyl = (77) 1679
fx/repartition/expert: number of cyls (max 1684) = (117) 1684
 after:  type efs       base:  1679 cyls, 1175300 blks,  574 Mb
                         len:  1684 cyls, 1178800 blks,  576 Mb
fx/repartition/expert: change partition = (6) ..
 
----- partitions-----
part  type       cyls             blocks          Megabytes   (base+size)
  0: efs        4 + 1675       2800 + 1172500       1 + 573  
  1: efs     1679 + 1684    1175300 + 1178800     574 + 576  
  8: volhdr     0 + 4             0 + 2800          0 + 1    
 10: volume     0 + 3363          0 + 2354100       0 + 1149 
 
capacity is 2354660 blocks
 
----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive           [o]ptiondrive         [e]xpert
[u]srrootdrive        [re]size
fx/repartition> ..
 
----- please choose one (? for help, .. to quit this menu)-----
[exi]t             [d]ebug/           [l]abel/           [a]uto
[b]adblock/        [exe]rcise/        [r]epartition/     [f]ormat
fx> exit
 
label info has changed for disk dksc(0,5,).  write out changes? (yes) <RETURN>
The partition table can also be viewed using the prtvtoc command:

edcert23 10# prtvtoc /dev/rdsk/dks0d5s0
* /dev/rdsk/dks0d5s0 (bootfile "/unix")
*     512 bytes/sector
*     140 sectors/track
*       5 tracks/cylinder
*    3363 cylinders
*       4 cylinders occupied by header
*    3359 accessible cylinders
*
* No space unallocated to partitions
 
Partition  Type  Fs   Start: sec   (cyl)    Size: sec    (cyl)  Mount Directory
 0          efs             2800  (   4)      1172500   (1675) 
 1          efs          1175300  (1679)      1178800   (1684) 
 8       volhdr                0  (   0)         2800   (   4) 
10       volume                0  (   0)      2354100   (3363) 

Creating New Filesystems

Once the drive has been partitioned and labeled, mkfs is used to create new filesystems on the partitions, and fsck is used to check the integrity of the new filesystem:

edcert23 11# mkfs /dev/dsk/dks0d5s0
mkfs_efs: /dev/dsk/dks0d5s0: blocks=1172500 inodes=123264
mkfs_efs: /dev/dsk/dks0d5s0: sectors=140 cgfsize=32561
mkfs_efs: /dev/dsk/dks0d5s0: cgalign=1 ialign=1 ncg=36
mkfs_efs: /dev/dsk/dks0d5s0: firstcg=289 cgisize=856
mkfs_efs: /dev/dsk/dks0d5s0: bitmap blocks=287
edcert23 12# fsck -y /dev/rdsk/dks0d5s0
 
  fsck: checking /dev/rdsk/dks0d5s0
  
  ** Phase 1 - Check Blocks and Sizes
  ** Phase 2 - Check Pathnames
  ** Phase 3 - Check Connectivity
  ** Phase 4 - Check Reference Counts
  FREE INODE COUNT WRONG IN SUPERBLK
  FIX?  yes
 
  ** Phase 5 - Check Free List 
  2 files 22 blocks 1141358 free  
  CHECKSUM WRONG IN SUPERBLK
  FIX?  yes
 
  ***** FILE SYSTEM WAS MODIFIED *****

Terms used: filesystem, partition, disk label, SCSI, SCSI ID



[EdCert previous] [EdCert next] [EdCert top]