Журнал лабораторных работ

Содержание

Журнал

Четверг (03/25/10)

/dev/pts/12
11:06:34
#sed -i s/hvc0/tty1/ /mnt/etc/inittab

11:06:44
#cat /mnt/etc/ld.so.conf.d/libc6-xen.conf
# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 1 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg
11:07:01
#sed -i 's/cap 1/cap 0/'
sed: no input files
11:07:12
#sed -i 's/cap 1/cap 0/' /mnt/etc/ld.so.conf.d/libc6-xen.conf

11:07:25
#xm lsit
Error: Subcommand lsit not found!
Usage: xm <subcommand> [args]
Control, list, and manipulate Xen guest instances.
Common 'xm' commands:
 console              Attach to <Domain>'s console.
 create               Create a domain based on <ConfigFile>.
 new                  Adds a domain to Xend domain management
 delete               Remove a domain from Xend domain management.
 destroy              Terminate a domain immediately.
 dump-core            Dump core for a specific domain.
...
 suspend              Suspend a Xend managed domain
 top                  Monitor a host and the domains in real time.
 unpause              Unpause a paused domain.
 uptime               Print uptime for all/some domains.
 vcpu-set             Set the number of active VCPUs for allowed for
                      the domain.
<Domain> can either be the Domain Name or Id.
For more help on 'xm' see the xm(1) man page.
For more help on 'xm create' see the xmdomain.cfg(5)  man page.
For a complete list of subcommands run 'xm help'.
11:07:28
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----   1691.9
11:07:31
#xm create linux1-2.6.18 -c
Using config file "/etc/xen/linux1-2.6.18".
Error: Device 769 (vbd) could not be connected.
Device /dev/DATA/linux1 is mounted in the privileged domain,
and so cannot be mounted by a guest.
11:07:42
#umount /mnt

11:07:45
#xm create linux1-2.6.18 -c
Using config file "/etc/xen/linux1-2.6.18".
Started domain linux1
Calibrating delay using timer specific routine.. 4679.32 BogoMIPS (lpj=9358648)
Security Framework v1.0.0 initialized
SELinux:  Disabled at boot.
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
Checking 'hlt' instruction... OK.
...
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
linux10:~# free
             total       used       free     shared    buffers     cached
Mem:        131220      28088     103132          0        968       9632
-/+ buffers/cache:      17488     113732
Swap:            0          0          0
11:08:09
#xm mem-set linux1 200

11:08:37
#xm mem-set linux1 64

11:08:41
#xm console linux1
linux10:~#
linux10:~# free
             total       used       free     shared    buffers     cached
Mem:         65536      27596      37940          0        996       9644
-/+ buffers/cache:      16956      48580
Swap:            0          0          0
11:08:51
#xm mem-set linux1 100

11:08:56
#xm console linux1
linux10:~#
linux10:~# free
             total       used       free     shared    buffers     cached
Mem:        102400      28128      74272          0       1004       9644
-/+ buffers/cache:      17480      84920
Swap:            0          0          0
11:09:31
#xm mem-set linux1 150

11:09:34
#xm console linux1
linux10:~# free
             total       used       free     shared    buffers     cached
Mem:        130048      27680     102368          0       1016       9696
-/+ buffers/cache:      16968     113080
Swap:            0          0          0
11:10:14
#cat /etc/xen/linux1-2.6.18
kernel = "/boot/vmlinuz-2.6.18-6-xen-686"
ramdisk = "/boot/initrd.img-2.6.18-6-xen-686"
name = "linux1"
vif = [ 'bridge=eth0' ]
disk = [ 'phy:/dev/DATA/linux1,hda1,w' ]
root = "/dev/hda1 ro"
extra = "mem=512M"
memory = 128
maxmem = 512
11:13:13
#xm console linux1
free
             total       used       free     shared    buffers     cached
Mem:         65536      27524      38012          0       1032       9696
-/+ buffers/cache:      16796      48740
Swap:            0          0          0
linux10:~#
linux10:~# uname -a
Linux linux10 2.6.18-6-xen-686 #1 SMP Sat Dec 27 13:17:00 UTC 2008 i686 GNU/Linux
linux10:~# apt-get install htop
Reading package lists... Done
...
  htop
Install these packages without verification [y/N]? Y
Get:1 http://10.0.35.1 lenny/main htop 0.7-1 [46.8kB]
Fetched 46.8kB in 0s (3237kB/s)
Selecting previously deselected package htop.
(Reading database ... 9411 files and directories currently installed.)
Unpacking htop (from .../archives/htop_0.7-1_i386.deb) ...
Processing triggers for man-db ...
Setting up htop (0.7-1) ...
linux10:~# htop
11:13:52
#xm mem-set linux1 100

11:14:03
#xm console linux1
                                  0
                                                           1
                                                        29
linux10:~# htop
11:14:31
# Mem[|||||||||||||||||| 17/100MB] Load average: 0.15 0.04 0.01

11:14:31
#grep etch /etc/apt/sources.list
deb http://10.0.35.1:9999/debian/ etch main
11:14:44
##apt-get install linux-image-2.6.18-6-xen-686

11:14:59
#cat /etc/xen/linux1-2.6.18
kernel = "/boot/vmlinuz-2.6.18-6-xen-686"
ramdisk = "/boot/initrd.img-2.6.18-6-xen-686"
name = "linux1"
vif = [ 'bridge=eth0' ]
disk = [ 'phy:/dev/DATA/linux1,hda1,w' ]
root = "/dev/hda1 ro"
extra = "mem=512M"
memory = 128
maxmem = 512
прошло 11 минут
11:26:48
#xm lsit
Error: Subcommand lsit not found!
Usage: xm <subcommand> [args]
Control, list, and manipulate Xen guest instances.
Common 'xm' commands:
 console              Attach to <Domain>'s console.
 create               Create a domain based on <ConfigFile>.
 new                  Adds a domain to Xend domain management
 delete               Remove a domain from Xend domain management.
 destroy              Terminate a domain immediately.
 dump-core            Dump core for a specific domain.
...
 suspend              Suspend a Xend managed domain
 top                  Monitor a host and the domains in real time.
 unpause              Unpause a paused domain.
 uptime               Print uptime for all/some domains.
 vcpu-set             Set the number of active VCPUs for allowed for
                      the domain.
<Domain> can either be the Domain Name or Id.
For more help on 'xm' see the xm(1) man page.
For more help on 'xm create' see the xmdomain.cfg(5)  man page.
For a complete list of subcommands run 'xm help'.
11:26:54
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----   2824.6
linux1                                       7   100     1     -b----      7.6
11:26:57
#xm shutdown linux1

11:27:03
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----   2834.4
linux1                                       7   100     1     -b----      9.7
11:27:06
#mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
configfs on /sys/kernel/config type configfs (rw)
ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw)
11:27:09
#mount /dev/DATA/linux1 /mnt

11:27:20
#cp -R /lib/modules/2.6.18-6-xen-686 /mnt/lib/modules/

11:27:36
#xm create linux1-2.6.18 -c
Using config file "/etc/xen/linux1-2.6.18".
Error: Device 769 (vbd) could not be connected.
Device /dev/DATA/linux1 is mounted in the privileged domain,
and so cannot be mounted by a guest.
11:27:40
#umount /mnt

11:27:45
#xm create linux1-2.6.18 -c
Using config file "/etc/xen/linux1-2.6.18".
Started domain linux1
Calibrating delay using timer specific routine.. 4667.95 BogoMIPS (lpj=9335912)
Security Framework v1.0.0 initialized
SELinux:  Disabled at boot.
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 4096K
Checking 'hlt' instruction... OK.
...
Configuring network interfaces...done.
Setting console screen modes and fonts.
INIT: Entering runlevel: 2
Starting enhanced syslogd: rsyslogd.
Starting OpenBSD Secure Shell server: sshdNET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
.
Starting periodic command scheduler: crond.
Debian GNU/Linux 5.0 linux10 tty1
11:31:50
#ionice
none: prio 0
11:32:23
#ionice -h
Usage: ionice [OPTIONS] [COMMAND [ARG]...]
Sets or gets process io scheduling class and priority.
        -n      Class data (typically 0-7, lower being higher prio)
        -c      Scheduling class
                        1: realtime, 2: best-effort, 3: idle
        -p      Process pid
        -h      This help page
Jens Axboe <axboe@suse.de> (C) 2005
11:32:44
#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              19G   14G  3.5G  81% /
tmpfs                 3.9G     0  3.9G   0% /lib/init/rw
udev                   10M  812K  9.3M   8% /dev
tmpfs                 3.9G     0  3.9G   0% /dev/shm
11:33:19
#dd if=/dev/zero of=/tmp/disk bs=1024k count=2048 &
[1] 11500
11:34:05
#dd if=/dev/zero of=/tmp/disk2 bs=1024k count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 5.49312 s, 38.2 MB/s
11:34:32
#dd if=/dev/zero of=/tmp/disk bs=1024k count=2048 &
[1] 11545
11:34:36
#dd if=/dev/zero of=/tmp/disk2 bs=1024k count=20
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 0.368214 s, 57.0 MB/s
/dev/pts/0
11:37:59
#screen
/dev/pts/2
11:39:34
#xm create linux1-2.6.18
Using config file "/etc/xen/linux1-2.6.18".
Started domain linux1
11:39:41
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----    128.3
linux1                                       1   128     1     -b----      1.7
11:39:43
#ps aux | less
/dev/pts/9
11:40:10
#screen -x
/dev/pts/2
11:40:16
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----    164.3
linux1                                       1   128     1     -b----      6.8
11:40:18
#ionice -p 4034
none: prio 0
11:40:33
#ionice -p 4034 -c 3

11:40:38
#ionice -h
Usage: ionice [OPTIONS] [COMMAND [ARG]...]
Sets or gets process io scheduling class and priority.
        -n      Class data (typically 0-7, lower being higher prio)
        -c      Scheduling class
                        1: realtime, 2: best-effort, 3: idle
        -p      Process pid
        -h      This help page
Jens Axboe <axboe@suse.de> (C) 2005
11:40:45
#ionice -p 4034 -c 2 -n 2

11:40:53
#apt-cache search db-ioband

/dev/pts/11
11:41:07
#screen -x
/dev/pts/2
11:42:23
#apt-cache search ioband

11:42:27
#lspci
00:00.0 Host bridge: Intel Corporation 82P965/G965 Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82G965 Integrated Graphics Controller (rev 02)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2)
00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)
00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02)
01:00.0 IDE interface: JMicron Technologies, Inc. JMB368 IDE controller
02:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)
03:00.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
/dev/pts/13
11:42:42
#mount /dev/DATA/linux1 /mnt

11:42:45
#screen -x
/dev/pts/2
11:43:54
#ifconfig | less
11:45:17
#ifconfig -a | less
11:45:38
#lspci
00:00.0 Host bridge: Intel Corporation 82P965/G965 Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82G965 Integrated Graphics Controller (rev 02)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2)
00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)
00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02)
01:00.0 IDE interface: JMicron Technologies, Inc. JMB368 IDE controller
02:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)
03:00.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
11:45:59
#find /sys -name \*03:00.0\*
/sys/devices/pci0000:00/0000:00:1e.0/0000:03:00.0
/sys/bus/pci/devices/0000:03:00.0
/sys/bus/pci/drivers/e1000/0000:03:00.0
11:46:23
#ls -l /sys/bus/pci/drivers/e1000/
total 0
lrwxrwxrwx 1 root root    0 2010-03-25 12:46 0000:03:00.0 -> ../../../../devices/pci0000:00/0000:00:1e.0/0000:03:00.0
--w------- 1 root root 4096 2010-03-25 12:47 bind
lrwxrwxrwx 1 root root    0 2010-03-25 12:47 module -> ../../../../module/e1000
--w------- 1 root root 4096 2010-03-25 12:47 new_id
--w------- 1 root root 4096 2010-03-25 14:37 uevent
--w------- 1 root root 4096 2010-03-25 12:47 unbind
11:47:21
#echo -n 0000:03:00.0 > /sys/bus/pci/drivers/e1000/unbind

11:47:46
#ls -l /sys/bus/pci/drivers/pciback/
total 0
--w------- 1 root root 4096 2010-03-25 12:48 bind
lrwxrwxrwx 1 root root    0 2010-03-25 12:46 module -> ../../../../module/pciback
--w------- 1 root root 4096 2010-03-25 12:48 new_id
--w------- 1 root root 4096 2010-03-25 12:48 new_slot
-rw------- 1 root root 4096 2010-03-25 12:48 permissive
-rw------- 1 root root 4096 2010-03-25 12:48 quirks
--w------- 1 root root 4096 2010-03-25 12:48 remove_slot
-r-------- 1 root root 4096 2010-03-25 12:48 slots
--w------- 1 root root 4096 2010-03-25 14:37 uevent
--w------- 1 root root 4096 2010-03-25 12:48 unbind
11:48:27
#echo -n 0000:03:00.0 > /sys/bus/pci/drivers/pciback/bind

11:48:38
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----    581.8
linux1                                       1   128     1     -b----      6.9
11:49:00
#xm shutdown linux1

11:49:04
#vi /etc/xen/linux1-2.6.18
--- /tmp/l3-saved-3718.10382.5904	2010-03-25 12:49:09.000000000 +0200
+++ /etc/xen/linux1-2.6.18	2010-03-25 12:49:23.000000000 +0200
@@ -7,4 +7,4 @@
 extra = "mem=512M"
 memory = 128
 maxmem = 512
-
+pci=['03:00.0']
11:49:23
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----    606.3
11:49:24
#xm create linux1
Using config file "/etc/xen/linux1".
Started domain linux1
11:49:29
#xm destroy linux1

11:49:35
#xm create linux1-2.6.18
Using config file "/etc/xen/linux1-2.6.18".
Started domain linux1
11:49:41
#xm console linux1 -c
Error: option -c not recognized
Usage: xm console [-q|--quiet] <Domain>
Attach to <Domain>'s console.
  -q, --quiet                    Do not print an error message if the
                                 domain does not exist
11:49:46
#xm console linux1
pcifront pci-0: Creating PCI Frontend Bus 0000:00
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 32768 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 32768)
TCP reno registered
audit: initializing netlink socket (disabled)
audit(1269521381.346:1): initialized
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
...
Selecting previously deselected package libpci3.
(Reading database ... 9423 files and directories currently installed.)
Unpacking libpci3 (from .../libpci3_1%3a3.0.0-6_i386.deb) ...
Selecting previously deselected package pciutils.
Unpacking pciutils (from .../pciutils_1%3a3.0.0-6_i386.deb) ...
Processing triggers for man-db ...
Setting up libpci3 (1:3.0.0-6) ...
Setting up pciutils (1:3.0.0-6) ...
linux10:~# lspci
00:00.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
прошло 76 минут
13:06:36
#m-a a-i drbd
                          ┌────────────────────┤ Updating cached package data ├─────────────────────┐
                          ┠                          ..                                             │
                          │                                                                         │
                          │                                                                         │
                          │                                  0%                                     │
                          │                                                                         │
                          └─────────────────────────────────────────────────────────────────────────┘
Updated infos about 1 packages
13:07:36
#m-a a-i drbd8
                          ┠                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                                                         │
                          │                                100%                                     │
                          │                                                                         │
                          └─────────────────────────────────────────────────────────────────────────┘
Done with /usr/src/drbd8-2.6.26-2-xen-686_8.0.14-2+lenny1+2.6.26-21lenny4_i386.deb .
dpkg -Ei /usr/src/drbd8-2.6.26-2-xen-686_8.0.14-2+lenny1+2.6.26-21lenny4_i386.deb
Selecting previously deselected package drbd8-2.6.26-2-xen-686.
(Reading database ... 116493 files and directories currently installed.)
Unpacking drbd8-2.6.26-2-xen-686 (from .../drbd8-2.6.26-2-xen-686_8.0.14-2+lenny1+2.6.26-21lenny4_i386.deb) ...
Setting up drbd8-2.6.26-2-xen-686 (2:8.0.14-2+lenny1+2.6.26-21lenny4) ...
13:08:25
#modprobe drbd

13:08:29
#cat /proc/drbd
version: 8.0.14 (api:86/proto:86)
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33
13:08:33
#/etc/init.d/drbd restart
Restarting all DRBD resources.
13:09:50
#cd /etc/rc2.d/

13:10:00
#ls
README          S14avahi-daemon  S20iscsitarget    S20xend        s26network-manager             S89anacron    S99stop-bootlogd
S05loadcpufreq  S16ssh           S20kerneloops     S21xendomains  S26network-manager-dispatcher  S89atd
S10rsyslog      S19cpufrequtils  S20kvm            S24dhcdbd      S30gdm                         S89cron
S12acpid        S20cups          S20nfs-common     S24hal         S30system-tools-backends       S99rc.local
S12dbus         S20exim4         S20openbsd-inetd  S25mdadm       S70drbd                        S99rmnologin
13:10:00
#ls *ocfs*
ls: cannot access *ocfs*: No such file or directory
13:10:09
#ls *o2b*
ls: cannot access *o2b*: No such file or directory
13:10:12
#vi /etc/fstab
--- /tmp/l3-saved-3718.3242.24141	2010-03-25 14:10:29.000000000 +0200
+++ /etc/fstab	2010-03-25 14:10:36.000000000 +0200
@@ -8,5 +8,5 @@
 /dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
 LABEL=LV4	/data/lv4	ext3	defaults	0	0
 
-/dev/drbd1	/ocfs/vol1	ocfs2   defaults	0	0
-/dev/drbd2	/ocfs/vol2	ocfs2   defaults	0	0
+#/dev/drbd1	/ocfs/vol1	ocfs2   defaults	0	0
+#/dev/drbd2	/ocfs/vol2	ocfs2   defaults	0	0
13:10:45
#cat /proc/drbd
version: 8.0.14 (api:86/proto:86)
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33
 1: cs:WFConnection st:Secondary/Unknown ds:UpToDate/DUnknown C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:45 lo:0 pe:0 ua:0 ap:0
        resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0
        act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
 2: cs:WFConnection st:Secondary/Unknown ds:UpToDate/DUnknown C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:38 lo:0 pe:0 ua:0 ap:0
        resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0
        act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
13:12:05
#less /var/log/messages
13:12:23
#drbdadm secondary all

13:12:34
#drbdadm -- --discard-my-data connect all

13:13:30
#/etc/init.d/drbd restart
Restarting all DRBD resources.
13:13:51
#cat /proc/drbd
version: 8.0.14 (api:86/proto:86)
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33
 1: cs:SyncTarget st:Secondary/Secondary ds:Inconsistent/UpToDate C r---
    ns:0 nr:95360 dw:95360 dr:0 al:0 bm:50 lo:0 pe:0 ua:0 ap:0
        [=>..................] sync'ed: 11.2% (818048/913408)K
        finish: 0:01:16 speed: 10,592 (10,592) K/sec
        resync: used:0/61 hits:5954 misses:6 starving:0 dirty:0 changed:6
        act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
 2: cs:SyncTarget st:Secondary/Secondary ds:Inconsistent/UpToDate C r---
    ns:0 nr:97280 dw:97280 dr:0 al:0 bm:47 lo:0 pe:0 ua:0 ap:0
        [=>..................] sync'ed: 10.0% (922624/1019904)K
        finish: 0:01:25 speed: 10,808 (10,808) K/sec
        resync: used:0/61 hits:6070 misses:10 starving:0 dirty:0 changed:10
        act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
13:14:01
#drbdadm primary r2

13:14:47
#cat /proc/drbd
version: 8.0.14 (api:86/proto:86)
GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33
 1: cs:SyncTarget st:Secondary/Secondary ds:Inconsistent/UpToDate C r---
    ns:0 nr:577664 dw:577664 dr:0 al:0 bm:86 lo:0 pe:0 ua:0 ap:0
        [===========>........] sync'ed: 63.9% (335744/913408)K
        finish: 0:00:30 speed: 10,852 (10,312) K/sec
        resync: used:0/61 hits:36062 misses:42 starving:0 dirty:0 changed:42
        act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
 2: cs:SyncTarget st:Primary/Secondary ds:Inconsistent/UpToDate C r---
    ns:0 nr:579072 dw:579072 dr:0 al:0 bm:80 lo:1 pe:16 ua:0 ap:0
        [==========>.........] sync'ed: 57.2% (440832/1019904)K
        finish: 0:00:40 speed: 10,832 (10,340) K/sec
        resync: used:1/61 hits:36165 misses:43 starving:0 dirty:0 changed:43
        act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
13:14:48
#mkfs.ext3 /dev/drbd2
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
13:15:05
#mount /dev/drbd2 /mnt

13:16:29
#mkdir /mnt2

13:16:33
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  7979     2     r-----   5173.3
linux1                                       3   128     1     -b----      8.4
13:16:35
#xm shutdown linux1

13:16:40
#mount /dev/DATA/linux1 /mnt2/

13:17:40
#apt-get install rsync
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  rsync
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 328kB of archives.
After this operation, 602kB of additional disk space will be used.
Get:1 http://10.0.35.1 lenny/main rsync 3.0.3-2 [328kB]
Fetched 328kB in 0s (5745kB/s)
Selecting previously deselected package rsync.
(Reading database ... 116498 files and directories currently installed.)
Unpacking rsync (from .../rsync_3.0.3-2_i386.deb) ...
Processing triggers for man-db ...
Setting up rsync (3.0.3-2) ...
13:17:48
#rsync -a /mnt2/ /mnt/

13:18:49
#umount /mnt2

Файлы

  • /etc/xen/linux1-2.6.18
  • /mnt/etc/ld.so.conf.d/libc6-xen.conf
  • /proc/drbd
  • /etc/xen/linux1-2.6.18
    >
    kernel = "/boot/vmlinuz-2.6.18-6-xen-686"
    ramdisk = "/boot/initrd.img-2.6.18-6-xen-686"
    name = "linux1"
    vif = [ 'bridge=eth0' ]
    disk = [ 'phy:/dev/DATA/linux1,hda1,w' ]
    root = "/dev/hda1 ro"
    extra = "mem=512M"
    memory = 128
    maxmem = 512
    
    /mnt/etc/ld.so.conf.d/libc6-xen.conf
    >
    # This directive teaches ldconfig to search in nosegneg subdirectories
    # and cache the DSOs there with extra bit 1 set in their hwcap match
    # fields. In Xen guest kernels, the vDSO tells the dynamic linker to
    # search in nosegneg subdirectories and to match this extra hwcap bit
    # in the ld.so.cache file.
    hwcap 1 nosegneg
    
    /proc/drbd
    >
    version: 8.0.14 (api:86/proto:86)
    GIT-hash: bb447522fc9a87d0069b7e14f0234911ebdab0f7 build by phil@fat-tyre, 2008-11-12 16:40:33
     1: cs:SyncTarget st:Secondary/Secondary ds:Inconsistent/UpToDate C r---
        ns:0 nr:577664 dw:577664 dr:0 al:0 bm:86 lo:0 pe:0 ua:0 ap:0
            [===========>........] sync'ed: 63.9% (335744/913408)K
            finish: 0:00:30 speed: 10,852 (10,312) K/sec
            resync: used:0/61 hits:36062 misses:42 starving:0 dirty:0 changed:42
            act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
     2: cs:SyncTarget st:Primary/Secondary ds:Inconsistent/UpToDate C r---
        ns:0 nr:579072 dw:579072 dr:0 al:0 bm:80 lo:1 pe:16 ua:0 ap:0
            [==========>.........] sync'ed: 57.2% (440832/1019904)K
            finish: 0:00:40 speed: 10,832 (10,340) K/sec
            resync: used:1/61 hits:36165 misses:43 starving:0 dirty:0 changed:43
            act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:0
    

    Статистика

    Время первой команды журнала11:06:34 2010- 3-25
    Время последней команды журнала13:18:49 2010- 3-25
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, % 8.91
    Процент синтаксически неверно набранных команд, % 0.00
    Суммарное время работы с терминалом *, час 0.92
    Количество командных строк в единицу времени, команда/мин 1.82
    Частота использования команд
    xm33|==============================| 30.84%
    cat7|======| 6.54%
    ionice6|=====| 5.61%
    ls5|====| 4.67%
    mount5|====| 4.67%
    screen4|===| 3.74%
    dd4|===| 3.74%
    less4|===| 3.74%
    umount3|==| 2.80%
    sed3|==| 2.80%
    drbdadm3|==| 2.80%
    ifconfig2|=| 1.87%
    m-a2|=| 1.87%
    echo2|=| 1.87%
    /etc/init.d/drbd2|=| 1.87%
    lspci2|=| 1.87%
    vi2|=| 1.87%
    apt-cache2|=| 1.87%
    mkdir1|| 0.93%
    unbind1|| 0.93%
    cp1|| 0.93%
    mkfs.ext31|| 0.93%
    Mem[1|| 0.93%
    cd1|| 0.93%
    apt-get1|| 0.93%
    find1|| 0.93%
    ps1|| 0.93%
    bind1|| 0.93%
    #apt-get1|| 0.93%
    df1|| 0.93%
    modprobe1|| 0.93%
    rsync1|| 0.93%
    grep1|| 0.93%
    100MB]1|| 0.93%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$