|
|
|
||||||||||||||||||||||||||||||||||||
|
Unix FAQ Menu |
Question Subject: Disks Configuration
Diego Answer.All the disks (filesystems and swap areas) that Solaris already knows about are listed in the file /etc/vfstab. Under Linux and other Unix variants this file is /etc/fstab. vfstab/fstab is covered in the companion faq Installing a new disk under Solaris - /etc/vfstab The commands you will need to use are format(8), fsck(8) and mount(8). This FAQ assumes you are familar with the concepts and terms outlined in The Unix filesystem explained If you are familar with DOS/Windows, then the following table comparing the various commands may assist you in understanding Unix procedures;
Not in this FAQThis FAQ does not go into detail about Volume Managers and RAID systems. Much of what is here is applicable however. Many RAID systems provide their own tools that replace the functionality provided by format(8). These tools should always be used instead of format when appropriate. Some hardware RAID systems (E.g EMC) make several physical disks appear as one to the operating system. FormatThe primary use of format(1M) is to "label" and partition
disks. When you run format it will scan all active SCSI buses for fixed
drives, E.g; [ Type Control-D to exit format.]
Format normally displays 2 lines for each disk. The first line contains
the device name (under /dev/dsk, /dev/rdsk) and the "disk label".
The second line is the devpath to the device - of limited interest. Disk label The label is a propriety format so a disk from a different operating
system needs to be relabeled prior to use. If the first line from format
includes the word "unknown" then that disk has not yet been
labelled. All disks supplied by Sun are pre-labeled. Under Solaris the
disk label also includes the partitioning information of the disk. Partitioning partition> p Current partition table (original): Total disk cylinders available: 2036 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 101 50.20MB (102/0/0) 102816 1 swap wu 102 - 305 100.41MB (204/0/0) 205632 2 backup wm 0 - 2035 1002.09MB (2036/0/0) 2052288 3 usr wm 306 - 1829 750.09MB (1524/0/0) 1536192 4 var wm 1830 - 2033 100.41MB (204/0/0) 205632 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 A partition is also known as a "slice" - the slice is the number
after the "s" character in a full disk device specification.
For example a vfstab entry looks like this; If you do re-partition a disk you should note that it is quite possible
to create overlapping partitions. In general this is a very BAD idea,
and will likely cause file system corruption and data loss at some point
in the future. Fsck - checking filesystems Fsck is used to check the integrity of filesystems. You can also use it to find out whether your partitions have existing filesystems / data. It is not used to check the functions of disks - under Solaris use Format for that. When you run fsck normally it will check all the various filesystem structures, and try to correct problems it finds. The output of a normal fsck on a clean filesystem looks like this; sun# fsck /opt If you run fsck on a partition that does not have a filesystem, it will
fail quickly and cleanly.
sun# fsck -n /dev/rdsk/c0t0d0s1 ** /dev/rdsk/c0t1d0s1 (NO WRITE) If you get this error on a partition you are sure has a filesystem, then be aware that it is corrupted. You may be able to retrieve most of the filesystem by using alternate block numbers - see Using Alternate Super blocks for more details. Important: Fsck should normally only be run on unmounted filesystems. If fsck runs and makes modifications to a live filesystem there will be dire effects - most likely the system will crash. For more information about fsck, see the companion FAQ - The Ins and Outs of Fsck. Filesystems - "How to mount
a disk" There is nothing special about "/mnt" it's just an empty directory.
You can create a new mountpoint simply with "mkdir ..."
More about mountpoints. Tips and Tricks # fsck -n /dev/rdsk/c0t1d0s7 ** /dev/rdsk/c0t1d0s7 ** Last Mounted on /data ** Phase 1 - Check Blocks and Sizes .... Whilst not a complete solution (you won't get the mount options) this
trick may help you get your system to a point where you can at least restore
vfstab from backup.
For more information on the topics
and commands touched on in this page see
Installing a new disk under Solaris FeedbackI hope you found this FAQ to be of some use. It would be most helpful if you
could rate it below. All fields are optional...
|
||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||