4. Type boot -r. When the system comes up, Solaris will be able to use the drive.
5. Login as root and type format. Select the new drive. The drives are listed as c(controller number), t(target id or SCSI id), d(disk number). (Example: c0t0d0.)
6. Next, type partition. Partition the drive as required. Always leave partition (or slice) 2 alone. Slice 2 represents the whole disk.
7. Type print to list the current partitions and check your work.
8. Exit out of the format command.
9. From the command prompt, create a filesystem: newfs /dev/dsk/DRIVE-ADDRESS (i.e., newfs /dev/dsk/c2t4d0s3).
10. Now make the mount point for the new filesystem: mkdir <directory-name> (i.e., mkdir /new_disk).
11. Mount the new filesystem: mount /dev/dsk/DRIVE-ADDRESS <directory-name> (i.e., mount /dev/dsk/c2t4d0s3 /new_disk).
12. Add the new entry to your /etc/vfstab file so that the filesystem will be mounted at each reboot (i.e., /dev/dsk/c2t4d0s3 /dev/rdsk/c2t4d0s3 /new_disk ufs 1 yes -).
How do I set up user disk quotas?
1. Edit the file /etc/vfstab in a text edit. For the filesystem on which you want quotas, add the word quota to the mount options:
/dev/dsk/c2t4d0s3 /dev/rdsk/c2t4d0s3 \
/new_disk ufs 1 yes quota
2. Create a file called quotas in the root of the filesystem you want to monitor:
touch /new_disk/quotas
3. Use edquota to edit the quota for a user. To edit the quota for the user Bubba:
edquota bubba
4. Set the soft and hard quotas you want for the user (in kilobytes). Do the same for inodes. Soft is the limit where a user receives a warning when he exceeds the limit. Hard is the limit where the user can no longer save files when he hits the limit. To edit the settings of a user with a soft limit of 100 MB, and a hard limit of 150 MB, with 1 inode per block:
fs /new_disk blocks (soft=102400, hard=153600) \
inodes (soft=1024, hard=1536)
5. Run quotacheck to implement the new quotas:
quotacheck /new_disk
6. To apply the same quotas out to many users, use the -p flap to edquota. For example, to push Bubbas quota out to Tom, Dick, and Harry, use the following:
edquota -p bubba tom dick harry
7. To see usage reports on quotas, use the command
quotacheck -a.
I keep getting timeout errors from Sendmail. How do I fix this?
Sometimes the default TCP/IP abort interval timeout in Solaris 2.x (2 minutes), is too short, and some programs timeout if the response is too slow. To increase this timeout period, use:
/usr/sbin/ndd -set /dev/tcp \
tcp_ip_abort_interval 600000
Units are in microseconds (600000 microseconds equals 10 minutes).
Solaris allows you to tune, tweak, set, and reset various parameters related to the TCP/IP stack while the system is running (as opposed to a kernel rebuild). ndd is used to get and set some kernel driver parameters. For example, to see which parameters the TCP driver supports, use:
ndd /dev/tcp \?
To turn IP Forwarding off, which is good to do if you have two network cards in one system and you dont want the server to route any packets between the two networks:
ndd -set /dev/ip ip_forwarding 0
Ive always heard that telnet is not secure. Why?
The biggest reason telnet is not considered secure is that it sends your password across the network in clear-text, which is really bad if you are root. To see this, use snoop. snoop is a command that puts your systems network card in promiscuous mode. By being in promiscuous mode, snoop captures all packets on you network, in either real time, or saved to a file. In real-time mode, the data flies across your screen too fast to read. To do some serious analysis, capture your network traffic to a file.
To capture data to a file, the command is:
snoop -o <filename>
To see the telnet clear-text password problem, run snoop -v -o <filename> on your Sun workstation. telnet to another server and log in. Stop your snoop command (<ctrl-c). To view the file, use snoop -v -i <filename>. You should be able to find the packet that contains your password in readable text. Do the same test using ssh and you should not find your password in the snoop output.
Im using automounter to mount my users home directories on demand (/home). Now the mounts are not working. What is the problem?
The automounter is a program that automatically does mounts and unmounts of designated NFS partitions. It has maps that list what directories it controls in this manner. Automounted directories start out unmounted, and are mounted when someone tries to access them. After a certain idle time, the automounted directory is unmounted.
There are two types of automounter maps: direct and indirect. A direct map lists a set of unrelated mount points that may be spread out across the filesystem. A complete path (i.e., /usr/local/bin or /usr/man) is listed in the map as a mount point. An indirect map sets aside a directory, and mounts everything in the map into that directory (i.e., the auto.home map sets aside /home, and everything in the auto.home map is mounted under that directory).
It is common for automounted mounts to fail because something has been put in the directory of the problem client. Make sure that the /home directory is totally empty on the client before the automounter is started.
I have a file system that is showing 100% full in df -k output. How do I find the files that filled the file system?
The best way to find the large files is to cd into the file system that is full (e.g., cd /var). Now run the du -s * command. The output of du will show the size of directories and files in 512 kb blocks. If there are no odd-looking large files in that directory, look into each directory that was listed, starting with the largest. In the case of the example (/var), /var/adm will probably be one of the largest. cd to /var/adm and do the du -s * command again to find large files, or cd to the largest directory. Keep searching. It takes some practice to find the offensive file(s).
When I ftp a file from my Windows workstation to my UNIX box the file appears corrupted. Why is this happening?
What youre probably seeing is the ^M at the end of each line. This is because the file is in DOS format and not UNIX (ISO) format. Use the dos2unix command to convert the file to UNIX format after you ftp it. You will also note that if you print UNIX ascii files to some network printers they just print out as one big line. This is because the printer expects a DOS-formatted file. To print correctly, do something like this: unix2dos <unix-file> | lp. This command converts the file to DOS and sends it to the printer.
I was editing a file (using vi) when my Linux box crashed (OK, it didnt crash, I accidentally switched off the power supply). Did I lose all of my work?
Maybe not. Try vi -r <file name>. The -r flag will restore your file in the case of a crash. If this command works, then make sure that you do a write (:w) as quickly as possible so that you dont risk losing the work again.
About the Author
Jim McKinstry is a Senior Sales Engineer for MTI Technology Corporation (www.mti.com). MTI is a leading international provider of data storage management products and services. He can be reached at: jrmckins@yahoo.com.