LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1391|回复: 1

solaris f&q

[复制链接]
发表于 2006-8-25 16:28:46 | 显示全部楼层 |阅读模式
Keywords:

    * Login
          o CDE-Login (1)
          o CDE-Login (2)
          o Login using RBAC role
          o Forgotten root password
          o Login problem as root (1)
          o Login problem as root (2)
    * Keyboard handling
          o Backspace key doesn't work
          o Command line history
          o Flushing history buffer
          o Disabling Stop-A
    * Device handling
          o Volume manager
          o Creation of device files
          o Finding out disk sizes
          o Repartitioning a disk
          o SCSI module
          o High Sierra file system (1)
          o High Sierra file system (2)
          o High Sierra file system (3)
          o File system full while making a backup
          o Mounting removable media
    * Configuration files
          o Korn shell for root
          o Can't find /etc/fstab
          o Can't find /etc/mtab
          o Can't find /etc/exports
          o Mount order of filesystems
          o Problem starting the NFS server
          o Problem starting the httpd server
          o Disabling IP-forwarding
          o How to assign a second IP address to an interface
          o Specifying the default router
          o Specifying different routers
          o Increasing the number of groups per user
          o Giving users the permission to chown
          o Increasing the number of pseudo terminals
          o Increasing the number of logical interfaces
          o Error changing the default login shell
          o How to unconfigure a system
    * Disk quotas
          o How to install disk quotas
          o How to set the same disk quotas for more than one user
          o How to influence the grace period of disk quotas
          o Who checks disk quotas?
          o How to control disk quotas
          o How to find out how much disk space the users are using
    * NIS
          o Map nicknames
    * Solstice DiskSuite
          o Solstice DiskSuite metadevice state databases (1)
          o Solstice DiskSuite metadevice state databases (2)
          o Solstice DiskSuite metadevice state databases (3)
          o Solstice DiskSuite metadevice state databases (4)
          o Solstice DiskSuite metadevice state databases (5)
          o Solstice DiskSuite metadevice state databases (6)
          o How to stripe a boot device with Solstice DiskSuite
          o Mirroring swap with Solstice DiskSuite
          o Maximum number of metadevices with Solstice DiskSuite
          o Maximum number of disk sets with Solstice DiskSuite
          o Maximum number of submirrors with Solstice DiskSuite
          o What can I metattach with Solstice DiskSuite
          o DiskSuite files disappeared after upgrading to Solaris 8
    * Solaris Volume Manager
          o Solaris Volume Manager metadevice state databases (1)
          o Solaris Volume Manager metadevice state databases (2)
          o Solaris Volume Manager metadevice state databases (3)
          o Solaris Volume Manager metadevice state databases (4)
          o Solaris Volume Manager metadevice state databases (5)
          o Solaris Volume Manager metadevice state databases (6)
          o How to stripe a boot device with Solaris Volume Manager
          o Mirroring swap with Solaris Volume Manager
          o Maximum number of metadevices with Solaris Volume Manager
          o Maximum number of disk sets with Solaris Volume Manager
          o Maximum number of submirrors with Solaris Volume Manager
          o What can I metattach with Solaris Volume Manager
    * Miscellaneous
          o Jumpstart via telnet
          o Ethernet address
          o Error running apropos
          o Making packages
          o Can't set ACLs on file
          o How to setup an anonymous ftp server

#################################################################
Login

CDE-Login (1)
#################################################################

    * Q: As superuser, I created a new user, but forgot to create his or her home directory.

I corrected my mistake by using mkdir, but now the new user can't login with CDE. After the

username and password are entered, the login screen disappeares, but reappeares after 5

seconds. Command line login works. What can I do?

    * A: Your user has a problem with permissions. For CDE login, he or she must have write

permissions for the HOME-directory. Give the permissions by executing the following

commands:

      # chown username:users_group absolute_path_of_home_directory
      # chmod 755 absolute_path_of_home_directory

#################################################################
CDE-Login (2)
#################################################################

    * Q: I tinkered with my CDE-configuration and now I'm unable to log in again.

    * A: If you don't have any idea where the problem might be, the fastest way is to log in

with a text only screen and remove the ~/.dt directory. You will loose all your CDE-

configuration, but you will be able to log in again via CDE.

#################################################################
Login using RBAC role
#################################################################

    * Q: I authorized an ordinary user to run some commands by supplying him/her with an

RBAC role. Now, the user tries to log into this role, but doesn't succeed.

    * A: RBAC roles have a profile shell by default which isn't supposed to be used as login

shell. The user has to login as ordinary user, and then switch to the role by using the su

command. One reason for this "inconvenience" is that in /etc/user_attr you specified which

user is authorized to use this role. In order to check whether the authorized user or

someone else tries to use the role, the system needs the information about who is this user

in the first place.

#################################################################
Forgotten root password
#################################################################

    * Q: As root, I forgot my password. How can I get into the system?

    * A: Boot with CD-ROM (for Solaris 8, use the CD 1 of 2), mount the boot slice and edit

the shadow file.

      ok boot cdrom -s
      # fsck /dev/rdsk/c0t0d0s0
      # mount /dev/dsk/c0t0d0s0 /a
      # TERM=sun
      # export TERM
      # vi /a/etc/shadow

      Here you have to delete the 13 characters between the first and second colon of the

root entry. Save the file, reboot and you'll be able to login without password. Set a new

one immediately.

#################################################################
Login problem as root (1)
#################################################################

    * Q: I can't log in as root via telnet, but instead I see the message: Not on system

console. Other accounts work well.

    * A: Remove or disable the entry CONSOLE=/dev/console in the target machine's

/etc/default/login and root will work, too. But remember that you're sending your password

unencrypted over the wire.

#################################################################
Login problem as root (2)
#################################################################

    * Q: After having changed the login shell for root from /sbin
/sh to /sbin/ksh in /etc/passwd, I don't seem to be able to login as root or su to root

anymore. The error message when using su is:

      su: No shell

    * A: There is no /sbin/ksh. Most of the shells reside in /bin. So, for changing the

login shell in /etc/passwd you would have to change the path, too. But changing root's login

shell in /etc/passwd isn't a good idea anyway. Better use the suggestion that you find in

Korn shell for root. For getting a working shell as root again, see the suggestion Forgotten

root password and edit /a/etc/passwd instead of /a/etc/shadow.

#################################################################
Keyboard handling

Backspace key doesn't work
#################################################################
    * Q: When I'm working on the text console or if I log into my system via telnet, my

backspace key doesn't work. Instead, I see a ^H on the screen.

    * A: You can define what your backspace key is supposed to be by using this command:

      $ stty erase ^H

      To enter the ^H, you hit your backspace key, and it will be one in the future (that

is, until you log out of this shell). If you want this feature permanently, put it into your

shell startup files.

#################################################################
Command line history
#################################################################

    * Q: Is there a chance to get access to old command lines via hot keys?

    * A: There is. But it depends on your shell.

          o Bourne shell: forget it. This shell doesn't offer this feature.
          o Korn shell: edit your ~/.profile and make sure that it contains a line that

looks like this: ENV=~/.kshrc; export ENV. Edit ~/.kshrc and decide which hot keys to use.

If you want vi-mode, the line set -o vi will do the job. If you want to use the arrow keys,

you need the following entries instead:

            set -o emacs        # enable history
            alias __A=^P        # arrow up
            alias __B=^N        # arrow down
            alias __Bignore=^O  # to reset adverse effects of ^N
            alias __C=^F        # arrow right
            alias __D=^B        # arrow left

            Be sure to specify two (!) underlines in front of the letters A, B, C and D,

respectively. To input the "careted" entities (^P), hold down the Ctrl-key and hit the

corresponding letter, e.g. p (not capitalized). What appears on the screen is ^P, and that's

what we need. You can verify if the entries are correct by trying to position the cursor

onto the caret. You shouldn't succeed. Instead, the cursor should jump past the caret.
          o bash: this shell has command line history and mapping to the arrow keys built

in.
          o other shells: there may be a command line history mechanism built into the

shell, but chances are (especially with the C-Shell) that you can't map anything to the

arrow keys.

#################################################################
Flushing history buffer
#################################################################

    * Q: How can I make my shell forget about what I typed and what is accessible via

command line history?

    * A: To make the shell forget your last commands, clear the history file:

      $ > ~/.sh_history

#################################################################
Disabling Stop-A
#################################################################

    * Q: How can I prevent anyone who is able to access my console keyboard from pressing

Stop-A? How can I prevent the system to go to the PROM prompt whenever I pull the keyboard

cable?

    * A: Use the kbd command for this. To disable Stop-A, you use the command line:

      # kbd -a disable

      To enable Stop-A, you use the command line:

      # kbd -a enable

      Starting with Solaris 7, you can make an entry in /etc/default/kbd to disable Stop-A:

      KEYBOARD_ABORT=disable

#################################################################
Device handling

Volume manager
#################################################################

    * Q: I try to write to my floppy with the command:

      $ tar cvf /dev/rdiskette .

      and get the error message:

      tar: /dev/rdiskette: Device busy

    * A: It looks like the volume manager is running. To disable it temporarily (requires

root privileges), issue:

      # /etc/init.d/volmgt stop

      Its a good idea to verify that it has disappeared:

      # ps -ef | grep vold

      To disable it permanently (requires root privileges, too), issue:

      # mv /etc/rc2.d/S92volmgt /etc/rc2.d/s92volmgt

      Note the capital letter in the first and the lower case letter in the second command

line argument.

#################################################################
Creation of device files
#################################################################

    * Q: I've connected another disk to my system and want to partition it. But format

doesn't present me the disk for selection.

    * A: You have to create device names for the disk first. There are different ways to do

this:

          o First method:

                + Shut down the system:

                  # init 5

                + Connect the new device and turn it on
                + Boot the machine with:

                  ok boot -r

          o Second method:

                + Boot the system with:

                  # reboot -- -r

            By using "--" you signal the command that whatever follows in not an option, but

an argument instead, even if it looks like an option, what "-r" does indeed. reboot hands

this argument over to the OBP boot command which, in turn, performs a boot -r.

          o Third method:

                + Create a file called /reconfigure and shut down the system:

                  # touch /reconfigure
                  # init 5

                + Connect the new device and turn it on
                + Boot the machine with:

                  ok boot

          o Fourth method (especially suited for devices already connected or for hot

swappable devices):

                + Create the files in /devices:

                  # drvconfig

                + Create the files in /dev:

                  # disks    # for disks: /dev/dsk and /dev/rdsk
                  # tapes    # for tapes: /dev/rmt

          o Fifth method (only available since Solaris 8):

                + Create all device files using one command:

                  # devfsadm

#################################################################
Finding out disk sizes
#################################################################

    * Q: How can I find out the sizes of my disks?

    * A: After having created the device names for the disks (see Creation of device files)

you can find out the sizes of your disks with different commands:

          o First method:

                + Run the command format and select the disk you want to find out the size

of
                + From the appearing format menue, select partition
                + From the appearing partition menue, select print
                + Take a look at the size of slice 2, which represents the whole disk's

capacity

          o Second method:

            Run the command prtvtoc and append the raw device name(s) from the /dev/rdsk

directory of any slice of the disk(s) whose capacity you want to find out. The specified

slice doesn't have to exist for this to do.

            Example:

            # prtvtoc /dev/rdsk/c0t1d0s2

      While the format command has the advantage of being menue driven, the prtvtoc command

has the advantages that it can be included in script files for automatic processing and that

it can tell you the sizes of more than one disk at a time (by specifying more than one raw

device's name).

#################################################################
Repartitioning a disk
#################################################################

    * Q: I repartitioned a disk with format. Do I have to reboot to take the changes effect?

    * A: No. Serious operating systems don't have to be booted regularly in order to do what

they are supposed to do.

#################################################################
SCSI module
#################################################################

    * Q: When I run modinfo, it tells me that my machine has the SCSI module loaded:

      # modinfo | grep sd
      97 1032d3bf 176d0 32 1 sd (SCSI Disk Driver 1.340)

      But my machine doesn't have a single SCSI device. Why is the driver loaded?

    * A: You have probably tried to access your CD-ROM drive. All CD-ROM drives are

addressed by the SCSI module.

#################################################################
High Sierra file system (1)
#################################################################

    * Q: What is a High Sierra filesystem?

    * A: High Sierra is a CD-ROM filesystem. You can imagine it as ISO9660 plus Rock Ridge

extensions, removing most of the annoying restrictions that ISO9660 includes (short

filenames, no case sensitivity etc.). But Rock Ridge is only an add-on. So, every High

Sierra CD-ROM is still an ISO9660 compatible one.

#################################################################
High Sierra file system (2)
#################################################################

    * Q: Is every CD-ROM filesystem a High Sierra filesystem?

    * A: No. Solaris CDs that you can boot off have at least one ufs filesystem since you

can't boot off a High Sierra filesystem anymore.

#################################################################
High Sierra file system (3)
#################################################################

    * Q: Can the High Sierra module handle ISO9660 CD-ROMs?

    * A: Yes. Since High Sierra includes ISO9660, it can.

#################################################################
File system full while making a backup
#################################################################

    * Q: When I try to backup my filesystems, it starts working, but after a short time I

get error messages saying that the root filesystem is full.

    * A: There are different reasons to consider:

          o did you remember that the tape device in System V Unices have names that look

like: /dev/rmt/0 and not /dev/rmt0 as in BSD Unices?
          o did you create the device files for the output tape device?

      In both cases, your backup command creates an ordinary file that has the name of the

tape drive and which resides on your root filesystem, filling it while it gets written to.

#################################################################
Mounting removable media
#################################################################

    * Q: I tried to attach a removable disk drive to my system and wanted to partition the

disk, but the format command either asks me lots of questions about the geometry of the

disk, or it doesn't offer me this drive for partitioning at all.

      How can I prepare a removable media cartridge for mounting and finally mount it?

    * A: Think of removable disks as you think of diskettes, only with more capacity, being

addressed by entries in the /dev/dsk and /dev/rdsk directories, respectively (e. g. /dev/

[r]dsk/c1t3d0s0) and having, by default, two partitions, slice 0 and slice 2, both of which

spanning the whole disk.

      For low level formatting and labeling the disk, use the command rmformat(1):

      # rmformat -b label -F long /dev/dsk/c1t3d0s2:c

      Using the -s option with rmformat, you can partition the disk in more than the two

slices 0 and 2. See the rmformat manual page for the necessary syntax.

      For creating a ufs file system on the disk, use the command newfs as you are used to:

      # newfs /dev/dsk/c1t3d0s2

      Alternatively, you can create a partition by using fdisk:

      # fdisk /dev/dsk/c1t3d0s2:c

      and create a pcfs file system for exchanging data with systems that don't support the

ufs file system, using the mkfs command:

      # mkfs -F pcfs /dev/dsk/c1t3d0s2:c

      You can use the volume manager to get the filesystems mounted (the entry that starts

with rmdisk in /etc/vold.conf is responsible for this), or you can mount it manually:

      # mount /dev/dsk/c1t3d0s2 /mnt

#################################################################
Configuration files

Korn shell for root
#################################################################

    * Q: I'm working as root and want to use a Korn Shell. I already changed may entry in

/etc/passwd to start /sbin/ksh for me, but now I'm even unable to log in. If I try to log in

via the text screen, I get the message: No shell.

    * A: /sbin/ksh doesn't exist. The shell that is used for root by default is /sbin/sh

which is statically linked. ksh is only available dynamically linked and resides in /bin.

So, log in as another superuser (or boot with CD) and change root's entry for the login

shell in /etc/passwd back to /sbin/sh. Then go to your /.profile and include:

      if [ -x /bin/ksh ]
      then
        SHELL=/bin/ksh
        ENV=/.kshrc
        export SHELL ENV
      fi

      Take care of the blanks. There must be blanks around the brackets, and there must not

be any blanks around the =.

      The test for the executability (and so for existence) of /bin/ksh is necessary to

confirm that /usr is mounted and /bin points to /usr/bin.

      Now log out, log in again, and you will get a Korn-Shell, whenever you open a window

via:

      "Workspace Menu" -> "Tools" -> "Terminal"

#################################################################
Can't find /etc/fstab
#################################################################

    * Q: I can't find my /etc/fstab file. How can I configure what is mounted at boot time?

    * A: BSD-Unices call this file /etc/fstab whereas System V Release 4 Unices call it

/etc/vfstab (the virtual file system table). This file has another syntax than /etc/fstab,

though. Every line ought to have 7 columns. Otherwise your machine will hang the next time

you try to boot it.

#################################################################
Can't find /etc/mtab
#################################################################

    * Q: I can't find my /etc/mtab file.

    * A: BSD-Unices call this file /etc/mtab whereas System V Release 4 Unices call it

/etc/mnttab. From Solaris 8 on, this is a filesystem.

#################################################################
Can't find /etc/exports
#################################################################

    * Q: I can't find my /etc/exports file. Do I have to create it by myself?

    * A: System V Release 4 Unices don't have an /etc/exports file, which is BSD-Unix

specific. Instead, they use /etc/dfs/dfstab, which uses the syntax of a shell script. So,

whatever you would write on the command line to export filesystems can be entered into this

file without modification.

#################################################################
Mount order of filesystems
#################################################################

    * Q: Does the order of entries in /etc/vfstab matter when I use a swapfile? That is, do

I have to issue the mount information for the filesystem that holds the swapfile before the

entry for the swapfile?

    * A: No. This is taken care of by the shell script, that activates the swap space at

boot time, /sbin/swapadd.

#################################################################
Problem starting the NFS server
#################################################################

    * Q: I've shared some directories and want to start the NFS server processes by running

/etc/init.d/nfs.server, but they don't seem to start up.

    * A: It doesn't matter what you have shared if you start the NFS daemons via the run

control script, but it is important that there are valid entries in /etc/dfs/dfstab.

#################################################################
Problem starting the httpd server
#################################################################

    * Q: I try to start the apache server httpd by running its run control script

/etc/rc3.d/S50apache, but it doesn't come up.

    * A: Go to the directory /etc/apache, copy the file httpd.conf-example to httpd.conf and

edit this copy. Find a line that reads:

      #ServerName new.host.name

      Remove the comment character and replace new.host.name with the machine's own name.

You can find this name by using the command hostname. Then try to start apache once again.

#################################################################
Disabling IP-forwarding
#################################################################

    * Q: Since I configured a second network interface, my machine outputs the message:

      Machine is a router

      while it boots. How can I disable IP-forwarding permanently?

    * A: Create a file /etc/notrouter, which may be empty. This disables IP-forwarding and

the message should have disappeared.

#################################################################
How to assign a second IP address to an interface
#################################################################

    * Q: How can I assign an interface a second IP address?

    * A: To assign an interface a second IP address temporarily, you need the ifconfig

command twice. Lets assume the interface hme0 gets the additional IP address 192.168.7.153,

creating its logical interface hme0:1. The two command lines are:

      # ifconfig hme0:1 plumb
      # ifconfig hme0:1 192.168.7.153 up

      To assign this address permanently, create a file /etc/hostname.hme0:1. This file must

contain a single line (no comments allowed here!) with the interface's name, e.g.

timeserver3. This interface name must be assigned an IP address in the file /etc/inet/hosts.

      # echo timeserver3 > /etc/hostname.hme0:1
      # echo "192.168.7.153    timeserver3" >> /etc/inet/hosts

#################################################################
Specifying the default router
#################################################################

    * Q: How can I tell my machine the name of its default router?

    * A: Create a file named /etc/defaultrouter and put the default router's name into it.

#################################################################
Specifying different routers
#################################################################

    * Q: How can I tell my machine the routers that it is supposed to use for the different

destination addresses?

    * A: Create a file named /etc/gateways and put the information into it. The syntax is:

      net destination gateway router metric hop_count

      The terms net, gateway and metric are keywords that have to be written exactly as

shown, while destination, router and hop_count are the destination net address, the router's

name and the hop count, respectively, which have to be substituted for the correct values.

Instead of net you can write host, followed by the destination host's address or name.

#################################################################
Increasing the number of groups per user
#################################################################

    * Q: How can I increase the number of secondary groups a user can be member of beyond

the default value of 16?

    * A: Make an entry in /etc/system that looks like this, which increases the number to

32, and reboot:

      set NGROUPS_MAX=32

#################################################################
Giving users the permission to chown
#################################################################

    * Q: How can I give my ordinary users the permission to change ownership of their files

using chown?

    * A: Make an entry in /etc/system that looks like this, and reboot:

      set rstchown=0

#################################################################
Increasing the number of pseudo terminals
#################################################################

    * Q: How can I increase the number of pseudo terminal device files beyond the default

value of 48 or 33, respectively?

    * A: Make an entry in /etc/system that looks like this to increase the number to 100,

and reboot:

      set pt_cnt=100
      set npty=100

#################################################################
Increasing the number of logical interfaces
#################################################################

    * Q: How can I increase the number of logical interfaces beyond the default value of

256?

    * A: Make an entry in /etc/system that looks like this to increase this value to 8192,

and reboot:

      set ip_addrs_per_if=8192

#################################################################
Error changing the default login shell
#################################################################

    * Q: I try to change the default login shell with the command:

      # useradd -D -s /bin/ksh

      but instead of changing the default shell, the system issues an error message,

complaining about a syntax error.

    * A: You cannot change the default login shell with this command. Instead, edit the file

/usr/sadm/defadduser so that the line that defines the login shell reads:

      defshell=/bin/ksh

      Notice: /usr/sadm/defadduser is only created if you ran useradd -D at least once.

#################################################################
How to unconfigure a system
#################################################################

    * Q: How can I unconfigure a system, that is, how can I make a machine forget its

configuration information like nodename, IP address, netmask etc.?

    * A: Run the command sys-unconfig and the machine will make a reset and ask the

configuration questions again that it asked when it was installed.

#################################################################
Disk quotas

How to install disk quotas
#################################################################

    * Q: How can I install disk quotas, so that my users can't use unreasonable much disk

space?

    * A: You can install disk quotas for every file system that users have write access to.

To install disk quotas for a file system, you have to create a quotas file in the top

directory of the file system, which will be found in the mount point directory if the file

system is mounted. (This is the same directory where you find the lost+found directory.)

      This quotas file stores the limits that the superuser sets for the users as well as

the bookkeeping of the space that the user is actually using.

      Let's suppose the user's home directories are on a separate file system mounted on

/export/home. To prepare the file system for disk quotas, create the quotas file and set its

permissions appropriately (this has to be done only once per file system):

      # mount /export/home
      # touch /export/home/quotas
      # chmod 600 /export/home/quotas

      Next, edit this quotas file using the edquota command, specifying the users name (e.g.

user1), whose disk space you want to limit (this has to be done for every user you want to

control):

      # EDITOR=vi
      # export EDITOR
      # edquota user1

      vi (or whatever editor's name you store in the EDITOR variable) will be started for

you, presenting you a temporary file which contains one line per found quotas file. Here you

are given the chance to specify the limits for the user. These limits can be changed later

whenever necessary. If you save this file, edquota saves your limits in the quotas file(s).

      You can specify a soft and a hard limit for the blocks and for the inodes that the

user may use. The hard limit is an upper limit that the user can never exceed (well, not

exactly. The user can exceed it only if he/she is using more blocks or inodes before the

administrator installs the disk quotas). The soft limit can be exceeded for a given time

period (default is one week).

      After having prepared and edited the quotas files, you have to do some bookkeeping,

which includes scanning the file system for the space that is already in use by your user

(s):

      # quotacheck -v /export/home

      Finally, we have to switch on quota control:

      # quotaon -v

      In order to have quota control switched on automatically whenever this file system is

mounted, include the mount option quota or rq (which stands for read and write access with

quotas on) into the 7th column of /etc/vfstab describing this file system.

#################################################################
How to set the same disk quotas for more than one user?
#################################################################

    * Q: After having specified the disk quotas for one user, how can I set the same limits

for the other users without repeating the same procedure over and over?

    * A: After having specified the disk quotas for one prototype user (let's call this user

protouser), you can save typing effort by giving this command to set the same limits for the

other users, here user otheruser:

      # edquota -p protouser otheruser

#################################################################
How to influence the grace period of disk quotas
#################################################################

    * Q: How can I influence the time period that a user is allowed to exceed his or her

soft limit?

    * A: This time period defaults to one week and can be set (albeit only on a per file

system base, that is, not for different users differently) with the command edquota -t.

#################################################################
Who checks disk quotas?
#################################################################

    * Q: Which machine is responsible for checking disk quotas, the NFS server or the NFS

client?

    * A: The NFS server takes care of disk quotas.

#################################################################
How to control disk quotas
#################################################################

    * Q: How can I find out what disk quotas are set for my users?

    * A: You see the disk quotas of your users by using the command repquota -av.

#################################################################
How to find out how much disk space the users are using
#################################################################

    * Q: How can I find out how much disk space my users are using right now?

    * A: To see how much disk space your users are using right now, use the command quot -

af. You'll get a table containing:

          o the number of kbytes used (column 1)
          o the number of inodes used (column 2)
          o the user's name (column 3)

#################################################################
NIS

Map nicknames
#################################################################

    * Q: Why is it sufficient to name a map by its source file name as in:

      $ ypmatch user1 passwd

      instead of its complete name including the key as in:

      $ ypmatch user1 passwd.byname

    * A: There is a file /var/yp/nicknames that contains abbreviations for the most

important maps. You can display the abbreviations with the command:

      $ ypwhich -x

#################################################################
Solstice DiskSuite

Solstice DiskSuite metadevice state databases (1)
#################################################################

    * Q: After having installed Solstice DiskSuite, I rebooted. Now, the system complains

about:

      metainit: there are no existing databases

      What went wrong?

    * A: Nothing. The system searches for the metadevice state databases, but doesn't find

them, because you didn't create them up to now. This is one of your first things to do when

configuring DiskSuite. Use the command metadb for this.

#################################################################
Solstice DiskSuite metadevice state databases (2)
#################################################################

    * Q: Can I place a replica of the metadevice state database into a slice that I intend

to use as a component of a metadevice or do I have to sacrifice a slice for exclusive use by

the database?

    * A: You don't have to sacrifice a slice for the database. A slice can hold a replica of

the metadevice state database and be a component of a metadevice.

      The only restrictions that are important here are:

          o the order of creating the replica and making the slice a component. You must

first create the replica and then make the slice a component.
          o you can't let the database grow afterwords

#################################################################
Solstice DiskSuite metadevice state databases (3)
#################################################################

    * Q: How does the system know where to look for the metadevice state database?

    * A: Every location of a replica is recorded in /etc/system. The system reads this file

when searching for the database replicas.

#################################################################
Solstice DiskSuite metadevice state databases (4)
#################################################################


    * Q: How many metadevice state database replicas can a machine have?

    * A: At most 50.

#################################################################
Solstice DiskSuite metadevice state databases (5)
#################################################################

    * Q: What is the default size of a metadevice state database replica?

    * A: The default size of a metadevice state database replica is 1034 blocks, that is 517

kBytes.

#################################################################
Solstice DiskSuite metadevice state databases (6)
#################################################################

    * Q: In order to enable my system to continue running after a hard disk failure, I've

mirrored my root file system with a two way mirror. Since I've got only two system disks

comprising the mirror, I distributed the metadevice state database replicas evenly among

them.

      If one of those system disks fails, the system is unable to reboot unattended to

multiuser mode because half of the metadevice state database replicas are missing, while

more than half of the replicas are necessary for this.

      Is there a way to tell the machine to reboot unattended to multiuser mode anyway in

case of a system crash?

    * A: Make an entry in /etc/system that looks like this:

      set md:mirrored_root_flag=1

#################################################################
How to stripe a boot device with Solstice DiskSuite
#################################################################

    * Q: How can I use a stripe to hold my boot or root filesystem?

    * A: You can't use a stripe to boot off. This is because in order to read a filesystem

that resides on a metadevice that can't be read like an ordinary slice can, DiskSuite needs

access to

          o the /etc/system file
          o its drivers
          o the metadevice entries in /dev and especially in /devices

      All of them happen to reside on the boot/root filesystem. You would get a hen and egg

problem if you tried to boot off a striped metadevice.

      A submirror consisting of a single slice can be read like an ordinary slice can. So,

what you can do with your boot/root filesystem is placing it onto a mirror.

#################################################################
Mirroring swap with Solstice DiskSuite
#################################################################

    * Q: Can I mirror my swap space?

    * A: You can:

          o use a mirror metadevice as swap device
          o place a swap file onto a mirrored filesystem

      But you can use neither the mirror nor the swap file as dump device.

#################################################################
Maximum number of metadevices with Solstice DiskSuite
#################################################################

    * Q: How many metadevices can be defined?

    * A: After installing Solstice DiskSuite, you have 128 metadevice names, d0 through

d127. If you need more, you can increase the number of metadevice names up to 1024 by

editing the file /kernel/drv/md.conf. This file contains an entry that reads:

      name="md" parent="pseudo" nmd=128 md_nsets=4;

      You can change the value of nmd (the number of metadevice names) to up to 1024. In

order for this change to take effect, a reconfiguring reboot is necessary.

#################################################################
Maximum number of disk sets with Solstice DiskSuite
#################################################################

    * Q: How many disk sets can be defined?

    * A: By default, you can define at most 4 disk sets per machine. If you need more, you

can increase the number of disk sets by editing the file /kernel/drv/md.conf. This file

contains an entry that reads:

      name="md" parent="pseudo" nmd=128 md_nsets=4;

      You can change the value of md_nsets (the number of disk sets) to its maximum of 32.

#################################################################
Maximum number of submirrors with Solstice DiskSuite
#################################################################

    * Q: How many submirrors can a mirror device have?

    * A: At most four.

#################################################################
What can I metattach with Solstice DiskSuite
#################################################################

    * Q: What can I attach to what with the command metattach?

    * A: You can metattach

          o one or more slices to a metadevice that is not a (component of a) (sub)mirror
          o a metadevice to a submirror
          o a slice or metadevice to a trans device

#################################################################
DiskSuite files disappeared after upgrading to Solaris 8
#################################################################

    * Q: After having upgraded from Solaris 7 to Solaris 8, I don't find my Solstice

DiskSuite files anymore.

    * A: The files have moved and can be found in the following locations:

      File type         up to Solaris 7         starting with Solaris 8
      Commands         /usr/opt/SUNWmd/sbin/meta*         /usr/sbin/meta*
      Manual pages         /usr/opt/SUNWmd/man         /usr/share/man
      Configuration files         /etc/opt/SUNWmd         /etc/lvm
      Kernel modules         /kernel/drv/md*

#################################################################
Solaris Volume Manager

Solaris Volume Manager metadevice state databases (1)
#################################################################

    * Q: After having installed Solaris Volume Manager, I rebooted. Now, the system

complains about:

      metainit: there are no existing databases

      What went wrong?

    * A: Nothing. The system searches for the metadevice state databases, but doesn't find

them, because you didn't create them up to now. This is one of your first things to do when

configuring Solaris Volume Manager. Use the command metadb for this.

#################################################################
Solaris Volume Manager metadevice state databases (2)
#################################################################

    * Q: Can I place a replica of the metadevice state database into a slice that I intend

to use as a component of a metadevice or do I have to sacrifice a slice for exclusive use by

the database?

    * A: You don't have to sacrifice a slice for the database. A slice can hold a replica of

the metadevice state database and be a component of a metadevice.

      The only restriction that is important here is:

          o the order of creating the replica and making the slice a component. You must

first create the replica and then make the slice a component.

      Since the Solaris Volume Manager metadevice state database is created with its maximum

size (8192 blocks) by default, the restriction to be unable to let the metadevice state

database grow afterwords, as was the case with Solstice DiskSuite (see Solstice DiskSuite

metadevice state databases (2)), doesn't hold true anymore.

#################################################################
Solaris Volume Manager metadevice state databases (3)
#################################################################

    * Q: How does the system know where to look for the metadevice state database?

    * A: Every location of a replica is recorded in /kernel/drv/md.conf. The system reads

this file when searching for the database replicas.

#################################################################
Solaris Volume Manager metadevice state databases (4)
#################################################################

    * Q: How many metadevice state database replicas can a machine have?

    * A: At most 50.

#################################################################
Solaris Volume Manager metadevice state databases (5)
#################################################################

    * Q: What is the default size of a metadevice state database replica?

    * A: The default size of a metadevice state database replica is 8192 blocks, that is

4096 kBytes.

#################################################################
Solaris Volume Manager metadevice state databases (6)
#################################################################

    * Q: In order to enable my system to continue running after a hard disk failure, I've

mirrored my root file system with a two way mirror. Since I've got only two system disks

comprising the mirror, I distributed the metadevice state database replicas evenly among

them.

      If one of those system disks fails, the system is unable to reboot unattended to

multiuser mode because half of the metadevice state database replicas are missing, while

more than half of the replicas are necessary for this.

      Is there a way to tell the machine to reboot unattended to multiuser mode anyway in

case of a system crash?

    * A: Make an entry in /etc/system that looks like this:

      set md:mirrored_root_flag=1

#################################################################
How to stripe a boot device with Solaris Volume Manager
#################################################################

    * Q: How can I use a stripe to hold my boot or root filesystem?

    * A: You can't use a stripe to boot off. This is because in order to read a filesystem

that resides on a metadevice that can't be read like an ordinary slice can, Solaris Volume

Manager needs access to

          o the /kernel/drv/md.conf file
          o its drivers
          o the metadevice entries in /dev and especially in /devices

      All of them happen to reside on the boot/root filesystem. You would get a hen and egg

problem if you tried to boot off a striped metadevice.

      A submirror consisting of a single slice can be read like an ordinary slice can. So,

what you can do with your boot/root filesystem is placing it onto a mirror.

#################################################################
Mirroring swap with Solaris Volume Manager
#################################################################

    * Q: Can I mirror my swap space?

    * A: You can:

          o use a mirror metadevice as swap device
          o place a swap file onto a mirrored filesystem

      But you can use neither the mirror nor the swap file as dump device.

#################################################################
Maximum number of metadevices with Solaris Volume Manager
#################################################################

    * Q: How many metadevices can be defined?

    * A: By default, using Solaris Volume Manager, you have 128 metadevice names, d0 through

d127. If you need more, you can increase the number of metadevice names up to 8192 by

editing the file /kernel/drv/md.conf. This file contains an entry that reads:

      name="md" parent="pseudo" nmd=128 md_nsets=4;

      You can change the value of nmd (the number of metadevice names) to up to 8192. In

order for this change to take effect, a reconfiguring reboot is necessary.

#################################################################
Maximum number of disk sets with Solaris Volume Manager
#################################################################

    * Q: How many disk sets can be defined?

    * A: By default, you can define at most 4 disk sets per machine. If you need more, you

can increase the number of disk sets by editing the file /kernel/drv/md.conf. This file

contains an entry that reads:

      name="md" parent="pseudo" nmd=128 md_nsets=4;

      You can change the value of md_nsets (the number of disk sets) to its maximum of 32.

#################################################################
Maximum number of submirrors with Solaris Volume Manager
#################################################################

    * Q: How many submirrors can a mirror device have?

    * A: At most four.

#################################################################
What can I metattach with Solaris Volume Manager
#################################################################

    * Q: What can I attach to what with the command metattach?

    * A: You can metattach

          o one or more slices to a metadevice that is not a (component of a) (sub)mirror
          o a metadevice to a submirror
          o a slice or metadevice to a trans device
          o a slice to a softpartition

#################################################################
Miscellaneous

Jumpstart via telnet
#################################################################

    * Q: How can I instruct a JumpStart client to let itself install from a JumpStart

server, if I have only telnet access to the client?

    * A: There are two different ways:

      Tell the machine that it should hand the required arguments to the PROM boot command:

      # reboot -- net - install

      or create a file that every Solaris machines looks for on the boot filesystem and that

tells it that it should auto install itself:

      # touch /AUTOINSTALL; init 6

#################################################################
Ethernet address
#################################################################

    * Q: How can I find out the ethernet- (MAC) address of my machine?

    * A: There are four different ways, two from the OBP prompt, and two from the shell:

      From the OPB prompt use one of the commands:

      ok banner
      ok .enet-addr

      While banner tells you different things about your machine (amount of memory, OBP

version, Host-ID), you will learn the ethernet address without additional information if you

use the second command.

      From the shell, use one of the following commands:

      # ifconfig -a
      # dmesg | grep -i ethernet

      While the first command shows you the addresses of configured interfaces only, you get

the ethernet addresses of all interfaces with the second command.

#################################################################
Error running apropos
#################################################################

    * Q: When running the apropos command, I get the error message:

      /usr/share/man/windex: No such file or directory

    * A: The system administrator has to run the catman command once after installing the

man-pages in order to build the missing index file.

#################################################################
Making packages
#################################################################

    * Q: How can I make my own software packages?

    * A: Let's assume your software resides in /export/home/user1/mysoftware. Go to

/export/home/user1 (one directory level above the software's location), and create a file

called pkginfo, that might look like this:

      PKG=MYsftwre
      NAME="Utility to demonstrate making packages"
      CATEGORY=utilities
      ARCH=sparc
      BASEDIR=/usr/local
      DESC="Here goes a short description"
      ISTATES="S s 1 2 3 4"
      RSTATES="S s 1 2 3 4"
      PSTAMP="0109260852 gromit"

      PKG is the package's name, ARCH the destination architecture, BASEDIR the destination

directory where the package will install to, ISTATES and RSTATES are the run levels the

machine should be in while installing or deinstalling this package, respectively. PSTAMP is

a time stamp (September, 26th 2001, 8:52 a.m.) when and machine name (gromit) where the

package was made.

      Run the following command:

      $ pkgproto /export/home/user1/mysoftware=bin > prototype

      This creates the prototype file that is needed for making the package.

/export/home/user1/mysoftware=bin tells the package that what now resides under

/export/home/user1/mysoftware, is to be installed into a directory called bin beneath the

BASEDIR.

      Be sure not to include any files with blanks in their names (but who uses filenames

containing blanks, anyway?) or else you'll run into trouble running the pkgmk command

afterwords which uses blanks as field separators while analyzing its input data stream.

      Edit this prototype file and include this line at the very beginning:

      i pkginfo=/export/home/user1/pkginfo

      Run the following command, which writes the package to /var/spool/pkg (you must have

write permissions there):

      $ pkgmk

      Now you could transfer the package to the distribution medium with:

      $ cd /var/spool/pkg
      $ pkgtrans -s . /dev/diskette MYsftwre

      Finally, you can verify that it arrived there:

      $ pkginfo -ld /dev/diskette

#################################################################
Can't set ACLs on file
#################################################################

    * Q: I try to set ACLs on a file and get an error message:

      $ setfacl -m u:user4:6 /tmp/filename
      /tmp/filename: failed to set acl entries
      setacl error: Operation not applicable

    * A: You try to set ACLs on a tmpfs filesystem. ACLs are only available on ufs

filesystems.

#################################################################
How to setup an anonymous ftp server
#################################################################

    * Q: How can I setup an anonymous ftp server?

    * A: There is a nearly complete shell script to setup an anonymous ftp server in the man

page of ftpd. The only thing that is missing is adding the ftp user to the system, which

must be done e.g. with useradd.

      The commands that you need to extract the shell script from the man page are Solaris

version specific. For Solaris 8, you could use the following steps to setup the server:

      # man ftpd | sed -e '1,364d' -e '584,$d' \
      > -e '/SunOS 5\.8/,/Maintenance Commands/d' \
      > -e '/pub/,$s/\( *\)#/\1/' \
      > -e 's/^\( *cp \)\(\/usr\/lib\/security\)/\1 -r \2/' > \
      > setup_ftp_server
      # useradd -u 22222 -m -d /export/ftp ftp # create ftp user
      # chmod 700 setup_ftp_server             # make executable
      # ./setup_ftp_server                     # fill directory
      # grep '^ftp:' /etc/passwd > /export/ftp/etc/passwd
      The > symbols at the beginning of the lines are the continuation prompts of your shell

that are not ment to be typed by you.

      From Solaris 9 on, use ftpconfig(1M) for this task.
发表于 2006-8-28 21:56:26 | 显示全部楼层
多谢分享,收藏了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表