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

Содержание

Журнал

Четверг (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