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

Содержание

Журнал

Пятница (02/25/11)

/dev/pts/1
08:59:16
#sozdali tom otformatirovali i primauntili
bash: sozdali: command not found
/dev/pts/2
09:00:30
#stavim progu
bash: stavim: command not found
/dev/pts/1
09:00:30
#stavim progu
bash: stavim: command not found
/dev/pts/2
09:00:43
#apt-get install debootstrap
Reading package lists... Done
Building dependency tree
Reading state information... Done
debootstrap is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
/dev/pts/1
09:00:43
#apt-get install debootstrap
Reading package lists... Done
Building dependency tree
Reading state information... Done
debootstrap is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
/dev/pts/2
09:02:18
#unetbootin

/dev/pts/1
09:02:18
#unetbootin

/dev/pts/4
09:03:33
#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)
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)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
xenfs on /proc/xen type xenfs (rw)
/dev/mapper/NEWVG-debian1 on /mnt type ext3 (rw)
09:09:16
#apt-cache search live cd debian
autorun4linuxcd - Menu for Debian Live under Windows
live-magic - GUI frontend to create Debian LiveCDs, netboot images, etc.
09:09:22
#apt-cache search live cd
autorun4linuxcd - Menu for Debian Live under Windows
gcdmaster - GNOME GUI for cdrdao
crash - kernel debugging utility, allowing gdb like syntax
ezgo-accessories - EzGo Accessories
ezgo-education - EzGo Education
ezgo-games - EzGo Games
ezgo-imaging - EzGo imaging
ezgo-multimedia - EzGo multimedia
ezgo-network - EzGo network
ezgo-office - EzGo Office
...
complearn-tools - complearn machine-learning command-line utilities
browser-plugin-parole - multimedia plugin for web browsers based on Parole media player
parole-dev - development files for Parole media player
parole - media player based on GStreamer framework
python-django-dmigrations - Database migration tool for Django projects
qtemu - graphical user interface for QEMU
texlive-base - TeX Live: Essential programs and files
texlive-font-utils - TeX Live: TeX and Outline font utilities
texlive-latex-extra - TeX Live: LaTeX supplementary packages
texlive-publishers - TeX Live: Support for publishers, theses, standards, conferences, etc.
09:12:44
#apt-cache search yum
bouncy - eat the yummy veggies in the garden - game for small kids
createrepo - generates the metadata necessary for a RPM package repository
vfdata-morisawa5 - Font files for Morisawa Basic-5 type faces for pTeX
python-smartpm - Python library of the Smart Package Manager
smartpm-core - An alternative package manager that works with dpkg/rpm
smartpm - An alternative package manager that works with dpkg/rpm
python-sqlitecachec - A fast metadata parser for YUM
yum - Advanced front-end for rpm
09:12:48
#apt-cache search unet
gnunet-fuse - secure, trust-based peer-to-peer framework (fuse filesystem client)
gnunet-gtk-dbg - secure, trust-based peer-to-peer framework (GTK+ client debug)
gnunet-gtk-dev - secure, trust-based peer-to-peer framework (GTK+ client development)
gnunet-gtk - secure, trust-based peer-to-peer framework (GTK+ client)
gnunet-qt-dbg - secure, trust-based peer-to-peer framework (Qt client debug)
gnunet-qt - secure, trust-based peer-to-peer framework (Qt client)
gnunet-client - secure, trust-based peer-to-peer framework (client)
gnunet-common - secure, trust-based peer-to-peer framework (common)
gnunet-dbg - secure, trust-based peer-to-peer framework (debug)
gnunet-dev - secure, trust-based peer-to-peer framework (development)
gnunet-server - secure, trust-based peer-to-peer framework (server)
gnunet-tools - secure, trust-based peer-to-peer framework (tools)
gnunet - secure, trust-based peer-to-peer framework (meta)
libmicrohttpd5 - library embedding HTTP server functionality
postal - SMTP benchmark - the mad postman.
unetbootin-translations - translations for unetbootin distribution installer
unetbootin - installer of Linux/BSD distributions to a partition or USB drive
09:15:46
#apt-get install unetbootin
Читання переліків пакетів... Виконано
Побудова дерева залежностей
Reading state information... Виконано
Будуть встановлені наступні додаткові пакунки:
  libaudio2 libcrypt-passwdmd5-perl libdigest-sha1-perl libmysqlclient16 libqt4-dbus
  libqt4-designer libqt4-network libqt4-qt3support libqt4-script libqt4-sql
  libqt4-sql-mysql libqt4-xml libqtcore4 libqtgui4 mysql-common qt4-qtconfig syslinux
  syslinux-common unetbootin-translations
Пропоновані пакунки:
  nas libqt4-dev
НОВІ пакунки, які будуть встановлені:
  libaudio2 libcrypt-passwdmd5-perl libdigest-sha1-perl libmysqlclient16 libqt4-dbus
  libqt4-designer libqt4-network libqt4-qt3support libqt4-script libqt4-sql
  libqt4-sql-mysql libqt4-xml libqtcore4 libqtgui4 mysql-common qt4-qtconfig syslinux
  syslinux-common unetbootin unetbootin-translations
оновлено 0, встановлено 20 нових пакунків, для видалення відмічено 0 пакунків, і 10 пакунків не оновлено.
Необхідно завантажити 21,1 MB архівів.
After this operation, 51,8 MB of additional disk space will be used.
Бажаєте продовжити [Т/н]? n
Перервано.
09:16:14
#apt-get install unetbootin
Читання переліків пакетів... Виконано
Побудова дерева залежностей
Reading state information... Виконано
Будуть встановлені наступні додаткові пакунки:
  libaudio2 libcrypt-passwdmd5-perl libdigest-sha1-perl libmysqlclient16 libqt4-dbus
  libqt4-designer libqt4-network libqt4-qt3support libqt4-script libqt4-sql
  libqt4-sql-mysql libqt4-xml libqtcore4 libqtgui4 mysql-common qt4-qtconfig syslinux
  syslinux-common unetbootin-translations
Пропоновані пакунки:
  nas libqt4-dev
...
Setting up libqt4-sql (4:4.6.3-4) ...
Setting up libqt4-qt3support (4:4.6.3-4) ...
Setting up libqt4-sql-mysql (4:4.6.3-4) ...
Setting up qt4-qtconfig (4:4.6.3-4) ...
update-alternatives: using /usr/bin/qtconfig-qt4 to provide /usr/bin/qtconfig (qtconfig) in auto mode.
Setting up syslinux-common (2:4.02+dfsg-7) ...
Setting up syslinux (2:4.02+dfsg-7) ...
Setting up unetbootin (471-2) ...
Setting up unetbootin-translations (471-2) ...
Processing triggers for menu ...
09:17:20
#unetbootin
unetbootin: cannot connect to X server
09:17:27
#man unetbootin
/dev/pts/2
09:19:48
#lvs -a
  LV        VG    Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  vm-linux3 NEWVG -wi-ao 10.00g
/dev/pts/1
09:19:48
#lvs -a
  LV        VG    Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  vm-linux3 NEWVG -wi-ao 10.00g
/dev/pts/4
09:20:25
#dpkg -L unetbootin
/.
/usr
/usr/bin
/usr/bin/unetbootin
/usr/share
/usr/share/applications
/usr/share/applications/unetbootin.desktop
/usr/share/doc
/usr/share/doc/unetbootin
/usr/share/doc/unetbootin/copyright
/usr/share/doc/unetbootin/changelog.Debian.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/unetbootin.1.gz
09:21:34
#apt-get autoremove
Читання переліків пакетів... Виконано
Побудова дерева залежностей
Reading state information... Виконано
Пакунки, які будуть ВИДАÐ
ibaudio2 libcrypt-passwdmd5-perl libdigest-sha1-perl libmysqlclient16 libqt4-dbus
  libqt4-designer libqt4-network libqt4-qt3support libqt4-script libqt4-sql
  libqt4-sql-mysql libqt4-xml libqtcore4 libqtgui4 mysql-common qt4-qtconfig syslinux
  syslinux-common unetbootin-translations
оновлено 0, встановлено 0 нових пакунків, для видалення відмічено 19 пакунків, і 10 пакунків не оновлено.
After this operation, 51,0 MB disk space will be freed.
...
Removing libqt4-xml ...
Removing libqtcore4 ...
Removing mysql-common ...
Removing syslinux ...
Removing syslinux-common ...
Removing unetbootin-translations ...
Processing triggers for menu ...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
09:21:46
#aptitude

09:22:54
#echo $$
14737
09:23:50
#ls -l /proc/14737/
загалом 0
dr-xr-xr-x 2 root root 0 лют 25 09:47 attr
-r-------- 1 root root 0 лют 25 09:47 auxv
-r--r--r-- 1 root root 0 лют 25 09:47 cgroup
--w------- 1 root root 0 лют 25 09:47 clear_refs
-r--r--r-- 1 root root 0 лют 25 09:24 cmdline
-rw-r--r-- 1 root root 0 лют 25 09:47 coredump_filter
-r--r--r-- 1 root root 0 лют 25 09:47 cpuset
lrwxrwxrwx 1 root root 0 лют 25 09:47 cwd -> /root
-r-------- 1 root root 0 лют 25 09:47 environ
...
-rw-r--r-- 1 root root 0 лют 25 09:47 sched
-r--r--r-- 1 root root 0 лют 25 09:47 sessionid
-r--r--r-- 1 root root 0 лют 25 09:47 smaps
-r-------- 1 root root 0 лют 25 09:47 stack
-r--r--r-- 1 root root 0 лют 25 09:24 stat
-r--r--r-- 1 root root 0 лют 25 09:47 statm
-r--r--r-- 1 root root 0 лют 25 09:24 status
-r-------- 1 root root 0 лют 25 09:47 syscall
dr-xr-xr-x 3 root root 0 лют 25 09:47 task
-r--r--r-- 1 root root 0 лют 25 09:47 wchan
09:23:57
#mkdir /tmp/root

09:24:23
#mkdir /tmp/root/bin/

09:24:26
#cp /bin/bash /tmp/root/bin/

09:24:32
#chroot /tmp/root/ /bin/bash
chroot: failed to run command `/bin/bash': No such file or directory
09:24:45
#ldd /bin/bash
        linux-vdso.so.1 =>  (0x00007fff39bff000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007f4498930000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f449872c000)
        libc.so.6 => /lib/libc.so.6 (0x00007f44983ca000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4498b87000)
09:24:51
#mkdir /tmp/root/lib/

09:25:39
#find /lib -name linux-vdso.so.1

09:26:01
#find /usr/lib -name linux-vdso.so.1

09:26:12
#ldd /bin/cp
        linux-vdso.so.1 =>  (0x00007fffdedf1000)
        libselinux.so.1 => /lib/libselinux.so.1 (0x00007f0391b55000)
        librt.so.1 => /lib/librt.so.1 (0x00007f039194d000)
        libacl.so.1 => /lib/libacl.so.1 (0x00007f0391745000)
        libattr.so.1 => /lib/libattr.so.1 (0x00007f0391541000)
        libc.so.6 => /lib/libc.so.6 (0x00007f03911e0000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f0390fdb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0391d84000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0390dbf000)
09:26:19
#chroot /mnt
root@linux3:/# exit
exit
09:26:39
#chroot /mnt /bin/bash
root@linux3:/# ldd /bin/bash
        linux-vdso.so.1 =>  (0x00007ffffebe7000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007f9c8dae7000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f9c8d8e3000)
        libc.so.6 => /lib/libc.so.6 (0x00007f9c8d581000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9c8dd31000)
root@linux3:/# apt-get install ssh
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
...
~
~
~
~
~
~
~
~
root@linux3:/# exit
exit
09:29:11
#cp /etc/network/interfaces /mnt/etc/network/

09:29:21
#vim /mnt/etc/network/interfaces
--- /tmp/l3-saved-14737.10914.2896	2011-02-25 10:29:29.000000000 +0200
+++ /mnt/etc/network/interfaces	2011-02-25 10:29:36.000000000 +0200
@@ -8,7 +8,7 @@
 # The primary network interface
 allow-hotplug eth0
 iface eth0 inet static
-	address 192.168.15.3
+	address 192.168.15.103
 	netmask 255.255.255.0
 	network 192.168.15.0
 	broadcast 192.168.15.255
09:29:36
#umount /mnt

09:31:07
#ls /usr/share/doc/xen
xen-hypervisor-4.0-amd64/            xenstore-utils/
xen-linux-system-2.6.32-5-xen-amd64/ xen-utils-4.0/
xen-linux-system-2.6-xen-amd64/      xen-utils-common/
09:31:07
#ls /usr/share/doc/xen-utils-common/
changelog.Debian.gz  changelog.gz  copyright  examples  README.Debian
09:31:23
#ls /usr/share/doc/xen-utils-common/examples/
xm-config.xml  xmexample3.gz             xmexample.nbd
xmexample1.gz  xmexample.hvm.gz          xmexample.pv-grub.gz
xmexample2.gz  xmexample.hvm-stubdom.gz  xmexample.vti.gz
09:31:46
#vim /etc/xen/vm-linux3
09:32:42
#memory = 64
                 ls /boot/
config-2.6.32-5-amd64      initrd.img-2.6.32-5-xen-amd64  vmlinuz-2.6.32-5-xen-amd64
config-2.6.32-5-xen-amd64  System.map-2.6.32-5-amd64      xen-4.0-amd64.gz
grub                       System.map-2.6.32-5-xen-amd64
initrd.img-2.6.32-5-amd64  vmlinuz-2.6.32-5-amd64
09:34:10
#vim /etc/xen/vm-linux3
--- /tmp/l3-saved-14737.23834.2182	2011-02-25 10:34:18.000000000 +0200
+++ /etc/xen/vm-linux3	2011-02-25 10:34:28.000000000 +0200
@@ -8,10 +8,10 @@
 
 #----------------------------------------------------------------------------
 # Kernel image file.
-kernel = "/boot/vmlinuz-2.6.10-xenU"
+kernel = "/boot/vmlinuz-2.6.32-5-xen-amd64"
 
 # Optional ramdisk.
-#ramdisk = "/boot/initrd.gz"
+ramdisk = "/boot/initrd.gz"
 
 # The domain build function. Default is 'linux'.
 #builder='linux'
09:34:29
#vim /etc/xen/vm-linux3
--- /tmp/l3-saved-14737.17680.16448	2011-02-25 10:34:34.000000000 +0200
+++ /etc/xen/vm-linux3	2011-02-25 10:37:11.000000000 +0200
@@ -11,7 +11,7 @@
 kernel = "/boot/vmlinuz-2.6.32-5-xen-amd64"
 
 # Optional ramdisk.
-ramdisk = "/boot/initrd.gz"
+ramdisk = "/boot/initrd.img-2.6.32-5-xen-amd64"
 
 # The domain build function. Default is 'linux'.
 #builder='linux'
@@ -21,10 +21,10 @@
 # WARNING: Creating a domain with insufficient memory may cause out of
 #          memory errors. The domain needs enough memory to boot kernel
 #          and modules. Allocating less than 32MBs is not recommended.
-memory = 64
+memory = 128
 
 # A name for your domain. All domains must have different names.
-name = "ExampleDomain"
+name = "vm-linux3"
 
 # 128-bit UUID for the domain.  The default behavior is to generate a new UUID
 # on each call to 'xm create'.
@@ -55,7 +55,7 @@
 #
 # vif = [ '', 'bridge=xenbr1' ]
 
-vif = [ '' ]
+vif = [ 'bridge=br0' ]
 
 #----------------------------------------------------------------------------
 # Define the disk devices you want the domain to have access to, and
@@ -64,7 +64,7 @@
 # where UNAME is the device, DEV is the device name the domain will see,
 # and MODE is r for read-only, w for read-write.
 
-disk = [ 'phy:hda1,hda1,w' ]
+disk = [ 'phy:NEWVG/vm-linux3,hda1,w' ]
 
 #----------------------------------------------------------------------------
 # Define frame buffer device.
09:37:11
#grep -v ^# /etc/xen/vm-linux3 | grep -vx ''
kernel = "/boot/vmlinuz-2.6.32-5-xen-amd64"
ramdisk = "/boot/initrd.img-2.6.32-5-xen-amd64"
memory = 128
name = "vm-linux3"
vif = [ 'bridge=br0' ]
disk = [ 'phy:NEWVG/vm-linux3,hda1,w' ]
root = "/dev/hda1 ro"
extra = "4"
09:37:17
#lvrename /dev/NEWVG/debian1 /dev/NEWVG/vm-linux3
  Renamed "debian1" to "vm-linux3" in volume group "NEWVG"
09:37:40
#mount /dev/NEWVG/vm-linux3 /mnt

09:37:44
#chroot /mnt /bin/bash
root@linux3:/# apt-cache search linux modules 2.6.32 xen
linux-headers-2.6.32-5-common-xen - Common header files for Linux 2.6.32-5-xen
linux-headers-2.6.32-5-xen-amd64 - Header files for Linux 2.6.32-5-xen-amd64
linux-image-2.6.32-5-amd64 - Linux 2.6.32 for 64-bit PCs
linux-image-2.6.32-5-openvz-amd64 - Linux 2.6.32 for 64-bit PCs, OpenVZ support
linux-image-2.6.32-5-vserver-amd64 - Linux 2.6.32 for 64-bit PCs, Linux-VServer support
linux-image-2.6.32-5-xen-amd64-dbg - Debugging infos for Linux 2.6.32-5-xen-amd64
linux-image-2.6.32-5-xen-amd64 - Linux 2.6.32 for 64-bit PCs, Xen dom0 support
linux-image-2.6-xen-amd64 - Linux 2.6 for 64-bit PCs (meta-package), Xen dom0 support
linux-image-xen-amd64 - Linux for 64-bit PCs (meta-package), Xen dom0 support
...
linux-headers-2.6.32-5-xen-amd64 - Header files for Linux 2.6.32-5-xen-amd64
linux-image-2.6.32-5-amd64 - Linux 2.6.32 for 64-bit PCs
linux-image-2.6.32-5-openvz-amd64 - Linux 2.6.32 for 64-bit PCs, OpenVZ support
linux-image-2.6.32-5-vserver-amd64 - Linux 2.6.32 for 64-bit PCs, Linux-VServer support
linux-image-2.6.32-5-xen-amd64-dbg - Debugging infos for Linux 2.6.32-5-xen-amd64
linux-image-2.6.32-5-xen-amd64 - Linux 2.6.32 for 64-bit PCs, Xen dom0 support
linux-image-2.6-xen-amd64 - Linux 2.6 for 64-bit PCs (meta-package), Xen dom0 support
linux-image-xen-amd64 - Linux for 64-bit PCs (meta-package), Xen dom0 support
root@linux3:/# exit
exit
09:38:16
#dpkg -S /lib/modules/2.6.32-5-xen-amd64/
linux-image-2.6.32-5-xen-amd64: /lib/modules/2.6.32-5-xen-amd64
09:38:23
#cp -R /lib/modules/2.6.32-5-xen-amd64 /mnt/lib/modules/

09:38:46
#umount /mnt

09:45:47
#xm create -c vm-linux3
Using config file "/etc/xen/vm-linux3".
Error: Device 0 (vif) could not be connected. Could not find bridge device br0
09:46:00
#brctl show
bridge name     bridge id               STP enabled     interfaces
eth0            8000.001bfc7dbb37       no              peth0
pan0            8000.000000000000       no
09:47:29
#listxm
bash: listxm: command not found
09:47:31
#xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  5894     2     r-----   3202.9
vm-linux3                                    2   128     1     -b----      1.4
09:47:32
#ping 192.168.15.103
PING 192.168.15.103 (192.168.15.103) 56(84) bytes of data.
64 bytes from 192.168.15.103: icmp_req=1 ttl=64 time=1.92 ms
^C
--- 192.168.15.103 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.924/1.924/1.924/0.000 ms
09:47:44
#ssh root@192.168.15.103
# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
"/etc/inittab" 69 lines, 2008 characters written
root@vm-linux3:~# reboot
Broadcast message from root@vm-linux3 (pts/0) (Fri Feb 25 08:48:37 2011):
The system is going down for reboot NOW!
root@vm-linux3:~# Connection to 192.168.15.103 closed by remote host.
Connection to 192.168.15.103 closed.
09:49:12
#ls -l /etc/xen/vm-linux3
-rw-r--r-- 1 root root 7560 лют 25 10:46 /etc/xen/vm-linux3
09:58:29
#lvs -a
  LV        VG    Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  vm-linux3 NEWVG -wi-ao 10,00g
прошло 19 минут
/dev/pts/2
10:18:23
#ping 192.168.15.103
PING 192.168.15.103 (192.168.15.103) 56(84) bytes of data.
64 bytes from 192.168.15.103: icmp_req=1 ttl=64 time=5.14 ms
64 bytes from 192.168.15.103: icmp_req=2 ttl=64 time=0.107 ms
64 bytes from 192.168.15.103: icmp_req=3 ttl=64 time=0.112 ms
^C
--- 192.168.15.103 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.107/1.787/5.144/2.373 ms
/dev/pts/1
10:18:23
#ping 192.168.15.103
PING 192.168.15.103 (192.168.15.103) 56(84) bytes of data.
64 bytes from 192.168.15.103: icmp_req=1 ttl=64 time=5.14 ms
64 bytes from 192.168.15.103: icmp_req=2 ttl=64 time=0.107 ms
64 bytes from 192.168.15.103: icmp_req=3 ttl=64 time=0.112 ms
^C
--- 192.168.15.103 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.107/1.787/5.144/2.373 ms
/dev/pts/2
10:18:55
#ssh user@192.168.15.103
user@192.168.15.103's password:
Permission denied, please try again.
user@192.168.15.103's password:
Permission denied, please try again.
user@192.168.15.103's password:
/dev/pts/1
10:18:55