/l3/users/vmk64646464/nt-scale/debian4.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 |
|
#vi /etc/network/interfaces
--- /tmp/l3-saved-2751.2075.18297 2012-02-24 12:45:34.000000000 +0200 +++ /etc/network/interfaces 2012-02-24 12:45:55.000000000 +0200 @@ -29,5 +29,5 @@ iface eth0.40 inet manual up brctl addbr br40 up brctl addif br40 eth0.40 - up ifconfig br10 192.168.40.4 255.255.255.0 + up ifconfig br40 192.168.40.4 255.255.255.0 |
#cat /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 eth0.10 eth0.40 iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 10.0.35.44 netmask 255.255.255.0 ... iface eth0.10 inet static address 192.168.10.4 netmask 255.255.255.0 #iface eth0.40 inet static # address 192.168.40.4 # netmask 255.255.255.0 iface eth0.40 inet manual up brctl addbr br40 up brctl addif br40 eth0.40 up ifconfig br10 192.168.40.4 255.255.255.0 |
#brctl show
bridge name bridge id STP enabled interfaces br40 8000.000ffe7ea77b no eth0.40 vif1.0 |
#vi clonevm
![]() --- /dev/null 2012-02-24 12:41:55.008000001 +0200 +++ clonevm 2012-02-24 12:49:42.000000000 +0200 @@ -0,0 +1,19 @@ + +NAME="$1" +SOURCE=/dev/VG0/vol1 +DEST=/dev/VG0/${NAME} +set -e +lvcreate -L 4G -n ${NAME} /dev/VG0 +mkfs.ext3 ${DEST} +mkdir -p /mnt2/ +mount ${SOURCE} /mnt/ +mount ${DEST} /mnt2/ +rsync -a /mnt/ /mnt2/ +cat <<EOF + edit /mnt/etc/network/interfaces and /etc/hostname + and then exit +EOF +bash +umount /mnt +umount /mnt2 + |
#cat /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 eth0.10 eth0.40 iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 10.0.35.44 netmask 255.255.255.0 ... iface eth0.10 inet static address 192.168.10.4 netmask 255.255.255.0 #iface eth0.40 inet static # address 192.168.40.4 # netmask 255.255.255.0 iface eth0.40 inet manual up brctl addbr br40 up brctl addif br40 eth0.40 up ifconfig br40 192.168.40.4 255.255.255.0 |
#cat /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 eth0.10 eth0.40 iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 10.0.35.44 netmask 255.255.255.0 ... iface eth0.10 inet static address 192.168.10.4 netmask 255.255.255.0 #iface eth0.40 inet static # address 192.168.40.4 # netmask 255.255.255.0 iface eth0.40 inet manual up brctl addbr br40 up brctl addif br40 eth0.40 up ifconfig br40 192.168.40.4 255.255.255.0 |
#./clonevm
![]() ./clonevm: line 1: f: команда не найдена ./clonevm: line 2: syntax error near unexpected token `then' ./clonevm: line 2: `then' |
#./clonevm
![]() ./clonevm: line 1: f: команда не найдена ./clonevm: line 2: syntax error near unexpected token `then' ./clonevm: line 2: `then' |
#vi clonevm
--- /tmp/l3-saved-2751.14507.25779 2012-02-24 12:53:13.000000000 +0200 +++ clonevm 2012-02-24 12:53:46.000000000 +0200 @@ -1,4 +1,4 @@ -f [ $# != 2 ] +if [ $# != 2 ] then cat <<EOF Usage: |
#./clonevm
![]() Usage: ./clonevm source-volume dest-volume Example: ./clonevm vol2 EOF exit 1 fi if [ "" = "" ] then cat <<EOF Source and destination volumes are the same: |
#./clonevm
![]() Usage: ./clonevm source-volume dest-volume Example: ./clonevm vol2 EOF exit 1 fi if [ "" = "" ] then cat <<EOF Source and destination volumes are the same: |
#pvdisplay
![]() --- Physical volume --- PV Name /dev/md1 VG Name VG0 PV Size 4,65 GiB / not usable 1,18 MiB Allocatable yes PE Size 4,00 MiB Total PE 1191 Free PE 167 Allocated PE 1024 PV UUID hNOX7k-LiuG-UlxH-u7Rr-0Xhb-Q11G-27l408 |
#pvdisplay
--- Physical volume --- PV Name /dev/md1 VG Name VG0 PV Size 4,65 GiB / not usable 1,18 MiB Allocatable yes PE Size 4,00 MiB Total PE 1191 Free PE 167 Allocated PE 1024 PV UUID hNOX7k-LiuG-UlxH-u7Rr-0Xhb-Q11G-27l408 |
#vgdisplay
![]() --- Volume group --- VG Name VG0 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 11 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 4,65 GiB PE Size 4,00 MiB Total PE 1191 Alloc PE / Size 1024 / 4,00 GiB Free PE / Size 167 / 668,00 MiB VG UUID AhiA0l-KDWi-VnrA-wtlB-TVo1-EpHM-hBZx3w |
#vgdisplay
--- Volume group --- VG Name VG0 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 11 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 4,65 GiB PE Size 4,00 MiB Total PE 1191 Alloc PE / Size 1024 / 4,00 GiB Free PE / Size 167 / 668,00 MiB VG UUID AhiA0l-KDWi-VnrA-wtlB-TVo1-EpHM-hBZx3w |
#pvdisplay
![]() --- Physical volume --- PV Name /dev/md1 VG Name VG0 PV Size 4,65 GiB / not usable 1,18 MiB Allocatable yes PE Size 4,00 MiB Total PE 1191 Free PE 167 Allocated PE 1024 PV UUID hNOX7k-LiuG-UlxH-u7Rr-0Xhb-Q11G-27l408 |
#pvdisplay
--- Physical volume --- PV Name /dev/md1 VG Name VG0 PV Size 4,65 GiB / not usable 1,18 MiB Allocatable yes PE Size 4,00 MiB Total PE 1191 Free PE 167 Allocated PE 1024 PV UUID hNOX7k-LiuG-UlxH-u7Rr-0Xhb-Q11G-27l408 |
#file -s /dev/md1
![]() /dev/md1: LVM2 (Linux Logical Volume Manager) , UUID: hNOX7kLiuGUlxHu7Rr0XhbQ11G27l40 |
#file -s /dev/md1
/dev/md1: LVM2 (Linux Logical Volume Manager) , UUID: hNOX7kLiuGUlxHu7Rr0XhbQ11G27l40 |
#mdadm --help
![]() mdadm is used for building, managing, and monitoring Linux md devices (aka RAID arrays) Usage: mdadm --create device options... Create a new array from unused devices. mdadm --assemble device options... Assemble a previously created array. mdadm --build device options... Create or assemble an array without metadata. mdadm --manage device options... make changes to an existing array. ... Shorthand for --manage. Any parameter that does not start with '-' is treated as a device name or, for --examine-bitmap, a file name. The first such name is often the name of an md device. Subsequent names are often names of component devices. For detailed help on the above major modes use --help after the mode e.g. mdadm --assemble --help For general help on options use mdadm --help-options |
#mdadm --help
mdadm is used for building, managing, and monitoring Linux md devices (aka RAID arrays) Usage: mdadm --create device options... Create a new array from unused devices. mdadm --assemble device options... Assemble a previously created array. mdadm --build device options... Create or assemble an array without metadata. mdadm --manage device options... |