To manually add a drive to a Solaris system, the vfstab file must be edited. The columns are tab delimited so if you manually edit this file, make sure to use tab and spaces to separate the columns. The file is located in /etc/ and contains the following header.
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
Notice the 'mount at boot' column? To automount a drive that option must exist and be entered as yes. If the option is entered as no, the drive will NOT automount, but you can use the command mount or mountall to mount the drive at a later time.
The first two device columns will exist in /dev/ only if a drive has been formatted, installed correctly and a reconfigure boot (boot -r) has been completed.
The device path comes in two types; the dsk or character device and the rdsk or raw device. Each identifies the hard drive using what is sometimes called the ctd number or ctd path. The c# is the controller id, the t# (not shown in the example) is the target id, the d# is the device id, and s# is the specific slice (partition) to be mounted.
You will never use slice 2 to mount a drive as that is the backup slice which represents the entire drive and is not a true slice. You can view the slices of a drive using the format command. First select the drive number, then p for partition, then p for print. This will not make any changes to the drive and will display the current partition as in this example;
Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 1451 2.00GB (1452/0/0) 4194828 1 swap wu 1452 - 7259 8.00GB (5808/0/0) 16779312 2 backup wm 0 - 24619 33.92GB (24620/0/0) 71127180 3 var wm 7260 - 10163 4.00GB (2904/0/0) 8389656 4 usr wm 10164 - 23230 18.00GB (13067/0/0) 37750563 5 unassigned wm 0 0 (0/0/0) 0 6 - wu 0 - 24619 33.92GB (24620/0/0) 71127180 7 - wu 24619 - 24619 1.41MB (1/0/0) 2889
In the example above, note the Cylinders column. Partition 2, the backup partition, contains cylinders 0 - 24619, all the available cylinders on the drive. This drive has been partitioned into smaller slices, typical of a root drive and each slice shows the cylinders being used. These cylinders must not overlap. Partition 0 uses cylinders 0 - 1451 and partition 2 uses 1452 - 7259.
A drive can be created with overlapping cylinders, mounted and used. However, when files are written in the area of the overlapping cylinders severe problems and data loss will occur.
To mount all the available slices on this drive, a vfstab entry must be included for each slice. To mount all the slices on this drive, there must be a vfstab entry for slices 0,1,3, and 4. Slice 7 represents unused cylinders. Sometimes, cylinders are reserved to grow partitions later, in this case the extra cylinders have been wasted.
NOTES:
- Additional drives can be added with all the cylinders combined on one slice, usually slice 6, then only one vfstab entry is needed to mount the entire drive.
- CAUTION: Make sure to read the man pages on both vfstab and mount before using them. Also, make sure to keep a backup copy of your working vfstab, both in the /etc/ directory and on another system, before making any changes. You should also have a boot cd handy just in case there are problems. A bad vfstab can cause severe problems. I don't think you can lose any data unless you mess with the FS type column, but it is always good to have a backup of your data.
- All the options in the vfstab are required except the mount options column and that the # sign causes the lines to be ignored just as in a shell script.
- Using a file system manager like Veritas, will automatically edit the vfstab file and leave entries such as: #NOTE: volume rootvol (/) encapsulated partition c0t0d0s0
- The tag entries are mostly irrelevant. They do not effect how the slice operates.
No comments:
Post a Comment