Freebsd. от новичка к профессионалу (2011)

526
Денис Колисниченко Санкт-Петербург «БХВ-Петербург» 2011 Copyright ОАО «ЦКБ «БИБКОМ» & ООО «Aгентство Kнига-Cервис»

description

http://leontyev.at.ua

Transcript of Freebsd. от новичка к профессионалу (2011)

  • 1. - - 2011 Copyright & A K-C
  • 2. 681.3.06 32.973.26-018.1 60 . . 60 FreeBSD. . .: -, 2011. 544 .: . ( ) ISBN 978-5-9775-0673-1 FreeBSD, -BSD, OpenBSD. BSD , . . - , , RAID-, - , , , . (Postfix), Web- (Apache) - PHP MySQL, DNS/DHCP/FTP . . FreeBSD 681.3.06 32.973.26-018.1 : . . . 02429 24.07.00. 24.01.11. 70 1001 /16. . . . . 43,86. 1500 . "-", 190005, -, ., 29. - 77.99.60.953..005770.05.09 26.05.2009 . . " "" 199034, -, 9 , 12. ISBN 978-5-9775-0673-1 . ., 2011 , "-", 2011 Copyright & A K-C
  • 3. ............................................................................................................................ 1 I. ................................................................ 3 1. UNIX FreeBSD.............................................................................. 5 1.1. ............................................................................... 5 1.2. UNIX ......................................................................... 7 1.3. BSD .......................................................................................................... 8 1.4. UNIX- ............................................................................ 8 1.5. FreeBSD, OpenBSD NetBSD................................................................................. 10 1.6. ? ..................................................................................... 11 2. FreeBSD ...................................................................................... 13 2.1. FreeBSD....................................................................................... 13 2.2. ............................................................................................ 14 2.3. .......................................................................................... 15 2.3.1. ................................................................................................. 15 2.3.2. .............................................................. 15 2.3.3. ................................................................................................... 19 2.3.4. .............................................................................................. 21 2.3.5. BSD- BSD-.................................................. 22 2.3.6. . ......... 26 2.4. ............................................................ 29 2.5. .................................................................................................. 38 3. OpenBSD..................................................................................... 39 3.1. ........................................................................................ 39 3.2. .................................................................................................. 40 3.2.1. - ................................................................................. 40 3.2.2. .................................................................................................. 41 3.2.3. root ................................................................................................ 42 Copyright & A K-C
  • 4. IV 3.2.4. ..................................................................... 43 3.2.5. .................................................................................. 44 3.2.6. .................................................................................. 47 3.2.7. ....................................................................................... 48 3.2.8. ....................................................................................... 49 4. -BSD: , ............................. 51 4.1. ...................................................................................................... 51 4.2. -BSD................................................................................................ 52 5. . BSD/Linux/Windows ....................................................................................... 55 5.1. ?.................................................................. 55 5.2. ................................................................... 55 5.3. DVD ................................................... 57 5.4. .................................................................... 58 5.5. "" ........................................................................................ 60 5.6. Clonezilla .................................................... 61 5.7. tar ........................................................................................................... 70 5.8. ............................................................................. 71 5.9. DVD- FreeBSD .......................................................................... 72 6. LiveCD .............................................................. 73 6.1. . dump ............................................................................. 73 6.2. LiveCD. FreeSBIE..................................................................... 74 6.3. . restore ........................................................... 75 7. FreeBSD ..................................................... 76 7.1. LiveUSB. FreeBSD .................................... 76 7.2. FreeBSD 8....................................................................................... 77 7.3. .................................................................................................... 78 II. BSD.................................................. 81 8. ....................................................................................... 83 8.1. ......................................................................................................... 83 8.2. .................................................................................... 84 8.3. .............................................................................................. 85 8.4. ............................................................ 86 Copyright & A K-C
  • 5. V 8.5. sysinstall........................................................................................... 87 8.6. Midnight Commander ........................................................... 87 8.7. ..................................................................... 88 8.8. vi.................................................................................... 89 8.9. .............................................................................................. 92 8.10. UTF-8 .................................................................................................. 96 9. GNOME .................................................. 98 9.1. FreeBSD ....................................................................... 98 9.2. .................................................................................... 99 9.3. GNOME.................................................................................. 101 9.4. ............................................................. 106 9.4.1. ...................................................................... 106 9.4.2. GNOME ............................................ 109 10. ...................................... 111 10.1. HAL........................................................................................................ 111 10.1.1. ++...................................................... 111 10.1.2. ............................................................................... 112 10.1.3. HAL ................................................ 113 10.2. gconf-editor.................................................................. 114 10.3. NVIDIA........................................................................... 118 III. ...................................................................... 119 11. .................................... 121 11.1. /etc/shells ..................................................................................................... 121 11.2. ........................................................................................... 122 11.2.1. sh.................................................................................................... 122 11.2.2. csh.................................................................................................. 122 11.2.3. ksh.................................................................................................. 123 11.2.4. bash................................................................................................ 123 11.2.5. zsh.................................................................................................. 124 11.2.6. tcsh................................................................................................. 125 11.2.7. ash.................................................................................................. 125 11.2.8. ............................................................................................ 125 11.3. bash....................................................................................................... 125 11.4. tcsh ....................................................................................................... 128 11.5. /.......................................................................... 132 Copyright & A K-C
  • 6. VI 12. ............................................... 134 12.1. bash ..................................................................................... 134 12.1.1. , !................................................................................................... 134 12.1.2. ............................. 135 12.1.3. ................................................................... 136 12.1.4. bash.............................................................................................. 137 12.1.5. ............................................................................................................. 137 12.1.6. ..................................................................................... 138 12.1.7. ......................................................................................................... 139 12.1.8. ....................................................................................... 140 12.2. tcsh ...................................................................................... 142 12.2.1. , ............................................................ 142 12.2.2. ........................................................................... 144 12.2.3. , ..................................... 144 12.2.4. .............................................................................. 147 13. 24 ............................................................................... 152 13.1. man: ..................................................................... 152 13.2. uname: ............................................................ 152 13.3. clear: ............................................................................ 154 13.4. date: ........................................... 154 13.5. exit: ....................................................................... 154 13.6. passwd: ................................................................... 154 13.7. uptime: ............................................... 154 13.8. users: ................................................... 155 13.9. w, who whoami: .................................................................................................... 155 13.10. diff: ....................................................................... 156 13.11. grep: ..................................................................... 156 13.12. more less: .................................................... 156 13.13. head tail: "" .................................... 157 13.14. wc: , ................................... 157 13.15. ftp: FTP- ............................................................ 157 13.16. links lynx: ...................................................... 159 13.17. md5: MD5...................................... 160 13.18. df: .................................................................................... 160 13.19. free ............................................................................. 161 Copyright & A K-C
  • 7. VII IV. .......................................... 163 14. ..................................................................................... 165 14.1. , FreeBSD ............................................... 165 14.1.1. ....................................................... 165 14.1.2. ?............................................................ 167 14.1.3. ZFS.............................................................................. 167 14.1.4. UFS2 ............................................. 169 14.1.5. SoftUpdates................................................................................. 169 14.2. FreeBSD ........................................................ 170 14.2.1. : , , , ........................................ 170 14.2.2. FreeBSD.............................................................................. 173 14.2.3. ...................................................................................... 174 14.2.4. ............................................. 175 14.2.5. FreeBSD................................................................... 176 14.3. ................................................. 177 14.3.1. ........................................................................................... 177 14.3.2. ...................................................................................... 179 14.4. ln: .............................................................................. 181 14.5. chmod, chown chattr.......................................................................... 182 14.5.1. chmod: .............................. 182 14.5.2. chown: ..................................................... 184 14.5.3. (SUID SGID)............................................... 184 14.5.4. chattr: , ....................... 185 14.6. ....................................................................... 185 14.6.1. mount umount.............................................................................. 185 14.6.2. .......................................................... 186 14.6.3. ......................................................... 191 14.7. .............................................................................................. 192 14.7.1. ISO-............................................................................ 192 14.7.2. ................................................................................ 193 14.7.3. SCSI- DVD ........................................................... 193 14.8. ........................................................... 193 14.9. Midnight Commander .......................................................................... 200 15. . ............................................... 201 15.1. ........................................................................ 201 15.2. root................................................................................................. 202 15.2.1. ......................................................................... 202 15.3. , ......................................... 204 15.3.1. : adduser................................................... 204 Copyright & A K-C
  • 8. VIII 15.3.2. : rmuser .................................................... 207 15.3.3. : passwd..................................... 207 15.4. ................................................................. 208 15.5. ......................................................................................... 209 15.6. ............................................................... 210 16. ..................................................... 213 16.1. FreeBSD.................................................................................. 213 16.2. .................................................................................... 216 16.3. ....................................................................................... 217 16.4. ................................................................... 219 16.5. sysctl.conf................................................. 219 17. .................................................................................................... 220 17.1. ........................................................................ 220 17.2. top: ?................. 223 17.3. ........................................................................ 226 17.4. ........................................................................ 226 18. : .......................................................................................... 227 18.1. ................................................................................. 227 18.2. ............................................................................................ 228 18.2.1. ............................................................................................ 229 18.2.2. ................................................................. 229 18.2.3. ....................................................................... 229 18.2.4. .................................................................... 231 18.2.5. /usr/ports ........................................................................ 232 18.2.6. . portupgrade.............................................. 236 18.3. ......................................................................... 238 19. ..................................................................................... 241 19.1. lpr CUPS ................................................................................ 241 19.2. GDI- ................................................................................. 241 19.3. ................................................................................ 242 19.4. CUPS................................................................................................... 244 19.5. ............................................................................................. 244 19.6. CUPS ...................................................................... 253 Copyright & A K-C
  • 9. IX 20. RAID- ........................................................................................... 257 20.1. RAID?................................................................................................... 257 20.2. RAID- ............................................................................. 259 20.2.1. RAID- CDD.............................................. 259 20.2.2. RAID- GEOM........................................... 261 21. ...................................................................................... 264 21.1. ........................................................................ 264 21.2. ..................................................................................................... 265 21.2.1. ............................................................................... 265 21.2.2. ................................................ 265 21.2.3. ................................................ 266 21.2.4. PAE 4 ........ 268 21.3. .......................................................................................................... 270 V. BSD .................................................... 271 22. ......................................................... 273 22.1. ......................................................................................... 273 22.1.1. 19411975 .............................................................................................. 273 22.1.2. 19761982 .............................................................................................. 274 22.1.3. 19831989 .............................................................................................. 275 22.1.4. 19901995 .............................................................................................. 276 22.1.5. 19961999 .............................................................................................. 277 22.1.6. 2000 ....................................................................................... 278 22.2. ........................................................................................... 278 22.2.1. .......................................................................... 278 22.2.2. ................................................................................................. 279 22.2.3. ............................................................ 281 22.2.4. ..................................................................... 281 22.2.5. ................................................................. 281 22.2.6. ........................... 282 22.3. ..................................................................... 282 22.4. OSI........................................................................................................... 283 22.5. ? ............................................................................................ 285 22.6. ..................................................................................... 286 22.7. DNS ........................................................................................................ 290 22.8. Ethernet- .......................................................................................... 290 22.8.1. Ethernet ......................................................................... 290 Copyright & A K-C
  • 10. X 22.8.2. ..................................................................... 295 22.8.3. ................................................................................................... 296 22.8.4. .............................................................. 301 23. ..................................................................... 304 23.1. ......................................................... 304 23.2. DHCP ............................................................. 306 23.3. .............................................................. 307 23.4. sysinstall............... 307 23.5. ifconfig ....................... 309 23.6. route: .......................................................................... 311 23.7. , IP- DNS..................................................................... 312 23.8. IPv6...................................................................... 313 23.9. inetd................................................................................................. 313 23.10. ............................................................................... 315 24. DSL-.................................................................... 318 24.1. DSL-.......................................................... 318 24.2. ADSL-.......................................................... 318 24.3. FreeBSD...................................................................... 319 24.4. ......................................................................... 321 25. Windows ................................................................ 322 25.1. Samba.................................................................................................. 322 25.2. Samba................................................................................. 323 25.3. ................................................................................. 324 25.4. Samba............................................................................................. 326 25.5. smbclient............................................................................................ 327 26. DHCP-.............................................................................................. 328 26.1. .................................................... 328 26.2. DHCP-.......................................................... 329 26.3. ............................................................................................. 331 26.4. .................................................... 331 26.5. MAC-...................................................................................... 332 26.6. DHCP............................................................................... 335 26.7. ............................................................................................. 335 27. DNS- ................................................................................................. 336 27.1. , DNS............................................................................. 336 27.2. DNS-............................................................................................. 337 Copyright & A K-C
  • 11. XI 27.3. named.conf ......................................................................... 338 27.4. DNS................................................................................... 339 27.5. DNS- .................................................................................. 343 27.6. DNS-....................................................................................... 346 27.7. .................................................. 347 28. .................................................................................. 348 28.1. ? ........................................................................................ 348 28.2. .......................................................................................... 349 28.3. .............................................................................................. 350 28.4. /etc/rc.conf...................................................................... 351 28.5. /etc/rc.firewall ................................................................ 353 28.6. ................................................................... 355 29. -............................................................................................ 356 29.1. - ? ................................................ 356 29.2. Squid...................................................................................... 357 29.3. ....................................................................................... 359 29.3.1. ................................................................................... 359 29.3.2. URL..................................................................... 359 29.3.3. .......................................................................................... 360 29.4. - ............................................................................. 360 29.5. ............................................................................................. 360 29.6. Rejik............................................ 361 29.7. Squid............................................................................. 363 29.8. -............................................................................... 364 29.8.1. - OOPS................................................................. 364 29.8.2. Squid ......................................................................................... 365 29.8.3. Squid.................................................................... 366 30. FTP-.................................................................................................. 369 30.1. FTP?................................................................................................ 369 30.2. ftpd .............................................................................. 369 30.2.1. ftpd ................................................ 369 30.2.2. ......................................................................................... 371 30.3. ProFTPD................................................................................................... 373 30.3.1. .......................................................................... 373 30.3.2. ............................................................... 373 30.3.3. ....................................................................... 376 30.4. vsftpd ........................................................................................................ 378 30.4.1. vsftpd? ................................................................................. 378 Copyright & A K-C
  • 12. XII 30.4.2. vsftpd ........................................ 378 30.4.3. MySQL.................................................................... 379 30.4.4. vsftpd .................................................... 380 31. NFS ......................................................... 382 31.1. NFS .......................................................................................... 382 31.2. NFS........................................................................ 383 31.3. ................. 385 32. ....................................................................................... 386 32.1. .................................................................... 386 32.2. ....................................................................... 387 32.2.1. MySQL-........................................................................... 388 32.2.2. Cyrus-sasl2 .............................................................. 389 32.2.3. Courier-authlib ........................................................ 389 32.2.4. .............................................. 390 32.3. Courier-IMAP ..................................................................................... 391 32.4. postfix.................................................................................................. 393 32.5. PostfixAdmin ...................................................................................... 399 33. SSH .................................................. 401 33.1. SSH SSH- .............................................................................. 401 33.2. SSH-............................................................................................................ 402 34. Web-. Apache + PHP + MySQL...................................... 406 34.1. Web-......................................................................... 406 34.2. Web-, PHP, MySQL..................... 406 34.2.1. Web- Apache................................................................... 406 34.2.2. PHP............................................................................................... 411 34.2.3. MySQL-........................................................................... 412 34.3. Apache MySQL.......................................................... 412 34.4. Apache............................................................................. 413 34.5. ........................................................................................ 414 34.6. Web- ................................................................... 416 34.6.1. .......................................................................................... 416 34.6.2. .................................... 417 34.6.3. Directory, Limit, Location, Files................................................. 419 34.7. Apache ........................................................................................... 422 34.8. ................................................................................. 424 Copyright & A K-C
  • 13. XIII 35. ..................................................................... 426 35.1. ?....................................................... 426 35.2. ........................................................... 427 35.3. - .......................................................................................... 427 35.3.1. ......................................................................................... 427 35.3.2. ................................................................... 428 35.3.3. ................................................................................... 428 35.3.4. ipsec-tools..................................................................................... 429 35.3.5. ....................................................................... 429 35.3.6. ....................................................... 431 35.4. -...................................................................................... 434 35.4.1. ................................................................... 434 35.4.2. ................................................................................... 434 35.4.3. poptop ................................................................................ 435 35.4.4. .............................................. 435 35.5. PPTP-................................................................................... 436 35.5.1. Linux-.............................................................................. 436 35.5.2. Windows-........................................................................ 438 36. ........................................................................ 443 36.1. Web- ............................................................................................ 443 36.2. FTP ........................................................................................................... 444 36.3. DNS.......................................................................................................... 444 36.4. Samba ....................................................................................................... 446 VI. ......... 447 37. ............................................................. 449 37.1. : darkstat....................................... 449 37.2. NeTAMS ................................................................................................ 452 38. Nagios ..................................................... 456 38.1. ..................................................................... 456 38.2. Nagios ................................................................................................. 456 38.3. Nagios ................................................................................................. 458 39. AimSniff ICQ- .......... 463 39.1. ......................................................................................... 463 39.2. ...................................................................... 464 Copyright & A K-C
  • 14. XIV 40. nmap .............................................. 466 40.1. nmap? ................................................................................................... 466 40.2. nmap.................................................................................................... 467 40.3. nmap............................................................................ 467 41. .......................................................... 470 41.1. ............................................................................................... 470 41.2. HAVP ClamAV ............................................................................... 471 41.3. ClamAV HAVP ............................................................................... 472 41.4. Squid ................................................................................................... 473 42. SMS-............................................................................................ 475 42.1. ............................................................................................... 475 42.2. SMS Tools........................................................................................... 475 42.3. SMS................................................................................................ 477 43. ............................................................................. 479 43.1. ........................................................................... 479 43.2. gdbe................................................................................................... 479 43.2.1. gdbe............................................................................................. 479 43.2.2. .......................................................... 480 43.2.3. ............................... 481 43.2.4. gdbe-......................................... 482 43.3. geli......................................................... 482 43.3.1. geli............................................................................................ 482 43.3.2. geli........................................................................... 482 43.3.3. geli ....................................................................... 483 43.3.4. geli-............................................ 483 VII. ............................................................... 485 44. ............................................................. 487 44.1. IT-........................................................................................... 487 44.2. , . ?.................. 488 44.3. ........................................................................... 491 45. ""..................................................................................... 494 45.1. ............................................................................. 494 45.2. " ", ....................................................................... 495 Copyright & A K-C
  • 15. XV 45.3. . ............................ 496 45.4. .................................................................................. 497 45.5. ................................................................................... 498 45.6. ............................................................................................................. 499 45.7. .......................................................... 500 ..................................................................................................... 501 .......................................................................................................... 503 1. : Windows 7 FreeBSD................................... 505 2. GRUB: Linux FreeBSD....................... 507 3. USB- FreeBSD 8.0 ........................ 508 4. ..................................................... 509 4.1. .................................................. 509 4.2. , Ethernet-........................... 509 4.3. , Wi-Fi ............................... 513 4.4. ............................................................... 515 .............................................................................................. 517 Copyright & A K-C
  • 16. FreeBSD, - : http://www.freebsd.org.ua/doc/ru_RU.KOI8-R/books/handbook/ index.html. (, , ) FreeBSD. , - FreeBSD. , , - , - FreeBSD - . , - . , - , . , , - . . ( , ) . X Window System ( X.Org ) xorg.conf. X HAL, - xorg.conf . org.conf ( 90% ), . 10%, - , X. - HAL, X HAL. - procfs, GNOME GDM ( Copyright & A K-C
  • 17. 2 GNOME). , - GDM, , - ? , X ( )? - - . , , . ( ) FreeBSD, 8.1. 7.x, 9.0. FreeBSD OpenBSD - BSD. BSD- ( ?), - , - , BSD-. -BSD FreeBSD, , FreeBSD, -BSD. , , - , , . , - FreeBSD. - FreeBSD, " " . - FreeBSD , , , - Windows- ( , BIOS Setup ISO- ) Windows-. Linux FreeBSD. , . Linux - . UNIX, , - , . . UNIX, , . , - . , - , , . BSD- . , , OpenBSD -BSD - . . Copyright & A K-C
  • 18. I Copyright & A K-C
  • 19. 1 UNIX FreeBSD 1.1. ( ). . , . - , - . . 1.1 Mark I, IBM 1944 . Mark I , "- ". . 1.1. Mark I - . , . Copyright & A K-C
  • 20. I. 6 - , . . 1950- IBM IBM 7090 IBM 7094. AT&T. - AT&T Bell Labs. 1957 (Victor A. Vyssotsky) , , , 1917 . - BESYS (Bell Operating System). . 1.2 IBM 7090. , (, - , ). - , . . 1.2. IBM 7090 1964 Multics (MULTIplexed Information and Computing Service), BESYS . . . (Dennis MacAlistair Ritchie) (Kenneth Thompson). Copyright & A K-C
  • 21. 1. UNIX FreeBSD 7 1.2. UNIX UNIX 1969 , Bell Labs: , (Malcolm Douglas McIlroy). Multics. - UNICS (UNIplexed Information and Computing Sys- tem). UNIX . UNIX PDP-7 DEC. IBM, (. 1.3), . . 1.3. DEC PDP-7 1971 UNIX V1 (UNIX Edition 1), - UNIX Vn, n . , UNIX, , - PDP-7, V1 PDP-11. , UNIX 1 1970 UNIX. - , 1 1970 - - UNIX. UNIX PDP-11, , UNIX PDP-7 - PDP-11 . UNIX , . Copyright & A K-C
  • 22. I. 8 UNIX B. 1969 , UNIX 1972 , UNIX V2 UNIX. B, 1969 , ( BASIC), . 1973 B , , . C. C UNIX 1973 V3. C, - - . - , , - . 1973 UNIX V4 C. 1974 V5, , 1975 V6, (John Lions) "Commentary on UNIX 6th Edition, with Source Code" ( 6- UNIX, ). , 1976 , - UNIX, - . 1979 V7 UNIX AT&T. , 1979 UNIX. 1.3. BSD UNIX , - AT&T . . AT&T UNIX V6 BSD (Berkeley Software Distribution) UNIX ( 1BSD). - 1978 , 1979 BSD: 2BSD 3BSD ( UNIX V7). BSD - , ( vi), . AT&T, BSD 50 . : ( AT&T) ( BSD). 1.4. UNIX- 1980- . , UNIX ( : AT&T BSD), . Copyright & A K-C
  • 23. 1. UNIX FreeBSD 9 UNIX- - : http://upload.wikimedia.org/wikipedia/commons/d/d9/Unix_history-simple.en.svg 1 . , , . ? , Linux UNIX, - Linux, , . , Microsoft "" Xenix, ( , ) SCO. SCO UNIX2 , 1994 OpenServer. , Microsoft, SCO. - SCO UNIX ( , UNIX- SCO3 ) 40% , 10 SCO UNIX, 12 000 "" McDonald's. SCO UNIX BMW 22 000 . , Microsoft, - , " " "" ? : "- : McDonald's ". HP UNIX HP-UX. - Apple. , , Mac OS BSD 1980- BSD UNIX - - (The Defense Advanced Research Projects Agency, DARPA). - , UNIX V7 - TCP/IP. UNIX V7 TCP/IP, BSD . 1983 AT&T - . UNIX, UNIX System V Rn, n . Rn - AT&T , , BSD, 1989 System V R4, - - TCP/IP, NFS, , . 1 SVG , Adobe SVG Viewer Chrome, SVG . 2 SCO UNIX : http://www.ru.sco.com/. 3 , OpenServer SCO UnitWare, SCO UNIX, . http://www.ru.sco.com/products/unix/. Copyright & A K-C
  • 24. I. 10 1990 System V SCO UnixWare ( UNIX- SCO). , - 1 . System V Solaris. Sun Microsystems, Oracle Corporation. 1.5. FreeBSD, OpenBSD NetBSD FreeBSD ( OpenBSD NetBSD) - (Bill Jolitz) 386BSD BSD, Intel 80386. 386BSD , 199394 . - , . , - , -"". "" BSD - x86 80386 , (80486) , 386 . BSD. - , . , , - . 386BSD : FreeBSD NetBSD. - x86 . . 5.0.2 57 - 2 . , - . NetBSD - , "" . 1995 NetBSD OpenBSD. , . , - "" 3 . FreeBSD. 1993 , 1.1. - 9- FreeBSD, , . , 1 SCO UnixWare : http://www.ru.sco.com/ products/unixware/714/. 2 NetBSD : http://www.netbsd.org/. 3 OpenBSD : http://www.openbsd.org. Copyright & A K-C
  • 25. 1. UNIX FreeBSD 11 2010 , 2011 . - , . , FreeBSD - 8.1 7.2/7.3. 1.6. ? FreeBSD ( - ), , - , . FreeBSD "" ? 8.1 "" : http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/hardware.html. ? - . , . : - Wi-Fi. , - Mandriva 2009. ? 2010- (, ) . , Ubuntu 8. ? - , Wi-Fi. 2010 Mandriva, -, . ? , 2010. , - . . - - . , , - RAID- ! , , - . - . : , . . , (SMP) , - FreeBSD 6.0, SMP , FreeBSD. - , 6.0 8.1 - 9.0. , , 8.1, , FreeBSD . - , . , - Copyright & A K-C
  • 26. I. 12 7.1. SCTP (Stream Control Trans- mission Protocol), UFS2 ( , ), gcc 4.2. 7.2, - SMP, ZFS (Zettabyte File System). 7.2 ( ) UltraSPARC III ("Cheetah") SPARC64. , 6 ( 64- ) 3,6 ( 32- ) ? - PAE-, 21. SMP ( - ), - USB-, - ZFS ( ZFS-), Xen DomU, "" (jails)1 . , UNIX, FreeBSD, 2. 1 , 8- FreeBSD - , " " : http://www.dkws.org.ua/phpbb2/viewtopic.php?p=30335. Copyright & A K-C
  • 27. 2 FreeBSD 2.1. FreeBSD FreeBSD . FTP-: ftp://ftp.freebsd.org/pub/FreeBSD/releases. ( i386), - ISO-IMAGES, , . , ISO- (8.1) FreeBSD i386 - : ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/ (. 2.1). . 2.1. ISO-IMAGES/8.1 ? FreeBSD-8.1-RELEASE-i386-dvd1.iso.gz. , 1,9 645 , FreeBSD - . - 645 , , - . 645 , , DVD, CD-. Copyright & A K-C
  • 28. I. 14 CURRENT- FreeBSD 9, : ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201009/ FreeBSD-9.0-CURRENT-201009-i386-dvd1.iso. FreeBSD 9 - "". - "" . FREEBSD CURRENT, STABLE RELEASE? , FreeBSD, CURRENT. - 9. CURRENT . , "", - STABLE. STABLE , - CURRENT, , STABLE . STABLE- , release- . RELEASE-. , RELEASE STABLE. , FreeBSD. gz, Windows, Linux. - : Nero, ISO- Windows 7. , - , , . FreeBSD . UNIX- , , Linux Ubuntu. 2.2. . , , FreeBSD 8. , . FreeBSD 1 (- , FreeBSD, 1 ), , 1 , . . - FreeBSD , - Windows, , . 8 ( ), . . 32 , ( ) 256 . Pentium 64 20 FreeBSD. Copyright & A K-C
  • 29. 2. FreeBSD 15 2.3. 2.3.1. BIOS Setup ( , , , , +). DVD Boot Sequence Boot Order. ! FreeBSD AMD 64 - NVIDIA, ACPI BIOS 2. Boot FreeBSD with ACPI disabled (. . 2.3.2, 16.1). , . "Veni, vidi, vici" (", , ") FreeBSD . . " ", - , , . - FreeBSD , ( ?!), - . - 1 2. 2.3.2. , (. 2.2). . - ACPI, . . 2.2. FreeBSD Copyright & A K-C
  • 30. I. 16 . 2.3. . 2.4. (. 2.3) - (. 2.4). (. 2.5), : Usage ; Standard . , FreeBSD , Copyright & A K-C
  • 31. 2. FreeBSD 17 , root - ; Express -, . - , FreeBSD. - , , , , , . , ; Custom , ; Configure FreeBSD. , FreeBSD ( sysinstall); Doc FreeBSD. , , ; Keymap , , ; . 2.5. Options / - (. 2.6). , : - CDROM DVD, FTP FTP- ftp.freebsd.org. , FTP- . - . , DHCP- - YES DHCP. , Configure . 7; Copyright & A K-C
  • 32. I. 18 . 2.6. Fixit - . - , ; Upgrade ; Load Config ; Index . , Standard . - , fdisk, - , K (. 2.7). . 2.7. fdisk Copyright & A K-C
  • 33. 2. FreeBSD 19 Linux- , , ! FreeBSD Red Hat Linux 6- 5- ( ). 6- Red Hat 1999 . , FreeBSD Linux 10 . , . 2.3.3. - FreeBSD. , , - . , , ( . partitions). - Linux, Windows- Linux-. , Windows Linux (partition), FreeBSD - (slice). Linux : , . FreeBSD . (partitions). FreeBSD , , . , fdisk - , - . FreeBSD, - . , IDE-. , , FreeBSD - , . : Primary Secondary. - , - : Primary Master, Primary Slave, Secondary Master, Secondary Slave. - FreeBSD ad0, ad1, ad2 ad3. , . SCSI- FreeBSD daN, N . , , Primary Master Secondary Master. ad0 ad2. - Primary Slave, ad1. (, Windows) . FreeBSD ( , ), Primary Master Secondary Master - : ad0 ad1. Primary Slave, ad1, Secondary Master ad2, . , ad1, - Copyright & A K-C
  • 34. I. 20 ad2! FreeBSD - , , , . FreeBSD adXsN, X , N . . 2.8 , BSD- ( freebsd) ad0s1. . Windows- fat ntfs. . 2.8. fdisk fdisk . Windows-, FreeBSD, : Partition Magic Windows- . FreeBSD, - fdisk, ( unused), - (. 2.9). M ( - ), , 2048M 2 . . , : Linux Windows. fdisk BSD- (. 2.10); fdisk, - ( FreeBSD ?), . , ? - ; Copyright & A K-C
  • 35. 2. FreeBSD 21 . 2.9. . 2.10. , . - (unused), , , . , . - , - DVD, - fdisk. , . 2.8 12 . VMware - , ? . . 2.3.4. (. 2.11). - . : Standard . , - ; Copyright & A K-C
  • 36. I. 22 . 2.11. BootMgr FreeBSD Boot Manager, , . - . - , BootMgr - ( ); None , . , (, Linux), FreeBSD - . 2.3.5. BSD- BSD- BSD- BSD- (. 2.12). : , 1 . , BSD- (. 2.13). - - ( , ), , BSD-, , . - - . , 12 (. 2.14): 512 ad0s1a. , , - , , ; Copyright & A K-C
  • 37. 2. FreeBSD 23 . 2.12. K . 2.13. . 2.14. 12 Copyright & A K-C
  • 38. I. 24 478 (swap), ad0s1b. , FreeBSD - , . 256 + 478 ( 734 ) "" FreeBSD; 1263 ad0s1d, /var. : - , , , - . . 1,2 , , 12 . 120 - , /var 12 , -; 512 , /tmp, ad0s1e. ; 9521 ( ) /usr, ad0s1f. /usr . 9,5 , , - /usr/ports, 445 . , : adXsN, X - , N . , - : a, b, d, e, f. c . , . - , . , , . . . . 512M (. 2.15). . 2.15. Copyright & A K-C
  • 39. 2. FreeBSD 25 . 2.16. . 2.17. . 2.18. Copyright & A K-C
  • 40. I. 26 : FS Swap (. 2.16). - , , , . / - (. 2.17). , (. 2.18). : 512 / - 512 . - UNIX . , , /tmp, /var, /usr - . . 2.3.6. . . (. 2.19): All . , , ; Reset ; Developer : , - , ; Kern-Developer . ; User ; Minimal . , ; . 2.19. Copyright & A K-C
  • 41. 2. FreeBSD 27 Custom , . - : base kernel (. 2.20). kernel, . (ports) (man info). All . - , (. 2.21). 445 , . 18. . 2.20. . 2.21. ? Copyright & A K-C
  • 42. I. 28 (. 2.22). CD/DVD. , FTP, FTP Passive, HTTP, NFS, 7. DOS File system - DOS - BSD. . , Floppy "". , - 2,1 ? , , 521 " , FreeBSD?" , (. 2.23). , , FreeBSD . 2.22. . 2.23. ? Copyright & A K-C
  • 43. 2. FreeBSD 29 , . -, . root, . , . 2.4. (. 2.24). . - - , No. sysinstall. . 2.24. FreeBSD , , : Would you like to configure any Ethernet or SLIP/PPP network devices? Yes, ( , - ). , . , em0 (. 2.25). , IPv6 (. 2.26). No, , IPv6 IPv4. DHCP- (. 2.27)? Yes. , . - DHCP- No - (. 2.28): (Host), (Domain), IP- (IPv4 Address), IP- (IPv4 Gateway), (Netmask), (Name server). Copyright & A K-C
  • 44. I. 30 . 2.25. . 2.26. IPv6 ? . 2.27. DCHP-? Copyright & A K-C
  • 45. 2. FreeBSD 31 . 2.28. . , - . 2.1, , . 2.1. Do you want this machine to function as a network gateway? ( ?) No, , IP- , - , . 34 Do you want to configure inetd and the net- work services that it provides? ( , inetd?) No, 23 Would you like to enable SSH login? (- SSH?) , Yes, - SSH- 33 Do you want to have anonymous FTP access to this machine? ( FTP- ?) , - FTP-, - , 30 Do you want to configure this machine as an NFS server? ( - NFS-/?) Do you want to configure this machine as an NFS client? ( - ?) NFS 31. , NFS, Yes - Copyright & A K-C
  • 46. I. 32 (. 2.29)? , , . FreeBSD, . . 2.29. (. 2.30), Yes. (. 2.31) No, UTC. (. 2.32). . 2.30. ? Copyright & A K-C
  • 47. 2. FreeBSD 33 . 2.31. UTC . 2.32. ; Copyright & A K-C
  • 48. I. 34 ( ) . , , sysinstall. , , Yes, No, , . (. 2.33). , . , (, 18). , - -. . 2.33. ? - (. 2.34)? Yes, - root (, ) , . , , "/dev/hands": . (. 2.35) , : - (User) (Group). - - 15, (. 2.36). : Login ID , ; UID . , ; Group , ; Password Confirm Password ; Copyright & A K-C
  • 49. 2. FreeBSD 35 . 2.34. ? . 2.35. User . 2.36. Copyright & A K-C
  • 50. I. 36 Full name ; Member groups , ; Home directory ; Login shell . ( ) root. root , . K (. 37, ), . (. 2.37, ). . , , (. 2.38)? No, , , - (. . 2.5) Exit install. . 2.37. K; root Copyright & A K-C
  • 51. 2. FreeBSD 37 . 2.38. . 2.39. Yes , , , . -! , (. 2.39). K , , - . BIOS - , CDROM. Copyright & A K-C
  • 52. I. 38 2.5. - . root, , (. 2.40). . 2.40. halt - root. , , . 2.41. . 2.41. . 8. Copyright & A K-C
  • 53. 3 OpenBSD 3.1. , OpenBSD BSD- . - , 4.4BSD (FreeBSD, NetBSD), OpenBSD . , 2007 ( , ), OpenBSD BSD-. FreeBSD, 77% BSD-, OpenBSD 32% , NetBSD (16%). OpenBSD 4.8, 1 2010 . , OpenBSD, , , 4.2 ( 4.3 ). . , , : " 2010- - , - ?" Linux FreeBSD , - OpenBSD. - (, CD) FTP-, http://openbsd.org/ftp.html. install48.iso, . , i386 ( - ) : http://ftp.gamma.ru/OpenBSD/4.8/ i386/install48.iso. . , OpenBSD, - , . Copyright & A K-C
  • 54. I. 40 3.2. 3.2.1. - , -, (. 3.1): boot> . OpenBSD. . , -. : , . /var/run/dmesg.boot. . 3.1. OpenBSD (. 3.2): Welcome to OpenBSD/i386 4.8 installation program (I)nstall, (U)pgrade or (S)hell? I OpenBSD , . OK Cancel . ! - , ( ), Courier. - , , - ( ), - . Copyright & A K-C
  • 55. 3. OpenBSD 41 . 3.2. OpenBSD , , i - , (S)hell , (U)pgrade . 3.2.2. (. 3.3): Choose your keyboard layout ('?' or 'L' for list) [default] System hostname? (short form, e.g. 'foo') denhost Available network interfaces are: em0 vlan0 Which one do you wish to configure? (or 'done') [em0] IPv4 address for em0? (or 'dhcp' or 'none') [dhcp] IPv6 address for em0? (or 'rtsol' or 'none') [none] Available network interfaces are: em0 vlan0. Which one do you wish to configure? (or 'done') [done] Do you want to do any manual network configuration? [no] , , . , . , c . , ? ( - ), . ( : denhost). : Available network interfaces are: em0 vlan0 Copyright & A K-C
  • 56. I. 42 . 3.3. root , , - . em0 Intel ( ). IPv4 . DHCP- ( ), DHCP. - IP-: Issuing hostname-associated DHCP request for em0. DHCPDISCOVER on em0 to 255.255.255.255 port 67 interval 1 DHCPOFFER from 192.168.181.254 (00:50:56:f6:c1:79) DHCPREQUEST on em0 to 255.255.255.255 port 67 DHCPPACK from 192.168.181.254 (00:50:56:f6:c1:79) bound to 192.168.181.149 -- renewal in 900 seconds. IPv6- . - , . done : Available network interfaces are: em0 vlan0. Which one do you wish to configure? (or 'done') [done] ( ), ? . 3.2.3. root root ( - , ). Copyright & A K-C
  • 57. 3. OpenBSD 43 , : Password for root account? (will not echo) secret Password for root account? (again) secret 3.2.4. , - sshd ntpd, - ( X Window System), X Windows - xdm, : Start sshd(8) by default? [yes] no Start nntpd(8) by default? [no] Do you expect to run the X Window System? [yes] Do you want the X Window System to be started by xdm(1) [no] Change the default console to com0? [no] Setup a user? (center a lower-case loginname, or 'no') [no] (no), sshd . . (. 3.4). , - . adduser . , . - . . 3.4. Copyright & A K-C
  • 58. I. 44 3.2.5. - . , , - OpenBSD . - Windows XP? , (. 3.5): Available disks are: wd0. Which one is the root disk? (or 'done') [wd0] , OpenBSD, - , . ! OpenBSD , FreeBSD. , adN ( N ) IDE SATA wdN, SCSI- RAID- sdN. . 3.5. , (Whole) (Edit): Use (W)hole disk or (E)dit the MBR? [whole] - , , E fdisk, - . - , , fdisk - . - OpenBSD . Copyright & A K-C
  • 59. 3. OpenBSD 45 : , - OpenBSD, , - , W ( ) - . ( BSD) , BSD- . - , 2, FreeBSD? , - - BSD. , (. . 3.5). , - : Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] , (. . 3.5) . - , /var , , Web-, , - . 248 , , - . -, /usr - . /var 2 , /usr . , , , , . - ! C . -, - , a b. , . a - (/), b. b . , : 256512 - . , 2 . , 1 , b 2 . , C, - (disklabel): Initial label editor (enter '?' for help at any promt) > ? , , . a . : > a a offset: [63] size: [20474317] 256m Rounding to nearest cylinder: 530082 FS type: [4.2BSD] mount point: [none] / Copyright & A K-C
  • 60. I. 46 - (offset) , ( m, ), - ( ) . - , . 3.1, , . 3.1. BSD- a 256 / b 512 c c , - d 4 /usr , - , - . - e 2 /var - , -, - Web-, FTP-. , - f 2 /home , f - , , . f 256 , e. , b swap , , : > a b offset: [530145] size: [19888470] 512m Rounding to nearest cylinder: 1060290 FS type: [swap] q, - : > q Write new label?: [y] Copyright & A K-C
  • 61. 3. OpenBSD 47 3.2.6. , - : Location of sets? (cd disk ftp http or 'done') [cd] - . (. 3.6) - , CD- , cd0, . . 3.6. ? (. 3.7): bsd , , - ; bsd.rd RAM-; bsd.mp (SMP); base48.tgz OpenBSD ( ); etc48.tgz /etc ( ); misc48.tgz , ( ); . 3.7. Copyright & A K-C
  • 62. I. 48 comp48.tgz , (- ); man48.tgz ( ); game48.tgz ( ); xbase48.tgz X11 X Windows System ( ); xetc48.tgz /etc/X11 /etc/fonts ( ); xshare48.tgz X11 ( ); xfont48.tgz X11 ( ); xserv48.tgz X11. , , - . , bsd.rd -bsd.rd. all. - , done. (. 3.8). - , -. : Location of sets? (cd disk ftp http or 'done') [cd] , - . . 3.8. 3.2.7. : What timezone are you in? ('?' for list) [Canada/Mountain] ? ? (. 3.9), - Europe, ? . Copyright & A K-C
  • 63. 3. OpenBSD 49 . 3.9. 3.2.8. - , - (. 3.10). . 3.10. Copyright & A K-C
  • 64. I. 50 reboot . - , root , (. 3.11). . 3.11. Copyright & A K-C
  • 65. 4 -BSD: , 4.1. -BSD FreeBSD, , , Windows- - . -BSD " ", - . - -BSD , . , FreeBSD -BSD - , , -BSD. -BSD , , - , . . FreeBSD Linux - , -BSD . -BSD - , Skype, - . -BSD : http://rusbsd.org/. 8.0.1 "", - FreeBSD 8.1. -BSD : Pentium-II; 128 ( UFS2) 1024 ( ZFS); 4 . : 1 ; 512 (UFS2) 1,5 (ZFS); 12 ( + ). Copyright & A K-C
  • 66. I. 52 , -BSD , - , ZFS - , . 4.2. -BSD -BSD . . - . -BSD Linux Windows ( - ). , BSD : OpenBSD , -BSD . FreeBSD " " , . , -BSD FreeBSD - , . - BSD , "FreeBSD": , FreeBSD, -BSD. , -BSD. , " ", (. 4.1). : Zagruzka. , -BSD (. 4.2). . 4.1. Copyright & A K-C
  • 67. 4. -BSD: , 53 . 4.2. -BSD . - , , , 800600 (. 4.3). . 4.3. Linux Windows: , , (. 4.4), - (. 4.5). , - , -BSD. Copyright & A K-C
  • 68. I. 54 . 4.4. . 4.5. Copyright & A K-C
  • 69. 5 . BSD/Linux/Windows 5.1. ? , . - . , , , , - . , . . , - , , - | . () , . - , , , ( ), , , - . . , , ( ). - , . - . , - ? , , , ( , ). , , (, ), . 5.2. , , . - . Copyright & A K-C
  • 70. I. 56 - , . , - . - . 23 , , - . , , : - - , , , , , , , - . . - . , CD-RW , - ( ). , - , , . , 1995 ( ) - . CD-RW, (""), - . CD 700 1 ( ). - , , - CD, . DVD. - DVD : DVD 4,5 , 17 ; DVD , ; DVD . , . , , ( ) Oracle. 120 . 120 DVD , . , , , , . , - . . . , - , , "". 350 650 . , . Copyright & A K-C
  • 71. 5. . BSD/Linux/Windows 57 : 160 4045, 400 5357, 800 150160 . , , , , . : 350 45. 440 320 . , . , 60 320 (, Silicon Power). ? , (- , ) . Seagate 1,5 7200 / - 120 . DVD . - - , USB. ? , . - . - . . , , - ( 4 ) DVD DVD-RW. - , : Flash-, - . , , . 5.3. DVD DVD , - : 1. . , DVD - 1 , , 3,5 . , , . . , , , . . , - , . 2. . - , - . , Copyright & A K-C
  • 72. I. 58 , , (. 1). , , . . 3. . -, , - , . 4. . CD/DVD ( , ) . - . , , - . - , , . 5. . , , , ( ). - . . 5.4. . - - . ( ) - . . , . , , . ( 250 , , , ). - , DVD . , . , 250 , . , . , : - /etc /usr/local/etc; , ( ), /home ( - /root); Copyright & A K-C
  • 73. 5. . BSD/Linux/Windows 59 /usr/local/www/apache22/data Web-, , , . , Web- , ; (, FTP-, - , ). . , . , . . , , /etc ( /usr/loca/etc). , . . ( ). (, ) ( - /home). , /home (, , : home-1, home-2, home-3 home-4). - , , . - , . ISO- LiveCD (. . 5.5). , , . ( : , ...). , - , . ISO- LiveCD ( ) Clonezilla (. . 5.6). - . , - ( - Clonezilla). , Clonezilla FreeBSD, Linux, Windows , . ( ) , . Clonezilla - . tar (. . 5.7). tar : DVD, , . Copyright & A K-C
  • 74. I. 60 5.5. "" , LiveCD. LiveCD? , - . : . , , "" , - . - - . - /? LiveCD, , LiveCD ( - , , , LiveDVD, LiveCD) . , , . "- " . , "" tar/tgz. 40 - , . . . , , , . - , - . , - , , , ! : , LiveCD . ( ) , LiveCD ( , ), - - . , , - LiveCD, . , N ( N ). ? , . LiveCD - . 10 15 . 4 . "" , . LiveUSB. LiveCD . "" / , DVD. Copyright & A K-C
  • 75. 5. . BSD/Linux/Windows 61 , "" LiveCD / . - /home, DVD (- , , , ). 5.6. Clonezilla " " Symantec Norton Ghost. Windows . Clonezilla ( Symantec) Ghost. Clonezilla FreeBSD/Linux. LiveCD, . http://clonezilla.org/ : 10 Clonezilla SE (SE, Server Editioin) 5,6 41 . 10 . , - , . Clonezilla: ( GPL); ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs, FAT, NTFS, HFS (Mac OS), UFS (FreeBSD, NetBSD, OpenBSD), VMFS (VMware ESX), FreeBSD, MS Windows, Mac OS (Intel), Linux, NetBSD OpenBSD; LVM2 (LVM ver. 1 ); GRUB 1 2; Multicast , PXE Wake-on-LAN Clonezilla SE (Server Edition); , . Clonezilla , - , LiveCD . - . , / : 1. http://clonezilla.org/download/sourceforge/ ISO- Clonezilla Live - Clonezilla Live; Copyright & A K-C
  • 76. I. 62 2. Clonezilla Live (. 5.1) Clonezilla live. (, ), Other modes of Clonezilla live Clonezilla. Debian , - (. 5.2). 3. (. 5.3) , - , . (. 5.4) Don't touch keymap, . 4. Start Clonezilla (. 5.5), device-image (. 5.6). device-device , . 5. , ( ). local_dev, (. 5.7). ( ) SSH, NFS (Network File System, Need For Speed!) MS Windows ( samba_server). 6. , . , , , Clonezilla . 7. (. 5.8) : savedisk ; saveparts ; restoredisk ; restoreparts ; recovery-iso-zip "" . 8. , (. 5.9) , . 9. (. 5.10) ( - Linux), . - , ! 10. recovery-iso-zip (. 5.11) LiveDVD/USB, : iso DVD; zip LiveUSB; both , - LiveDVD, LiveUSB. () /home/partimag (. 5.12). . 5.13 LiveCD, . 5.14 , . Copyright & A K-C
  • 77. 5. . BSD/Linux/Windows 63 . 5.1. Clonezilla Live . 5.2. Debian Copyright & A K-C
  • 78. I. 64 . 5.3. Clonezilla . 5.4. Copyright & A K-C
  • 79. 5. . BSD/Linux/Windows 65 . 5.5. Start Clonezilla . 5.6. device-image Copyright & A K-C
  • 80. I. 66 . 5.7. . 5.8. ? Copyright & A K-C
  • 81. 5. . BSD/Linux/Windows 67 . 5.9. . 5.10. Copyright & A K-C
  • 82. I. 68 . 5.11. recovery-iso-zip . 5.12. /home/partimag Copyright & A K-C
  • 83. 5. . BSD/Linux/Windows 69 . 5.13. LiveCD . 5.14. LiveCD , Copyright & A K-C
  • 84. I. 70 ! , . (, ) , / , . Clonezilla Server Edition, - : http://clonezilla.org/ clonezilla-server-edition/. 5.7. tar tar , , , DVD . tar ( man tar), , - : tar -cvjf _.tar.bz2 , tar -cvjf homes.tar.bz2 /home 5.15 . , , , : tar -xvjf _.tar.bz2 . 5.15. Copyright & A K-C
  • 85. 5. . BSD/Linux/Windows 71 . 5.16. mc , mc (. 5.16). mc, (. 18). 5.8. , , - , Web- . , . , - . - scp: scp -r _ : , scp -r web-cp web-server:/var/www scp (secure copy) . , - sshd. . -r , - , . (web-cp), . web-sever ( IP- ), , . web-cp: tar -cvjf web-cp.tar.bz2 web-cp Copyright & A K-C
  • 86. I. 72 5.9. DVD- FreeBSD FreeBSD . Linux. . ATAPI, DVD-. /boot/loader.conf : hw.ata.atapi_dma="1" sysutils/dvd+rw-tools (. 18). growisofs, . - . , - /home/denis /dev/cd0 ( DVD-): # growisofs -dvd-compat -Z /dev/cd0 -J -R /home/denis growisofs, (man growisofs). growisofs ISO- ( - image.iso): # growisofs -dvd-compat -Z /dev/cd0=image.iso DVD-RW/DVD+RW . - : # dvd+rw-format /dev/cd0 , . , : # dvd+rw-format -blank=full /dev/cd0 ( , !) : # growisofs -Z /dev/cd0=/dev/zero , . , - . Copyright & A K-C
  • 87. 6 LiveCD 6.1. . dump 5 LiveCD Clonezilla. , - . : BSD , . - Clonezilla, . - LiveCD , - . LiveCD, , - . Clonezilla () , DVD. , , ( ) DVD. , - . Clonezilla, , - , . : , - , LiveCD FreeBSD. , , , . . , . , BSD- - BSD-: /dev/da0s1a / /dev/da0s1d /usr /dev/da0s1e /var BSD-, /tmp, LiveCD , . : # /sbin/dump -0ua -L -f- /dev/da0s1a | bzip2> /root.img.bz2 # /sbin/dump -0ua -L -f- /dev/da0s1d | bzip2> /usr.img.bz2 # /sbin/dump -0ua -L -f- /dev/da0s1e | bzip2> /var.img.bz2 Copyright & A K-C
  • 88. I. 74 dump , - bzip2. . ( - /backup /dev/da1s1a): # mkdir /backup # mount /dev/da1s1a /backup # mv /root.img.bz2 /backup # mv /usr.img.bz2 /backup # mv /var.img.bz2 /backup # umount /backup , . 12 . 6.2. LiveCD. FreeSBIE . LiveCD - FreeSBIE, - sysutils/dvd+rw-tools sysutils/cdrtools: # cd /usr/ports/sysutils # cd cdrtools # make install clean # cd .. # cd dvd+rw-tools # make install clean LiveCD: # cd /usr/ports/sysutils/freesbie # make install clean : # cp /usr/local/share/freesbie /usr/local/freesbie LiveCD : # cd /usr/local/freesbie # make iso ISO- : #### Building world for i386 architecture #### >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree ... ISO created: -rw-r--r-- 1 root wheel 86M 16 11:34 /usr/obj/FreeSBIE.iso Copyright & A K-C
  • 89. 6. LiveCD 75 LiveCD ( - ), /usr/local/freesbie/conf/freesbie.defaults.conf : MINIMAL=YES , ISO-. 6.3. . restore , ( da1s1a) - . , - () , LiveCD . , : # mkdir /backup # mount /dev/da1s1a /backup , : # mkdir /mnt/root # mkdir /mnt/usr # mkdir /mnt/var # mount /dev/da0s1a /mnt/root # mount /dev/da0s1d /mnt/usr # mount /dev/da0s1e /mnt/var /mnt/root, /mnt/usr /mnt/var: # cd /mnt/root # bunzip2 --stdout /backup/root.img.bz2 | restore -rf - # cd /mnt/usr # bunzip2 --stdout /backup/usr.img.bz2 | restore -rf - # cd /mnt/var # bunzip2 --stdout /backup/var.img.bz2 | restore -rf - bunzip2, restore, . - , restore , dump. , : # cd / # umount /backup # umount /mnt/root # umount /mnt/usr # umount /mnt/var # reboot ( - DVD). Copyright & A K-C
  • 90. 7 FreeBSD 7.1. LiveUSB. FreeBSD FreeBSD, . , BSD FreeBSD - - DVD. , FreeBSD , CD/DVD, , USB . , BIOS , . HOWTO FreeBSD . , 8.0, - , FreeBSD USB-. , FTP- ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/8.1/ FreeBSD-8.1-RELEASE-i386-memstick.img. - . : # dd if=8.1-RELEASE-i386-memstick.img of=/dev/da0 bs=10240 conv=sync if , of ( , - ). SCSI-, /dev/da0, /dev/da1. , , - /var/log/messages : # tail /var/log/messages messages USB-: Oct 14 11:29:11 denhost kernel: ugen1.2: at usbus1 Oct 14 11:29:11 denhost kernel: umass0: on usbus1 Oct 14 11:29:11 denhost kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000 Oct 14 11:29:11 denhost root: Unknown USB device: vendor 0x0951 product 0x1603 bus uhub1 Copyright & A K-C
  • 91. 7. FreeBSD 77 Oct 14 11:29:12 denhost kernel: umass0:1:0:-1: Attached to scbus1 Oct 14 11:29:12 denhost kernel: uhub_explore:611: illegal enable change, port 1 Oct 14 11:29:12 denhost kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Oct 14 11:29:12 denhost kernel: da0: Removable Direct Access SCSI-2 device , /dev/da0. . , . - , 2. , . 7.2. FreeBSD 8 FreeBSD, , 8.0. , . FreeBSD 8 - . . - Clonezilla (. 5) - , - , . FreeBSD 8.0-RELEASE (, , - ) ( ): # freebsd-update upgrade -r 8.0-RELEASE # ee /etc/rc.conf # freebsd-update install # reboot # freebsd-update install # portupgrade -af -O # freebsd-update install # reboot . - : http://www.freebsd.org/releases/8.0R/relnotes-detailed.html. . , - , NVIDIA nForce, - nfe, nve. , - /etc/rc.conf, . (, !) - rc.conf. (, "- Copyright & A K-C
  • 92. I. 78 ") "" (Apache, FTP . .) - . , NVIDIA nForce : ifconfig_nve0="" ifconfig_nfe0="" FreeBSD . , "". 6.2 8.0 : http://m.habrahabr.ru/post/77685/. 7.3. . 7.1 , FreeBSD CD/DVD, . - USB. CD/DVD. . FreeBSD . , FreeBSD, . DHCP, TFTP, NFS. FreeBSD - , FreeBSD. , , - CD/DVD? , , ,