µ±Ç°Î»ÖãºÊ×Ò³ > unix Êý¾Ý¿â ѧϰ ±Ê¼Ç
Unixѧϰ±Ê¼Ç
FAQ
/dev/rdskºÍ/dev/dskµÄÇø±ð
/dev/rdsk´ú±íraw disk,¼´×Ö·ûÉ豸 /dev/dsk´ú±íblock disk,¼´¿éÉ豸
ÕâÁ½¸öĿ¼Öд洢µÄÂß¼É豸Ãû³ÆËùÖ¸µÄÎïÀíÉ豸ÊÇÒ»ÑùµÄ£¬µ«ÊÇ·ÃÎÊ·½Ê½²»Ò»Ñù¡£ ÓÉÓÚ²»Í¬µÄÃüÁîËùÐèµÄÉ豸ÀàÐͲ»Ò»Ö£¬ËùÒÔÐèÒª¸ù¾ÝÇé¿öÑ¡Ôñrdsk»òÕßdsk
/devices ´æ´¢ÎïÀíÉ豸Ãû³Æ
/etc/path_to_inst ´æ´¢ÊµÀýÃû³Æ(kernel¶Ôϵͳÿһ¸öÉ豸µÄ¼ò³Æ)ºÍÎïÀíÉ豸Ãû³ÆµÄÓ³Éä¹ØÏµ£¬±ÈÈç
sd
dad
Âß¼É豸Ãû³Æ
ÊǶÔ/devicesÖеÄÎïÀíÉ豸µÄ·ûºÅÁ´½Ó£¬ËùÓеÄÂß¼É豸Ãû³Æ¶¼´æ´¢ÓÚ/devĿ¼Ï£¬Âß¼É豸Ãû³Æ°üº¬Èçϼ¸²¿·Ö
¿ØÖÆÆ÷±àºÅ¡¢Ä¿±êºÅ¡¢´ÅÅ̺š¢·ÖƬºÅ(s0-s7)»òÕßfdisk·ÖÇøºÅ(p0-p4),ÈçÏ c
IDE devices do not use a target number and are represented as
(c
DevfsadmɨÃèÓ²¼þ
¿ÉÒÔʹ²Ù×÷ϵͳÁ¢¼´É¨Ã赱ǰÉ豸£¬Èç¹ûÓ²¼þ·¢Éú±ä¶¯£¬Ê¹ÓøÃÃüÁî¿ÉÊÇUnixÁ¢¼´Ê¶±ðÏàÓ¦µÄ±ä¶¯£¬±ÈÈçÔö¼Ó»òÒÆ³ýÁËÓ²Å̺ó¿ÉÒÔʹÓøÃÃüÁʹµÃformatÃüÁîÁ¢¼´¿ÉÒÔ¿´µ½¸üкóµÄ½á¹û£»
If you remove a disk from a running system or make any configuration changes and you want that change to take affect without rebooting the system, then you can run the devfsadm com- mand from command line.
´ÅÅ̵ıêÇ©
To ¡°label¡± a disk means to write slice informa-
tion onto the disk. You usually label a disk after you change its slice
SMI¡ªThe traditional VTOC£¨Volume Table of Con-tents£© label for disks that are less than 1TB in size.
EFI¡ªProvides support for disks that are larger than 1TB on systems that run a 64-bit Solaris kernel. The Extensible Firmware Interface (EFI) disk
label is not available for disks connected to a system running a 32-bit Solaris kernel. A disk that is less than 1 TB (terabyte) in size can be labeled with an EFI label using format -e command.
Prtvtoc²é¿´´ÅÅÌ·ÖÇøÐÅÏ¢
²é¿´´ÅÅÌsliceÏêϸÐÅÏ¢
Slice 2ÔÚVTOCÖдú±íÈçÏÂÒâÒå
VTOC¡ªRefers to the entire disk, by convention. The size of this slice should not be changed
bash-3.00# prtvtoc /dev/rdsk/c1t0d0s2 * /dev/rdsk/c1t0d0s2 partition map *
* Dimensions:
* 512 bytes/sector * 63 sectors/track * 255 tracks/cylinder * 16065 sectors/cylinder * 2087 cylinders
* 2085 accessible cylinders * * Flags:
* 1: unmountable
* 10: read-only *
* Unallocated space:
* First Sector Last * Sector Count Sector * 0 1076355 1076354
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 1076355 24017175 25093529 1 3 01 96390 979965 1076354 2 5 00 0 33495525 33495524 3 14 01 96390 33399135 33495524 4 15 01 16065 80325 96389 7 8 00 25093530 8401995 33495524 8 1 01 0 16065 16064
1block=1sector=512byte
solarisÖÐÈçºÎ¹ÒÔØ¹âÇý
1£¬ÓÃ#iostat -En »ò#ls -l /dev/ | grep sr ²é¿´É豸ºÅ¡£ È磺
# iostat -En
c0t6d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: TOSHIBA Product: DVD-ROM SD-M1401 Revision: 1009 Serial No: 12/20/00 Size:
»ò
# ls -l /dev/ | grep sr
lrwxrwxrwx 1 root root 13 Feb 27 2004 rsr0 -> rdsk/c0t6d0s2 lrwxrwxrwx 1 root root 12 Feb 27 2004 sr0 -> dsk/c0t6d0s2 2£¬È»ºó # mount ¨CF hsfs ¨Co ro /dev/dsk/c0t6d0s2 /cdrom
·þÎñµÄ¿ªÆôÓë¹Ø±Õ
°²×°solaris10£¬Æô¶¯ºó·¢ÏÖÕÒ²»µ½ftp¡¢telnetµÄ¹Ø±Õ·½·¨£¬ ¹ÜÀíÃüÁî svcadm(·þÎñ״̬¹ÜÀí£¬Æô¶¯¡¢Í£Ö¹µÈ)
# svcs ²é¿´µ±Ç°ËùÓеķþÎñ״̬£¬¿ÉÒÔʹÓÃ|¹ÜµÀ·ûÖØ¶¨Ïò×÷¸ü¸öÐÔ»¯µÄ²éÕÒ£»Èç # svcs |grep online ²é¿´µ±Ç°ÔËÐзþÎñ
# svcs |grep offline ²é¿´µ±Ç°Í£Ö¹·þÎñ # svcs |grep inetd ²é¿´inetd·þÎñ״̬
ftp·þÎñ
#svcadm disable svc:network/ftp ¹Ø±Õftp·þÎñ #svcadm enable svc:network/ftp ÆôÓÃftp·þÎñ
Èç¹ûÎÞ·¨ÓÃroot ftp£¬ÔÚ /etc/ftpd/ftpusers£¬Èç¹ûÓÐroot£¬ÐÐÊ×¼Ó#ºÅ×¢Ê͵ô¾Í¿ÉÒÔÁË
telnet·þÎñ
#svcadm disable svc:network/telnet
Èç¹ûÎÞ·¨ÓÃroot telnet,ÐÞ¸Ä /etc/default/login°ÑCONSOLE=/dev/console¸ÃÐÐ×¢Ê͵ô£¬¾Í¿ÉÒÔÓÃroot telnet
SSH·þÎñ
SolarisÔÚ°²×°Íê±Ïºó¾ÍÌṩÁ˸ÃÏî·þÎñ£ºOpenSSH ·þÎñµÄ¿ªÆô·½·¨£ºsvcadm enbale -rt ssh
ĬÈÏÇé¿öÏ£¬OpenSSHÊǽûÖ¹rootÕÊ»§Í¨¹ýSSH·½Ê½µÇ¼µÄ£¬ÒÔ±£Õϰ²È«¡£ ·½·¨ÈçÏ£º
ÐÞ¸Ä /etc/ssh/sshd_configÎļþ£¬½«ÆäÖеġ°PermitRootLogin no¡±ÐÞ¸ÄΪ¡°PermitRootLogin yes¡±£¬ÔÙÖ´ÐÐ svcadm restart ssh ÖØÐÂÆô¶¯SSH·þÎñ¡£
#svcadm disable svc:network/smtp:sendmail
Mount
·ÖÇø¹Ò½Ó
ÁÙʱ¹Ò½Óʱֱ½ÓʹÓÃmountÃüÁî¹Ò½Ó£¬ÈçÏ Mount /dev/dsk/c1t2d0s2 /mnt
Èç¹ûÐèÒªÔÚϵͳÆô¶¯Ê±×Ô¶¯¹Ò½Ó£¬ÐèÒªÔÚ/etc/vfstabÖмÓÈë¹Ò½ÓÃüÁî;
mount ¨CvÃüÁîÏÔʾµ±Ç°ÏµÍ³ËùÓÐÒѹҽÓÓ²¼þ£¬¸ÃÃüÁîʵ¼Ê¶ÁÈ¡µÄÊÇ/etc/mnttabÎļþ£»
umountÐ¶ÔØÊ§°ÜÈçºÎ´¦Àí
Ð¶ÔØ·ÖÇø Umount /mnt Èç¹ûÌáʾ
umount: /mnt busy£¬±íʾÓÐÓ¦ÓóÌÐòÕýÔÚ¶Áд¸Ã·ÖÇø£¬×îºÃµÄ´¦Àí·½·¨ÈçÏ The safest way to stop all processes that are accessing a file system before unmounting it is to use the fuser command to report on the processes that are accessing a particular file system. Once the processes are known, send a SIGKILL
¹²·ÖÏí92ƪÏà¹ØÎĵµ