| /l3/users/igor-public/nt-scale/debian5.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 |
|
|
#vim /etc/qemu-ifup-my
--- /tmp/l3-saved-2671.18898.32565 2012-02-22 12:43:18.000000000 +0200 +++ /etc/qemu-ifup-my 2012-02-22 12:43:21.000000000 +0200 @@ -2,4 +2,4 @@ bridge=br10 brctl addbr $bridge $1 - +sleep 1 |
|
#cat /etc/qemu-ifup-my
#!/bin/sh bridge=br10 brctl addbr $bridge $1 sleep 1 |
|
#brctl show
bridge name bridge id STP enabled interfaces
br10 8000.000ffee6dd33 no eth0.10
tap0
pan0 8000.000000000000 no
|
|
#ssh igor@10.0.35.1
\The authenticity of host '10.0.35.1 (10.0.35.1)' can't be established.
RSA key fingerprint is eb:35:1f:f8:e4:a8:8a:9e:70:65:42:a8:93:78:98:9d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.35.1' (RSA) to the list of known hosts.
igor@10.0.35.1's password:
igor@unix:~$ for i in {1..5}; do sudo route add -net 192.168.${i}0.0/24 gw 10.0.35.4$i; done
[sudo] password for igor:
igor@unix:~$ for i in {1..5}; do sudo iptables -t nat -A POSTROUTING -s 192.168.${i}0.0/24 -j MASQUERADE; done
igor@unix:~$ exit
logout
Connection to 10.0.35.1 closed.
|
|
#ifconfig tap0 up
|
|
#lvdisplay
--- Logical volume --- LV Name /dev/VG0/vol1 VG Name VG0 LV UUID uoJDfW-wBtO-D69O-uGtF-bJ49-92ok-2T7TfO LV Write Access read/write LV Status available # open 0 LV Size 3.00 GiB Current LE 768 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 |
|
#lvdisplay
--- Logical volume --- LV Name /dev/VG0/vol1 VG Name VG0 LV UUID uoJDfW-wBtO-D69O-uGtF-bJ49-92ok-2T7TfO LV Write Access read/write LV Status available # open 0 LV Size 3.00 GiB Current LE 768 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 |
|
#mkfs.ext3 /dev/VG0/vol1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
196608 inodes, 786432 blocks
39321 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=805306368
24 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#mount /dev/VG0/vol1 /mnt
|
|
#apt-get install deboostrap
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package deboostrap |
|
#apt-get install debootstrap
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: debootstrap 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Need to get 57.5 kB of archives. After this operation, 274 kB of additional disk space will be used. Get:1 http://10.0.35.1/debian/ squeeze/main debootstrap all 1.0.26+squeeze1 [57.5 kB] Fetched 57.5 kB in 0s (3,918 kB/s) Selecting previously deselected package debootstrap. (Reading database ... 112631 files and directories currently installed.) Unpacking debootstrap (from .../debootstrap_1.0.26+squeeze1_all.deb) ... Processing triggers for man-db ... Setting up debootstrap (1.0.26+squeeze1) ... |
|
#debootstrap squeeze /mnt
I: Retrieving Release I: Retrieving Packages ^CE: Interrupt caught ... exiting |
|
#debootstrap squeeze /mnt http://10.0.35.1:9999/debian/
I: Retrieving Release I: Retrieving Packages I: Retrieving Packages I: Validating Packages I: Resolving dependencies of required packages... I: Resolving dependencies of base packages... I: Found additional required dependencies: insserv libbz2-1.0 libdb4.8 libslang2 I: Found additional base dependencies: libnfnetlink0 libsqlite3-0 I: Checking component main on http://10.0.35.1:9999/debian... I: Retrieving libacl1 ... I: Configuring gpgv... I: Configuring gnupg... I: Configuring debian-archive-keyring... I: Configuring apt... I: Configuring libept1... I: Configuring apt-utils... I: Configuring aptitude... I: Configuring tasksel-data... I: Configuring tasksel... I: Base system installed successfully. |
|
#chroot /mnt
root@debian5:/# root@debian5:/# root@debian5:/# ls -l total 96 drwxr-xr-x 2 root root 4096 Feb 22 12:31 bin drwxr-xr-x 2 root root 4096 Jan 22 21:05 boot drwxr-xr-x 5 root root 4096 Feb 22 12:31 dev drwxr-xr-x 43 root root 4096 Feb 22 12:31 etc drwxr-xr-x 2 root root 4096 Jan 22 21:05 home drwxr-xr-x 10 root root 12288 Feb 22 12:31 lib ... drwx------ 2 root root 4096 Feb 22 12:31 root drwxr-xr-x 2 root root 4096 Feb 22 12:31 sbin drwxr-xr-x 2 root root 4096 Jul 21 2010 selinux drwxr-xr-x 2 root root 4096 Feb 22 12:31 srv drwxr-xr-x 2 root root 4096 Jan 1 2011 sys drwxrwxrwt 2 root root 4096 Feb 22 12:31 tmp drwxr-xr-x 10 root root 4096 Feb 22 12:31 usr drwxr-xr-x 13 root root 4096 Feb 22 12:31 var root@debian5:/# exit exit |
|
#mount --bind /dev /mnt/dev
|
|
#mount --bind /proc /mnt/proc
|
|
#mount --bind /sys /mnt/sys
|
|
#cat /etc/apt/sources.list
# # deb cdrom:[Debian GNU/Linux 6.0.2.1 _Squeeze_ - Unofficial bpo i386 NETINST Binary-1 20110628-13:01]/ squeeze contrib main non-free #deb cdrom:[Debian GNU/Linux 6.0.2.1 _Squeeze_ - Unofficial bpo i386 NETINST Binary-1 20110628-13:01]/ squeeze contrib main non-free deb http://10.0.35.1:9999/debian/ squeeze main deb-src http://10.0.35.1:9999/debian/ squeeze main deb http://security.debian.org/ squeeze/updates main contrib non-free deb-src http://security.debian.org/ squeeze/updates main contrib non-free # squeeze-updates, previously known as 'volatile' deb http://10.0.35.1:9999/debian/ squeeze-updates main contrib non-free deb-src http://10.0.35.1:9999/debian/ squeeze-updates main contrib non-free |
|
#kvm -hda /dev/VG0/vol1
|
|
#chroot /mnt
root@debian5:/# ls -l /dev/VG0/vol1 lrwxrwxrwx 1 root root 7 Feb 22 12:38 /dev/VG0/vol1 -> ../dm-0 root@debian5:/# grub-install /dev/dm-0 /usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk. This is a BAD idea.. /usr/sbin/grub-setup: error: embedding is not possible, but this is required when the root device is on a RAID array or LVM volume. root@debian5:/# file -s /dev/dm-0 /dev/dm-0: Linux rev 1.0 ext3 filesystem data, UUID=f49a1481-4524-4ca5-b6ea-2086a9ad0f5d (needs journal recovery) (large files) root@debian5:/# grub bash: grub: command not found root@debian5:/# grub- ... /usr/lib/grub/i386-pc/stage2 /usr/lib/grub/i386-pc/stage2_eltorito /usr/bin /usr/bin/mkbimage /usr/bin/mbchk root@debian5:/# grub-install /dev/dm-0 Searching for GRUB installation directory ... found: /boot/grub The file /boot/grub/stage1 not read correctly. root@debian5:/# exit exit |
|
#chroot /mnt
root@debian5:/# exit exit |
|
#lvcreate -L 100M -n grub /dev/VG0
Logical volume "grub" created |
|
#cfdisk /dev/VG0/grub
|
|
#mkfs.ext3 /dev/mapper/
control VG0-grub VG0-grub1 VG0-vol1 |
|
#mkfs.ext3 /dev/mapper/VG0-grub1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
24096 inodes, 96356 blocks
4817 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
12 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#mkdir /mnt2
|
|
#mount /dev/mapper/VG0-grub1 /mnt2
|
|
#grub-install /dev/VG0/grub --root-directory=/mnt2
/usr/sbin/grub-probe: error: no such disk. Auto-detection of a filesystem of /dev/mapper/VG0-grub1 failed. Please report this together with the output of "/usr/sbin/grub-probe --device-map=/mnt2/boot/grub/device.map --target=fs -v /mnt2/boot/grub" to <bug-grub@gnu.org> |
|
#cp -R /boot /mnt2/
boot/ lost+found/ |
|
#cp -R /boot /mnt2/boot/grub/
Display all 189 possibilities? (y or n) |
|
#umount /mnt/mnt2
|
|
#umount /mnt/dev
umount: /mnt/dev: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
|
|
#umount /mnt/proc
|
|
#umount /mnt/dev
umount: /mnt/dev: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
|
|
#umount /mnt/sys
|
|
#lsof /mnt/dev
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 root 10u FIFO 0,5 0t0 2743 /dev/initctl udevd 442 root 0u CHR 1,3 0t0 1042 /dev/null udevd 442 root 1u CHR 1,3 0t0 1042 /dev/null udevd 442 root 2u CHR 1,3 0t0 1042 /dev/null udevd 442 root 3u REG 0,5 536 661756 /dev/.udev/queue.bin portmap 1171 daemon 0u CHR 1,3 0t0 1042 /dev/null portmap 1171 daemon 1u CHR 1,3 0t0 1042 /dev/null portmap 1171 daemon 2u CHR 1,3 0t0 1042 /dev/null rpc.statd 1183 statd 0u CHR 1,3 0t0 1042 /dev/null ... sshd 5781 root 11u CHR 5,2 0t0 869 /dev/ptmx script 5786 root 4u CHR 5,2 0t0 869 /dev/ptmx script 5835 root 4u CHR 5,2 0t0 869 /dev/ptmx dbus-daem 23234 Debian-exim 0u CHR 1,3 0t0 1042 /mnt/dev/null dbus-daem 23234 Debian-exim 1u CHR 1,3 0t0 1042 /mnt/dev/null dbus-daem 23234 Debian-exim 2u CHR 1,3 0t0 1042 /mnt/dev/null dbus-daem 23234 Debian-exim 4u CHR 1,3 0t0 1042 /mnt/dev/null udevd 23870 root 0u CHR 1,3 0t0 1042 /dev/null udevd 23870 root 1u CHR 1,3 0t0 1042 /dev/null udevd 23870 root 2u CHR 1,3 0t0 1042 /dev/null |
|
#kill 23234
|
|
#umount /mnt/sys
umount: /mnt/sys: not mounted |
|
#umount /mnt/dev
|
|
#lsd
bash: lsd: command not found |
|
#pkill qemu
|
|
#less
|
|
#ps aux | less
|
|
#/etc/init.d/gdm3 restart
Stopping GNOME Display Manager: gdm3. Starting GNOME Display Manager: gdm3. |
|
#lvcreate -L 3G -n vol2 /dev/VG0
Insufficient free extents (399) in volume group VG0: 768 required |
|
#pvdisplay
--- Physical volume --- PV Name /dev/md0 VG Name VG0 PV Size 4.66 GiB / not usable 260.00 KiB Allocatable yes PE Size 4.00 MiB Total PE 1192 Free PE 399 Allocated PE 793 PV UUID EO3JYK-SH1x-FKhg-Q28x-0IEz-350u-94jgIR "/dev/sda7" is a new physical volume of "4.66 GiB" --- NEW Physical volume --- PV Name /dev/sda7 VG Name PV Size 4.66 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID muFwDN-QMzm-7B8r-Q57P-W63v-fPOB-1B8iou |
|
#vgdisplay
--- Volume group --- VG Name VG0 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 36 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 4.66 GiB PE Size 4.00 MiB Total PE 1192 Alloc PE / Size 793 / 3.10 GiB Free PE / Size 399 / 1.56 GiB VG UUID 1shb9G-HVgI-8P40-8jqi-D92G-rkmk-tnth3W |
|
#fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x9c41c86e Device Boot Start End Blocks Id System /dev/sda1 1 6079 48827392 83 Linux /dev/sda2 6079 7903 14648929 5 Extended /dev/sda5 6079 6687 4881408 82 Linux swap / Solaris /dev/sda6 6687 7295 4883728+ 83 Linux /dev/sda7 7295 7903 4883728+ 83 Linux |
|
#pvdisplay
--- Physical volume --- PV Name /dev/md0 VG Name VG0 PV Size 4.66 GiB / not usable 260.00 KiB Allocatable yes PE Size 4.00 MiB Total PE 1192 Free PE 399 Allocated PE 793 PV UUID EO3JYK-SH1x-FKhg-Q28x-0IEz-350u-94jgIR "/dev/sda7" is a new physical volume of "4.66 GiB" --- NEW Physical volume --- PV Name /dev/sda7 VG Name PV Size 4.66 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID muFwDN-QMzm-7B8r-Q57P-W63v-fPOB-1B8iou |
|
#cfdisk /dev/sda
|
|
#fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x9c41c86e Device Boot Start End Blocks Id System /dev/sda1 1 6079 48827392 83 Linux /dev/sda2 6079 7295 9765169 5 Extended /dev/sda5 6079 6687 4881408 82 Linux swap / Solaris /dev/sda6 6687 7295 4883728+ 83 Linux |
|
#cfdisk /dev/sda
|
|
#partprobe
|
|
#pvcreate /dev/sda7
Physical volume "/dev/sda7" successfully created |
|
#vgextend VG0 /dev/sda7
Volume group "VG0" successfully extended |
|
#lvcreate -L 3G -n vol2 /dev/VG0
Logical volume "vol2" created |
|
#cfdisk /dev/VG0/vol2
|
|
#kpartx -a /dev/VG0/vol2
|
|
#ls /dev/mapper/
control VG0-grub VG0-grubp1 VG0-vol1 VG0-vol2 VG0-vol2p1 |
|
#mount /dev/mapper/VG0-vol2p1 /mnt2/
mount: you must specify the filesystem type |
|
#mount /dev/mapper/VG0-vol2p1 /mnt2/
|
|
#mount /dev/VG0/vol1 /mnt/
|
|
#rsync -a /mnt/ /mnt2/
|
|
#umount /mnt
|
|
## mount --bind /dev /mnt/dev
|
|
## mount --bind /proc /mnt/proc
|
|
## mount --bind /sys /mnt/sys
|
|
#chroot /mnt
root@debian5:/# grub-install
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.
-h, --help print this message and exit
-v, --version print the version information and exit
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-shell=FILE use FILE as the grub shell
--no-floppy do not probe any floppy drive
--force-lba force GRUB to use LBA mode even for a buggy
BIOS
--recheck probe a device map even if it already exists
INSTALL_DEVICE can be a GRUB device name or a system device filename.
grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory, and uses the grub shell to install grub into the boot
sector.
Report bugs to <bug-grub@gnu.org>.
root@debian5:/# exit
exit
|
|
#chroot /mnt
grub> setup )hd0) Error 11: Unrecognized device string grub> setup (hd0) Checking if "/boot/grub/stage1" exists... no Checking if "/grub/stage1" exists... no Error 15: File not found grub> grub> quit root@debian5:/# root@debian5:/# root@debian5:/# root@debian5:/# exit exit |
|
#umount /mnt/proc
|
|
#umount /mnt/sys
|
|
#umount /mnt
|
|
#mount /dev/VG0/vol1 /mnt
|
|
#ls /mnt/lib/modules/
2.6.32-5-686 |
|
#cp -R /lib/modules/2.6.39-bpo.2-686-pae /mnt/lib/modules/
|
|
#vim start-kvm
--- /dev/null 2012-02-22 15:07:00.962090636 +0200 +++ start-kvm 2012-02-22 15:53:02.000000000 +0200 @@ -0,0 +1,9 @@ +kvm \ + -m 512 + -hda /dev/VG0/vol1 \ + -kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \ + -initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \ + -append root=/dev/sda \ + -net nic,vlan=0 \ + -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my + |
|
#~
kvm \
-m 512 \
-hda /dev/VG0/vol1 \
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
|
|
#ls /boot/vmlinuz-2.6.39-bpo.2-686-pae
/boot/vmlinuz-2.6.39-bpo.2-686-pae |
|
#ls /boot/initrd.img-2.6.39-bpo.2-686-pae
/boot/initrd.img-2.6.39-bpo.2-686-pae |
|
#mount /dev/VG0/vol1 /mnnt
mount: mount point /mnnt does not exist |
|
#mount /dev/VG0/vol1 /mnt
mount: /dev/mapper/VG0-vol1 already mounted or /mnt busy mount: according to mtab, /dev/mapper/VG0-vol1 is already mounted on /mnt |
|
#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) /dev/mapper/VG0-vol1 on /mnt type ext3 (rw) |
|
#cp /etc/network/interfaces /mnt/etc/network/interfaces
|
|
#vim /mnt/etc/network/interfaces
--- /tmp/l3-saved-2356.21316.21153 2012-02-22 16:01:34.000000000 +0200 +++ /mnt/etc/network/interfaces 2012-02-22 16:02:13.000000000 +0200 @@ -5,26 +5,14 @@ auto lo iface lo inet loopback -auto eth0.10 eth0.20 - # The primary network interface allow-hotplug eth0 iface eth0 inet static - address 10.0.35.45 + address 192.168.10.5 netmask 255.255.255.0 - network 10.0.35.0 - broadcast 10.0.35.255 - gateway 10.0.35.1 + network 192.168.10.0 + gateway 192.168.10.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.0.35.1 dns-search unix.nt -iface eth0.10 inet static - address 192.168.10.5 - netmask 255.255.255.0 - broadcast 192.168.10.255 - -iface eth0.20 inet static - address 192.168.20.5 - netmask 255.255.255.0 - |
|
#cat /mnt/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.10.5
netmask 255.255.255.0
network 192.168.10.0
gateway 192.168.10.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.0.35.1
dns-search unix.nt
|
|
##cp -R /lib/modules/2.6.39-bpo.2-686-pae /mnt/lib/modules/:
|
|
#sed -i s/192.168.10.5/192.168.10.15/ /mnt/etc/network/interfaces
|
|
#ls /mnt/etc/udev/rules.d/
70-persistent-net.rules z60_hdparm.rules |
|
##useradd -m user
|
|
#vim start-kvm
--- /tmp/l3-saved-2356.25749.11812 2012-02-22 16:19:29.000000000 +0200
+++ start-kvm 2012-02-22 16:20:06.000000000 +0200
@@ -1,6 +1,9 @@
+HDA=/dev/VG0/vol1
+umount ${HDA} >& /dev/null
+
kvm \
-m 512 \
- -hda /dev/VG0/vol1 \
+ -hda \
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
|
|
#cat start-kvm
HDA=/dev/VG0/vol1
umount ${HDA} >& /dev/null
kvm \
-m 512 \
-hda \
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
|
|
#pwd
/root |
|
#lsof +D /mnt
|
|
#vim start-kvm
--- /tmp/l3-saved-2356.31269.7921 2012-02-22 16:53:14.000000000 +0200
+++ start-kvm 2012-02-22 16:53:33.000000000 +0200
@@ -7,6 +7,7 @@
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
+ -nographic \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
|
|
#cat start-kvm
HDA=/dev/VG0/vol1
umount ${HDA} >& /dev/null
kvm \
-m 512 \
-hda \
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
-nographic \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
|
|
#vim start-kvm
--- /tmp/l3-saved-2356.1285.10540 2012-02-22 16:55:06.000000000 +0200
+++ start-kvm 2012-02-22 16:55:17.000000000 +0200
@@ -8,6 +8,7 @@
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
-nographic \
+ -daemonize \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
|
|
#cat start-kvm
HDA=/dev/VG0/vol1
umount ${HDA} >& /dev/null
kvm \
-m 512 \
-hda \
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
-nographic \
-daemonize \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
|
# # deb cdrom:[Debian GNU/Linux 6.0.2.1 _Squeeze_ - Unofficial bpo i386 NETINST Binary-1 20110628-13:01]/ squeeze contrib main non-free #deb cdrom:[Debian GNU/Linux 6.0.2.1 _Squeeze_ - Unofficial bpo i386 NETINST Binary-1 20110628-13:01]/ squeeze contrib main non-free deb http://10.0.35.1:9999/debian/ squeeze main deb-src http://10.0.35.1:9999/debian/ squeeze main deb http://security.debian.org/ squeeze/updates main contrib non-free deb-src http://security.debian.org/ squeeze/updates main contrib non-free # squeeze-updates, previously known as 'volatile' deb http://10.0.35.1:9999/debian/ squeeze-updates main contrib non-free deb-src http://10.0.35.1:9999/debian/ squeeze-updates main contrib non-free
#!/bin/sh bridge=br10 brctl addbr $bridge $1 sleep 1
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.10.5
netmask 255.255.255.0
network 192.168.10.0
gateway 192.168.10.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.0.35.1
dns-search unix.nt
HDA=/dev/VG0/vol1
umount ${HDA} >& /dev/null
kvm \
-m 512 \
-hda \
-kernel /boot/vmlinuz-2.6.39-bpo.2-686-pae \
-initrd /boot/initrd.img-2.6.39-bpo.2-686-pae \
-append root=/dev/sda \
-nographic \
-daemonize \
-net nic,vlan=0 \
-net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup-my
| Время первой команды журнала | 11:42:51 2012- 2-22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Время последней команды журнала | 15:55:17 2012- 2-22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент команд с ненулевым кодом завершения, % | 14.85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент синтаксически неверно набранных команд, % | 0.99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Суммарное время работы с терминалом *, час | 2.17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в единицу времени, команда/мин | 0.78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ 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 |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
| Интересно, кто я? |
Если комментарий содержит несколько строк, его