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

Содержание

Журнал

Понедельник (06/01/09)

/dev/pts/3
08:58:12
#lvremove
  Please enter one or more logical volume paths
  Run `lvremove --help' for more information.
08:58:17
#lvremove /dev/sdb
  Volume group "sdb" not found
08:58:24
#lvremove TURBO /dev/sdb
Do you really want to remove active logical volume "vol1"? [y/n]: y
  Logical volume "vol1" successfully removed
Do you really want to remove active logical volume "vol2"? [y/n]: y
  Logical volume "vol2" successfully removed
  Volume group "sdb" not found
08:58:42
#vgremove TURBO /dev/sdb
  Volume group "TURBO" successfully removed
  Volume group "sdb" not found
/dev/pts/0
08:58:50
#screen -x
/dev/pts/3
08:58:52
#pvremove /dev/sdb
  Physical Volume /dev/sdb not found
/dev/pts/0
08:58:54
#screen -x
/dev/pts/3
08:59:22
#fdisk /dev/sds
Unable to open /dev/sds
08:59:52
#fdisk /dev/sda
The number of cylinders for this disk is set to 9729.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): 1
1: unknown command
Command action
   a   toggle a bootable flag
...
/dev/sda1               1        2432    19535008+  83  Linux
/dev/sda4            2433        6080    29302560    5  Extended
/dev/sda5            2433        6080    29302528+  83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Устройство или ресурс занято.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
09:00:43
#fdisk -lu
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    19551104     9775521   83  Linux
/dev/sdb4        19551105    39102209     9775552+   5  Extended
/dev/sdb5        19551168    29334689     4891761   83  Linux
/dev/sdb6        29334753    31310684      987966   83  Linux
09:00:46
#fdisk -lu /dev/sda
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
09:01:10
#fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2432    19535008+  83  Linux
/dev/sda4            2433        6080    29302560    5  Extended
/dev/sda5            2433        6080    29302528+  83  Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1217     9775521   83  Linux
/dev/sdb4            1218        2434     9775552+   5  Extended
/dev/sdb5            1218        1826     4891761   83  Linux
/dev/sdb6            1827        1949      987966   83  Linux
09:01:49
#df -k
Файловая система     1K-блоков      Исп  Доступно  Исп% смонтирована на
tmpfs                  1618848         0   1618848   0% /lib/init/rw
udev                     10240       120     10120   2% /dev
tmpfs                  1618848         4   1618844   1% /dev/shm
rootfs                19228276   2112944  16138584  12% /
09:01:59
#df -h
Файловая система      Разм  Исп  Дост  Исп% смонтирована на
tmpfs                 1,6G     0  1,6G   0% /lib/init/rw
udev                   10M  120K  9,9M   2% /dev
tmpfs                 1,6G  4,0K  1,6G   1% /dev/shm
rootfs                 19G  2,1G   16G  12% /
09:02:05
#fdisk -lu /dev/sda
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
09:02:24
#fdisk -lu
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    19551104     9775521   83  Linux
/dev/sdb4        19551105    39102209     9775552+   5  Extended
/dev/sdb5        19551168    29334689     4891761   83  Linux
/dev/sdb6        29334753    31310684      987966   83  Linux
09:06:18
#fdisk -lu
                           /dev/sdb
The number of cylinders for this disk is set to 38913.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): 1
1: unknown command
Command action
...
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1217     9775521   83  Linux
/dev/sdb4            1218        4865    29302560    5  Extended
/dev/sdb5            1218        4865    29302528+  83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
09:11:12
#fdisk -lu
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    19551104     9775521   83  Linux
/dev/sdb4        19551105    78156224    29302560    5  Extended
/dev/sdb5        19551168    78156224    29302528+  83  Linux
09:11:16
#fdisk /dev/sdb
The number of cylinders for this disk is set to 38913.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): 1
1: unknown command
Command action
   a   toggle a bootable flag
...
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4864    39070048+  83  Linux
/dev/sdb4            4865        8512    29302560    5  Extended
/dev/sdb5            4865        8512    29302528+  83  Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
09:13:07
#fdisk -lu
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    78140159    39070048+  83  Linux
/dev/sdb4        78140160   136745279    29302560    5  Extended
/dev/sdb5        78140223   136745279    29302528+  83  Linux
09:13:12
#fdisk -lu /dev/sda1
Disk /dev/sda1: 20.0 GB, 20003848704 bytes
255 heads, 63 sectors/track, 2431 cylinders, total 39070017 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000
Disk /dev/sda1 doesn't contain a valid partition table
09:13:40
#mount
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)
rootfs on / type rootfs (rw)
09:13:49
#fdisk /dev/sdb
The number of cylinders for this disk is set to 38913.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): 1
1: unknown command
Command action
   a   toggle a bootable flag
...
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (2434-6081, default 2434):
Using default value 2434
Last cylinder or +size or +sizeM or +sizeK (2434-6081, default 6081): +30G
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
09:15:19
#fdisk -lu
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960cc0f0
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    39070079    19535008+  83  Linux
/dev/sda4        39070080    97675199    29302560    5  Extended
/dev/sda5        39070143    97675199    29302528+  83  Linux
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x35ea4cae
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    39086144    19543041   83  Linux
/dev/sdb4        39086145    97691264    29302560    5  Extended
/dev/sdb5        39086208    97691264    29302528+  83  Linux
09:15:25
#dd if=/dev/zero of=/disk2.img count=1 seek=200 bs=1024k
1+0 записей считано
1+0 записей написано
 скопировано 1048576 байт (1,0 MB), 0,0045159 c, 232 MB/c
09:19:10
#modprobe loop

09:19:29
#losetup /dev/loop1 /disk1.img
/disk1.img: Нет такого файла или каталога
09:19:37
#ls -l
итого 40
drwxr-xr-x 2 user user 4096 Май 29 16:06 Desktop
drwxr-xr-x 2 user user 4096 Май 25 01:11 Documents
drwxr-xr-x 2 user user 4096 Май 29 16:08 Download
drwxr-xr-x 2 user user 4096 Май 25 01:11 Music
drwxr-xr-x 2 user user 4096 Май 25 01:11 Pictures
drwxr-xr-x 2 user user 4096 Май 25 01:11 Public
-rw-r--r-- 1 user user 4737 Май 29 10:10 screen.png
drwxr-xr-x 2 user user 4096 Май 25 01:11 Templates
drwxr-xr-x 2 user user 4096 Май 25 01:11 Videos
09:19:52
#cd

09:20:03
#ls -l | less
09:29:58
#mdadm --detail /dev/md0
bash: mdadm: команда не найдена
09:38:02
#mdadm --detail /dev/md0

09:38:46
#apt-get instal mdadm
E: Неверная операция instal
09:38:58
#apt-get install mdadm
Generating array device nodes... done.
Generating mdadm.conf... done.
update-initramfs: deferring update (trigger activated)
Starting MD monitoring service: mdadm --monitor.
Assembling MD arrays...done (no arrays found in config file or automatically).
Обрабатываются триггеры для initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.29-2-686
dpkg: предупреждение: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
dpkg: предупреждение: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
W: mdadm: no arrays defined in configuration file.
09:39:39
#mdadm --detail /dev/md0

09:39:39
#mdadm --detail /dev/md0

09:39:39
#ls -l | less
прошла 91 минута
11:11:07
#arp -an
? (192.168.15.254) at 00:15:60:7a:63:80 [ether] on eth0
11:15:50
#ping 192.168.35.9
PING 192.168.35.9 (192.168.35.9) 56(84) bytes of data.
^[[A^[[B^C
--- 192.168.35.9 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3022ms
11:16:46
#ping 192.168.15.9
PING 192.168.15.9 (192.168.15.9) 56(84) bytes of data.
64 bytes from 192.168.15.9: icmp_seq=1 ttl=64 time=3.08 ms
64 bytes from 192.168.15.9: icmp_seq=2 ttl=64 time=0.996 ms
64 bytes from 192.168.15.9: icmp_seq=3 ttl=64 time=1.00 ms
c^[[A^[[A64 bytes from 192.168.15.9: icmp_seq=4 ttl=64 time=0.816 ms
64 bytes from 192.168.15.9: icmp_seq=5 ttl=64 time=1.00 ms
^C
--- 192.168.15.9 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.816/1.383/3.088/0.855 ms
11:16:55
#arp -an
? (192.168.15.254) at 00:15:60:7a:63:80 [ether] on eth0
? (192.168.15.9) at 00:1e:8c:64:2c:4a [ether] on eth0
11:16:57
#apt-get install arping
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Следующие пакеты устанавливались автоматически и больше не требуются:
  portmap
Для их удаления используйте 'apt-get autoremove'.
Будут установлены следующие дополнительные пакеты:
  libnet1
НОВЫЕ пакеты, которые будут установлены:
  arping libnet1
...
Получено:2 http://192.168.15.10 sid/main arping 2.08-1 [23,4kB]
Получено 79,0kБ за 0s (2662kБ/c)
Выбор ранее не выбранного пакета libnet1.
(Чтение базы данных ... на данный момент установлено 61272 файлов и каталогов.)
Распаковывается пакет libnet1 (из файла .../libnet1_1.1.2.1-5_i386.deb)...
Выбор ранее не выбранного пакета arping.
Распаковывается пакет arping (из файла .../arping_2.08-1_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет libnet1 (1.1.2.1-5) ...
Настраивается пакет arping (2.08-1) ...
11:21:34
#apt-get install ettercap
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Следующие пакеты устанавливались автоматически и больше не требуются:
  portmap
Для их удаления используйте 'apt-get autoremove'.
Будут установлены следующие дополнительные пакеты:
  ettercap-common
НОВЫЕ пакеты, которые будут установлены:
  ettercap ettercap-common
...
Получено:2 http://192.168.15.10 sid/main ettercap 1:0.7.3-1.2+b1 [191kB]
Получено 500kБ за 0s (2766kБ/c)
Выбор ранее не выбранного пакета ettercap-common.
(Чтение базы данных ... на данный момент установлено 61293 файлов и каталогов.)
Распаковывается пакет ettercap-common (из файла .../ettercap-common_1%3a0.7.3-1.2+b1_i386.deb)...
Выбор ранее не выбранного пакета ettercap.
Распаковывается пакет ettercap (из файла .../ettercap_1%3a0.7.3-1.2+b1_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет ettercap-common (1:0.7.3-1.2+b1) ...
Настраивается пакет ettercap (1:0.7.3-1.2+b1) ...
прошло 117 минут
13:18:49
#cat /etc/network/interfaces
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo eth0
iface lo inet loopback
iface eth0 inet static
    address 192.168.15.10
    netmask 255.255.255.0
    network 192.168.15.0
    broadcast 192.168.15.255
    gateway 192.168.15.254
прошло 32 минуты
13:51:01
#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.15.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.15.254  0.0.0.0         UG    0      0        0 eth0
/dev/pts/0
13:54:07
#exit

прошло 10 минут
14:04:37
$screen -r
/dev/pts/0
14:04:58
$ssh root@10.0.35.100
root@10.0.35.100's password:
Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 i686
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.
Last login: Mon Jun  1 15:18:51 2009 from linux9.unix.nt
l3-agent is already running: pid=1765; pidfile=/root/.lilalo/l3-agent.pid
/dev/pts/3
14:05:47
#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.15.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.15.254  0.0.0.0         UG    0      0        0 eth0
прошло 13 минут
/dev/pts/0
14:19:07
#screen -x
прошла 21 минута
14:40:45
#screen -r
прошло 22 минуты
15:03:00
#screen -x 3755
/dev/pts/3
15:12:02
#фзеapt-get install vlan
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Следующие пакеты устанавливались автоматически и больше не требуются:
  portmap
Для их удаления используйте 'apt-get autoremove'.
НОВЫЕ пакеты, которые будут установлены:
  vlan
обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 20 пакетов не обновлено.
Необходимо скачать 39,6kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 176kB.
Получено:1 http://192.168.15.10 sid/main vlan 1.9-3 [39,6kB]
Получено 39,6kБ за 0s (527kБ/c)
Выбор ранее не выбранного пакета vlan.
(Чтение базы данных ... на данный момент установлено 61399 файлов и каталогов.)
Распаковывается пакет vlan (из файла .../archives/vlan_1.9-3_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет vlan (1.9-3) ...
прошло 14 минут
15:26:34
#vconfig
Expecting argc to be 3-5, inclusive.  Was: 1
Usage: add             [interface-name] [vlan_id]
       rem             [vlan-name]
       set_flag        [interface-name] [flag-num]       [0 | 1]
       set_egress_map  [vlan-name]      [skb_priority]   [vlan_qos]
       set_ingress_map [vlan-name]      [skb_priority]   [vlan_qos]
       set_name_type   [name-type]
* The [interface-name] is the name of the ethernet card that hosts
  the VLAN you are talking about.
* The vlan_id is the identifier (0-4095) of the VLAN you are operating on.
* skb_priority is the priority in the socket buffer (sk_buff).
* vlan_qos is the 3 bit priority in the VLAN header
* name-type:  VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
              DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
* FLAGS:  1 REORDER_HDR  When this is set, the VLAN device will move the
            ethernet header around to make it look exactly like a real
            ethernet device.  This may help programs such as DHCPd which
            read the raw ethernet packet and make assumptions about the
            location of bytes.  If you don't need it, don't turn it on, because
            there will be at least a small performance degradation.  Default