FreeBSD: administrativnye osobennosti
Nachinat' nado s FreeBSD Handbook
Proekt po perevodu dokumentacii FreeBSD www.freebsd.org.ua
Kak zagruzit'sya s nestandartnogo boot-puti
F1
boot: 0:ad(2f)
kak sdelat' ftp-only yuzera s chroot'om v ego domashnem kataloge
Esli obychnyj ftpd, to
propisat' emu shell '/bin/date' ili '/usr/bin/true' i vpisat' ego v
'/etc/shells'
- vpisat' ego v '/etc/ftpchroot'
Dlya proftpd vpisat' v /usr/local/etc/proftpd.conf
DefaultRoot ~
# AllowStoreRestart on
# AllowRetrieveRestart on
# DirFakeUser on ~
# UseFtpUsers off
# MaxClientsPerHost 5
kakoj komandoj sozdaetsya novyj razdel diska
(v processe ustanovki vs£ prohodit gladko).
man sysinstall
man newfs
gde zhivut rc-skripty nachal'noj zagruzki
/etc/rc.* - eto sistemnye, ih - ne trogat'!
/usr/local/etc/rc.d/*.sh - vot syuda budut popadat' vashi.
CHtoby garantirovano otrabatyval fsck posle reseta
fsck_y_enable="YES"
v /etc/rc.conf
chto tam vmesto /etc/hosts.allow
tcp_wrapper vstroen v inetd
man inetd
man 5 hosts_access
man 5 hosts_options
upravlyaetsya cherez /etc/hosts.allow
Redaktirovanie svojstv yuzera. vi /etc/passwd ne rabotaet
vipw
vi /etc/rc.conf
# hostname new_hostname
raskommentirovat'
hostname="new_hostname"
man ndc
ndc reload
Klassicheskaya shema dlya BSD-yader
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html
http://freebsd.org.ru/how-to/kernelconfig.html
cd /usr/src/sys/i386/config/
cp GENERIC YOURKERNEL
/usr/sbin/config YOURKERNEL
cd ../../compile/YOURKERNEL
make depend && make
# teper' vzdrognul, podumali, i...
make install
Ozhivlyaem ethernet Intel82562 Express Pro 100 na 865 materyah
http://www.freebsd.org/cgi/query-pr.cgi?pr=53228
Intel D865GBFL motherboard (AA Revision C25843-401)
Integrated LAN with Intel 82562EZ PLC
2.4C GHz Pentium 4 processor (800MHz, HT)
FreeBSD 4.8-RELEASE -- GENERIC kernel
(although, would presumably happen with any kernel with the current
fxp driver)
Version info from if_fxp.c:
* $FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.110.2.28 2003/01/28 11:17:33 sanpei Ex
p $
Relevant output from 'pciconf -lv':
none4@pci1:8:0: class=0x020000 card=0x302f8086 chip=0x10508086 rev=0x01 hdr=0x00
vendor = 'Intel Corporation'
class = network
subclass = ethernet
Description
The fxp driver fails to recognize the integrated Intel 82562EZ LAN on the
Intel D865GBFL motherboard. If my diagnosis is correct, this is the result
of this version of the 82562 chip reporting a new PCI "chip id", as has
happened before (see kern/39974).
How-To-Repeat
Install 4.8-RELEASE on a system with an Intel D865GBFL motherboard (the AA
Revision on the board in question was C25843-401). During and after
installation, the kernel (specifically the fxp driver) fails to detect the
on-board Intel 82562 LAN.
Fix
Add an entry to the fxp_ident_table array in sys/dev/fxp/if_fxp.c for the
new PCI chip id and re-build the kernel. Here's a patch:
--- if_fxp.c Wed Jun 11 16:36:59 2003
+++ if_fxp.c-patched Wed Jun 11 16:36:30 2003
@@ -165,6 +165,7 @@
{ 0x103C, "Intel Pro/100 Ethernet" },
{ 0x103D, "Intel Pro/100 Ethernet" },
{ 0x103E, "Intel Pro/100 Ethernet" },
+ { 0x1050, "Intel Pro/100 Ethernet" },
{ 0x1059, "Intel Pro/100 M Mobile Connection" },
{ 0, NULL },
};
IDE-diski:
/dev/ad0 (numeraciya s 0)
/dev/ad1 ...
SCSI-diski:
/dev/da0 (numeraciya s 0)
/dev/da1 ...
Razdely na diske (oni zhe - slajsy)
Dlya razmetki ispol'zuetsya fdisk s dikimi klyuchami
/dev/ad0s1 (numeraciya s 1-go)
/dev/ad0s2 ...
BSD-subsections vnutri razdela
Dlya razmetki ispol'zuetsya disklabel s dikimi klyuchami
/dev/ae0s2e (numeraciya ot e do h, abcd - sluzhebnye podsekcii)
/dev/ae0s2f ...
Vprochem, vruchnuyu eti komandy sovershenno neoperabel'ny, vmesto nih
ispol'zuetsya administrativnyj frontend /stand/sysinstall
USB-Floppi-diski (prikidyvayutsya SCSI-diskami)
/dev/de0
IDE-DVD/CDROM
/dev/acd0c
Tipy fajlovyh sistem
ufs
ufs2 (nachinaya s 5.1 RELEASE)
iso9660
msdos
Konfigurator
/stand/sysinstall
Prosto konfigur
/etc/rc.conf
Posmotret'
sysctl -a|grep ip
Zadat' v onlajne
sysctl net.inet.icmp.icmplim=400
Dlya postoyannoj ustanovki zapisat' v /etc/sysctl.conf
peremennaya=znachenie
net.inet.icmp.icmplim=400
kern.maxfiles=32768
net.inet.ip.portrange.randomized=0
net.inet.ip.portrange.first=49152
net.inet.ip.portrange.last=65535
kern.ipc.somaxconn=4096
Readonly parametry pomenyat' cherez /etc/sysctl.conf ne udastsya.
Ih my zapisyvaem v
/boot/loader.conf
kern.ipc.nmbclusters="32768"
kern.ipc.nmbufs="131072"
CHast' parametrov zadaetsya v /usr/src/sys/i386/config/LINT
A mozhno dopisat' ih v YOURKERNEL
Naprimer vpolne razumno smotryatsya
maxusers 512
options NMBUFS=16384
options NMBCLUSTERS=32768
Kak smotret' temperaturu processora, skorost' vrashcheniya ventilyatorov
lmmon iz portov.
consolehm
healthd
Makefiles dlya ustanovki paketov lezhat v /usr/ports
Dlya installyacii paketa xyz:
locate xyz | grep /usr/ports # opredelyaem ego portovuyu direktoriyu
cd /usr/ports/whereitis/xyz # i perehodim v nee
make install
esli ne hotim kachat' paket iz interneta - zaranee kladem ego v
/usr/ports/distfiles
ili zhe prosto
export PACKAGEROOT='ftp://ftp.*blizhajshee zerkalo*.freebsd.org'
pkg_add -r package_short_name # (imya papki v portah, kak pravilo)
A eshche est'
/usr/ports/sysutils/portupgrade
Kak obnovit' derevo portov
DLya nachala ego nado prosto ustanovit'. Dlya etogo
/sbin/sysinstall
Configuration
Distribution
Ports i ustanavlivaem ih iz seti
Potom sobiraem i stavim cvsup
/usr/ports/net/cvsup-without-gui
make install
man cvsup # i vnimatel'no chitaem
Zatem sozdaem fajl ~/sup/ports-supfile # chto brat' i otkuda
###########################################################
*default host=cvsup6.ru.FreeBSD.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default release=cvs delete use-rel-suffix compress
*default compress
ports-all
###########################################################
Zatem sozdaem fajl ~/sup/refuse # spisok, chego ne brat'
doc/da_*
doc/de_*
doc/es_*
doc/el_*
doc/fr_*
doc/it_*
doc/ja_*
doc/nl_*
doc/no_*
doc/pl_*
doc/pt_*
doc/ru_*
doc/sr_*
doc/zh_*
ports/arabic
ports/chinese
ports/french
ports/german
ports/hebrew
ports/hungarian
ports/japanese
ports/korean
ports/polish
ports/portuguese
# ports/russian
ports/ukrainian
ports/vietnamese
# ports/x11
# ports/x11-clocks
# ports/x11-fm
# ports/x11-fonts
# ports/x11-servers
# ports/x11-toolkits
# ports/x11-wm
# ports/x11-themes
##########################################
i nakonec
cvsup ~/sup/ports-supfile # chto brat' i otkuda
Kak naznachit' IP-alias na setevoj interfejs
Odnorazovaya operaciya
ifconfig fxp0 alias 1.2.3.4 netmask 0xffffffff # dobavit'
ifconfig fxp0 -alias 1.2.3.4 # ubrat'
Na postoyannoj osnove:
/etc/rc.conf
ifconfig_fxp0_alias0="inet 81.19.6.18 netmask 0xffffffff"
ifconfig_fxp0_alias1="inet 81.19.6.19 netmask 0xffffffff"
flag schg -- system immutable
ls -lo /path/to/file # posmotret'
chflags 0 /path/to/file # sbrosit'
What do I do when I have bad blocks on my hard drive?
With SCSI drives, the drive should be capable of re-mapping these automati
cally. However, many drives are shipped with this feature disabled, for some
mysterious reason...
To enable this, you will need to edit the first device page mode, which can
be done on FreeBSD by giving the command (as root)
# scsi -f /dev/rsd0c -m 1 -e -P 3
S IDE-shnymi diskami mozhet projti takoj variant
fsck -y /dev/ad0s1e
** /dev/ad0s1e
** Last Mounted on /home/new
** Phase 1 - Check Blocks and Sizes
CANNOT READ: BLK 204513248
UNEXPECTED SOFT UPDATE INCONSISTENCY
mount -f /dev/ad0s1e /fs
mkdir /fs1/BAD-DIR
badsect /fs1/BAD-DIR 204513248
umount /fs1
fsck -y /dev/ad0s1e
Posle remonta bitye sektora budut lezhat' v porozhdennyh fajlah, s imenami
obrazovannymi iz nomerov bityh sektorov, udalyat' kotorye konechno-zhe ne nado.
Fokus rabotaet tol'ko esli bitye sektora prihodyatsya na bloki dannyh ili
free-list
mount -f /dev/ad0s1e /fs1
ls -al /fs1/BAD-DIR
-rw-r--r-- 1 root wheel 1428509 Sep 17 2004 204513248
Last-modified: Wed, 28 Jun 2006 16:50:59 GMT