You are on page 1of 11

developerWorks 02.09.

2005

LPI 201:
, (LPIC-2) 204
RAID
RAID?
RAID (Redundant Array of Inexpensive Disks)

.
() RAID, : RAID-0 (
), RAID-1 (), and RAID-5 (
). RAID-4 ;
RAID-5,
, .
"new-style" RAID Linux (
2.4 2.6, backport'). "Old-style" RAID,
2.0 2.2, ,
. "new-style"
0.90 RAID layer, Ingo Molnar .
RAID
RAID .
RAID. RAID
, mount
. RAID /dev/mdN
:
% mount /dev/md0 /home

RAID /etc/fstab
( , ).
RAID.
( ) RAID
. RAID
mkraid
/etc/raidtab.
mdadm, ,
RAID-
. mdadm
raidtools ( mkraid),

mkraid, , ,
LPI. ,
man mdadm
.
/etc/raidtab
/etc/raidtab RAID.
.

raiddev: , RAID (/dev/md?).


, mkfs fsck,
.
raid-disk: RAID.
0xFD, fdisk .
spare-disk: ( , )
. , raid,
, spare .

RAID-0
RAID-0 "disk striping"
/ (
raid- RAID).
/etc/raidtab RAID-0:
raiddev /dev/md0
raid-level
0
nr-raid-disks
2
nr-spare-disks 0
chunk-size
32
persistent-superblock
1
device
/dev/sda2
raid-disk
0
device
/dev/sdb2
raid-disk
1

RAID-0, /dev/md0.
32 KB /dev/md0 /dev/sda2, 32 KB
/dev/sdb2, /dev/sda2 ..
:
% sudo mkraid /dev/md0

mdadm /etc/raidtab .
RAID-1
RAID-1 "disk mirroring" .
RAID-1 ,

. RAID-1 ,
. :
raiddev /dev/md0
raid-level
1
nr-raid-disks
2
nr-spare-disks 1
persistent-superblock 1
device
/dev/sdb6
raid-disk
0
device
/dev/sdc5
raid-disk
1
device
/dev/sdd5
spare-disk
0

, /dev/md0, /dev/sdb6 /dev/sdc5.


/dev/sdd5 hot spare.
/dev/sdb6 /dev/sdc5, /dev/sdd5,
.
RAID-5
RAID-5 , ,
, ,
.

.
RAID-5; ,
degraded mode,
/, spare .
raiddev /dev/md0
raid-level
5
nr-raid-disks
7
nr-spare-disks
0
persistent-superblock 1
parity-algorithm left-symmetric
chunk-size
32
device
/dev/sda3
raid-disk
0
device
/dev/sdb1
raid-disk
1
device
/dev/sdc1
raid-disk
2
device
/dev/sdd1
raid-disk
3
device
/dev/sde1
raid-disk
4
device
/dev/sdf1
raid-disk
5
device
/dev/sdg1
raid-disk
6

mke2fs mke3fs
RAID-5 e2fs e3fs,
stride. -R stride=nn
mke2fs ext2 ,
RAID-.
chunk size 32 KB, , 32 KB
. ext2
4 KB,
array chunk. ,
:
% mke2fs -b 4096 -R stride=8 /dev/md0

RAID-5
stride.
,
persistent-superblock
RAID . New-style RAID persistent
superblock 2.4 2.6. 2.0 2.2
.
:

RAID-0: ;

RAID-1/RAID-5: , spare- (
) , .
"The Software-RAID HOWTO" Linux HOWTO project
,
hot-swap , , . , SCSI
( Firewire) , IDE .

Linux, ,
. ,
, .
,
, .

,
X11R6: XFree86,
X.Org ( , X11,
).
hot-swappable , ,
PCMCIA USB ,
.
X11
: X.Org XFree86 (,
). , XFree86 ,
X.Org
. ,
, ,

X.Org.
X11R6 ()
. , "X " - ,
, , , .. "X " -- ,
,
,
. Linux , X X
,

/.
X , X.Org,
/,
.
- . ,
X.Org/XFree86,
. X
-- --
,
. : , ,
, . X
, , Linux.

, Linux,
, .
201,
.

, lsmod, insmod modprobe ,
, rmmod. lsmod, insmod rmmod --

,
Linux. modprobe ,
insmod
rmmod .


. lspci
PCI ( ,
PCMCIA USB ). , setpci
PCI . lspnp BIOS device node
plug-and-play . lsusb USB
( setpnp).
X11 ( )
X.Org ( XFree86)
, .
, X
, ,
/etc/X11/xorg.conf ( xfree86.conf).
,
.
X.Org, xorgcfg (,
) xorgconfig
. Linux
.
SuperProbe
-. /usr/X11R6/lib/X11/Cards
-.
X11 ( )
/etc/X11/xorg.conf
"Section" ... "EndSection", ,
. : * Files:

* ServerFlags:

* Module:

* InputDevice:

* Device:

* VideoAdaptor:
Xv -
* Monitor:

* Modes:

* Screen:

* ServerLayout:

* DRI:
DRI
* Vendor:

X11 ( )
, Screen -
. , Monitor,
, :
Section "Screen"
Identifier
"Default Screen"
Device
"My Video Card"
Monitor
"Current Monitor"
DefaultDepth 24
SubSection "Display:
Depth
24
Modes
"1280x1024" "1024x768" "800x600"
EndSubSection
# more subsections and directives
Endsection

, ServerLayout,
("master") -- Screen,
InputDevice. , ,
, Device Monitor. , DPMS , ,
Modeline ( ,
/ , ,
DPMS ).

PCMCIA
PCMCIA
PCMCIA PC-Card. ,
,
hot-swap .
.
PCMCIA ,
( PCI ISA , USB ..).
PCMCIA , Wireless Ethernet , , flash-,
, SCSI- .
, PCMCIA
ISA PCI . ,
-- ,
ISA PCI ,

PCMCIA.
PCMCIA
, .
PCMCIA USB / Firewire
. , PCMCIA
( ), USB
. ,
PCMCIA, USB "dongle",
.
PCMCIA ( )
-- 2.4 -- PCMCIA
. ,
, CONFIG_HOTPLUG, CONFIG_PCMCIA
CONFIG_CARDBUS. pcmcia-cs.
pcmcia_core pcmcia PCMCIA .
yenta_socket CardBus (PCI-overPCMCIA):
% lsmod | egrep '(yenta)|(pcmcia)'
pcmcia
21380 3 atmel_cs
yenta_socket
19584 1
pcmcia_core
53568 3 atmel_cs,pcmcia,yenta_socket

PCMCIA cardmgr
/etc/pcmcia/config , .
PCMCIA ( )
PCMCIA .
Linux PCMCIA,
. cardctl
:
% cardctl ident
Socket 0:
product info: "Belkin", "11Mbps-Wireless-Notebook-NetworkAdapter"
manfid: 0x01bf, 0x3302
function: 6 (network)

pcmcia_core,
. , cardmgr
, .
:

% grep -C 1 '0x01bf,0x3302' /etc/pcmcia/config


card "Belkin FSD6020 v2"
manfid 0x01bf,0x3302
bind "atmel_cs"

atmel_cs wireless
, . ,
/var/lib/pcmcia/stab /var/run/stab, :
% cat /var/run/stab
Socket 0: Belkin FSD6020 v2
0
network atmel_cs

eth2

PCMCIA
.
, , . .
- , , ,
, .
, PCMCIA
(, ), insmod
. ,
, /etc/pcmcia/config ,
, . ,
, ,
- PCMCIA .
PCMCIA
/etc/pcmcia/, . ,
802.11b , , ,
/etc/pcmcia/wireless. ,
.
""
PCMCIA
, cardctl scheme
( ) . :
% sudo cardctl scheme foo
checking: eth2
/sbin/ifdown: interface eth2 not configured
Changing scheme to 'foo'...
Ignoring unknown interface eth2=eth2.
% cardctl scheme
Current scheme: 'foo'.

, foo,
, .
$ADDRESS:

# in /etc/pcmcia/network.opts (called by /etc/pcmcia/network)


case "$ADDRESS" in
work,*,*,*)
# definitions for network in work scheme ...
;;
default,*,*,*)
# definitions for network in default scheme ...
;;
esac

,
( cron, GUI ..).

Universal Serial Bus


USB
PCMCIA, USB
, PCMCIA. USB 127
.
USB
, -- 2.0. USB
480 MBsec. USB 1.1
, 12 MBsec. ,
, - , .
USB ( )
, USB PCMCIA.
usbcore. 2.4+,
, 2.2. usbcore,
: uhci, uhci_hcp, ohci, ohci_hcp, ehci,
ehci_hcp. , ,
. ehci ,
USB 2.0. ,
ehci ( ehci_hcp), ehci
. "The Linux USB subsystem"
. ,
, USB .
hotplug
,
USB. /proc/bus/usb/devices

USB ( ,
).
USB ( )
USB ,
/proc/. , /proc/bus/usb/
, /etc/rcS.d/S02mountvirtfs,
/etc/fstab. ,
:
# /etc/fstab
none /proc/bus/usb usbdevfs defaults 0 0

:
mount -t usbdevfs none /proc/bus/usb

USB
/etc/hotplug/, , /etc/hotplug/usb.rc /etc/hotplug/usb.agent.
USB modprobe
.
/etc/hotplug/usb/$DRIVER
.